s.boot

~eseDur=OSCresponder(nil,"/tito", {|a,b,c| c[1].postln}).add

(
SynthDef(\yun, {|freq, amp|
			  var sig, env;
			  sig=Saw.ar(Lag.kr(freq,0.1), amp);
			  sig=SinOsc.ar(100)*sig;
			  Out.ar(0,sig);
			  }).send(s)
)
~yun.free;
~yun=Synth(\yun)

(
SynthDef(\yon, {|freq, amp|
			  var sig, env;
			  sig=Saw.ar(Lag.kr(freq,0.1), amp);
			  sig=SinOsc.ar(1000)*sig;
			  Out.ar(1,sig);
			  }).send(s)
)
~yon.free;
~yon=Synth(\yon)

(
Tdef(\yun, {var freq=0, amp=1, mod=60, mul=1, sum=1;
		  inf.do{freq=freq+sum;
		  		amp=[0,0,1].choose;
		  		~yun.set(\freq, (freq%mod)*mul, \amp, amp);
		  		if(freq==mod, {freq=0;mod=rrand(60,13); mul=rrand(10,100); sum=rrand(-10,10)});
		  		0.1.wait;
		  		}
		  })
);
(
Tdef(\yon, {var freq=0, amp=1, mod=60, mul=1, sum=1;
		  inf.do{freq=freq+sum;
		  		amp=[0,0,1].choose;
		  		~yon.set(\freq, (freq%mod)*mul, \amp, amp);
		  		if(freq==mod, {freq=0;mod=rrand(12,70); mul=rrand(30,100); sum=rrand(-10,10)});
		  		0.1.wait;
		  		}
		  })
)
Tdef(\yun).play
Tdef(\yon).play

Tdef(\yun).stop
Tdef(\yon).stop

(
Tdef(\sino, {
			inf.do{
				if(2.rand==0,{Tdef(\yun).stop},{Tdef(\yun).play});
				if(2.rand==0,{Tdef(\yon).stop},{Tdef(\yon).play});
				4.wait;
				}
		})
)

Tdef(\sino).play
Tdef(\sino).stop

(
SynthDef(\bum, {|freq, amp|
			  var sig, env;
			  sig=SinOsc.ar(freq,0,amp)+Saw.ar(freq,amp*0.2);
			  env=EnvGen.kr(Env.perc(0.01,2),doneAction:2);
			  Out.ar(0,sig*env);
			  }).send(s);
)

Synth(\bum, [\freq, 100, \amp, 1])

(
Tdef(\bum, {var freq;
		  inf.do{
		  		Synth(\bum, [\freq, freq.next, \amp, 1]);
		  		rand(01,1).wait;
		  		}
		  	})
)