First, I don’t encounter any drift with your example here on my system (SC 3.9.3 on Mac with 10.10).
There are two points that confused me a bit with this example: The doubling of the LFPulse frequency (due to causing 2 DC clicks per period, which is kind of harsh) and the random duration in the Pattern. OffsetOut improves accuracy, but even with Out this variant doesn’t run out of sync here:
(
~myClock = TempoClock.new(2.2);
SynthDef(\beep, { OffsetOut.ar(0, SinOsc.ar(\freq.kr(440), mul:\amp.kr)!2*EnvGate()) }).add;
{
Ndef(\a).proxyspace.clock = ~myClock;
Ndef(\a).proxyspace.quant = 1;
Ndef(\b).proxyspace.clock = ~myClock;
Ndef(\b).proxyspace.quant = 1;
Ndef(\a, Pbind(\instrument, \beep,
\dur, 1,
\degree, Prand((0..14),inf),
\amp, 0.4,
\legato, 0.03));
Ndef(\b, { Decay.ar(Impulse.ar(2.2!2), 1, mul:0.2).lag(0.001) });
Ndef(\a).play;
Ndef(\b).play;
}.fork(~myClock);
)
How long does it need to get out of sync on your machine ?
Besides of the concrete example: yes, syncing between Patterns and Server can be demanding and the reason for this is a necessary realtime adjustment that probably can’t be overcome. I have given an example here: