[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] Pause a Routine (AppClock)



On Mar 2, 2009, at 6:09 PM, James Harkins wrote:

There is a potential disadvantage to running the GUI task 100% on
AppClock, and that is drift. Waiting 1.0 seconds in AppClock means the
next thing will happen 1.0 seconds *after the last yield*, not after
the last wakeup. So AppClock can get progressively later.

To illustrate:

r = Routine {
loop {
thisThread.clock.beats.postln;
1.0.wait;
};
};

SystemClock.schedAbs(SystemClock.beats.roundUp(1), { r.reset.play(SystemClock) });
r.stop;

AppClock.sched(AppClock.beats.roundUp(1) - AppClock.beats, { r.reset.play(AppClock) });
r.stop;

hjh


: H. James Harkins
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman