The previous code has rhythmic accuracy problems. Thus, I changed the code to the code below, but it still has rhythm issues. What does cause rhythmic instability?
(
s.waitForBoot{
var window, view, synth;
window = Window("FreqScopeViews", Rect(0, 0, 368, 440));
view = View(window,
Rect(0, 0, window.bounds.width, window.bounds.height));
{ |i|
a = StaticText(view, Rect(3, i * 220, 362, 20))
.string_(["Left", "Right"][i]);
FreqScopeView(view, Rect(3, i * 200 + (i + 1 * 20), 362, 200))
.active_(true)
.freqMode_(1)
.inBus_(i)}!2;
window.front;
SynthDef(\sendReplyTest, { |t_gate|
var interval = 1/3;
var trig = Impulse.kr(interval);
var randoms = TRand.kr(54, 60, trig!2) + [0, 30];
var sig = SinOsc.ar(
(
\sortedRandoms.kr([0!2])
.poll(interval * 3, label: "received")
+.t[0, 3, 7, 9, 11, 14, 18, 20]
)
.midicps)
* 0.01
* EnvGen.kr(Env.perc, t_gate);
SendReply.kr(trig, '/randoms', randoms.poll(interval, label: "sending"));
OffsetOut.ar(0, sig)
}).add;
s.sync;
s.makeBundle(0.2, {
synth = Synth(\sendReplyTest) });
OSCdef(\listener, { |msg|
var randoms = msg[3..];
randoms.sort;
synth.set(\sortedRandoms, randoms.postln, \t_gate, 1)
}, '/randoms')
}
)