SC3 Pulse Train
Wednesday, December 15, 2004, 11:21 PM
One possible way to implement a pulse-train:



//client side:

SynthDef("gate",{ arg out=0,gate=0;
Out.ar(out,
FSinOsc.ar(500, 0).distort*gate;
)
}).send(s);

a=Synth("gate");

~prob=0.9;
~trainSpeed=0.01;

r=Routine.new({
if(coin(~prob),{
a.set(\gate,1);
"1".postln;
},
{
a.set(\gate,0);
"0".postln;
});
~trainSpeed.yieldAndReset;
});

SystemClock.play(r);