diff --git a/sclang-play/tutorial.sc b/sclang-play/tutorial.sc index 8508916..7dfd76d 100644 --- a/sclang-play/tutorial.sc +++ b/sclang-play/tutorial.sc @@ -736,3 +736,45 @@ SystemClock.sched(10, { x.free; b.free; }); ) + +( + SystemClock.sched(5, { "hello".postln }); +) + +( + var timeNow = TempoClock.default.beats; + "Time is now: ".post; + timeNow.postln; + "Scheduling for: ".post; + (timeNow + 5).postln; + TempoClock.default.schedAbs(timeNow + 5, + { "Time is later: ".post; thisThread.clock.beats.postln; nil } + ); +) + +( + var timeNow; + "------------------------------------".postln; + TempoClock.default.tempo = 2; + timeNow = TempoClock.default.beats; + "Time is now: ".post; + timeNow.postln; + "Scheduling for: ".post; + (timeNow + 5).postln; + TempoClock.default.schedAbs(timeNow + 5, + { "Time is later: ".post; thisThread.clock.beats.postln; nil } + ); +) + +( + "SystemClock.beats: ".post; SystemClock.beats.postln; + "TempoClock.default.beats: ".post; TempoClock.default.beats.postln; + "AppClock.beats: ".post; AppClock.beats.postln; + Task({ + "thisThread.clock.beats: ".post; thisThread.clock.beats.postln; + }).play; +) + +( + TempoClock.default.sched(5, { "hello".postln; nil; }); +)