p= ProxySpace.push(s.boot)
p.makeTempoClock(2)
c= p.clock

//--?

~out.play

(~comb= {|t_trig= 0, freq= 300|
	var e, x;
	e= EnvGen.ar(Env.perc, t_trig);
	x= Dust.ar(1000)*e;
	BPF.ar(CombN.ar(x, 0.2, (1/freq).clip(0, 0.1), 1, 1, x));
})

~out= ~comb
~comb.set(\t_trig, 1)
~comb.set(\t_trig, 1, \freq, 200)

(~comb= {|t_trig= 0, freq= 300, dur= 0.5|
	var e, x;
	e= EnvGen.ar(Env.perc(0.001, dur), t_trig);
	x= Dust.ar(10000*e)*e;
	BPF.ar(CombN.ar(x, 0.2, (1/freq).clip(0, 0.1), 1, 1, x));
})
~comb.set(\t_trig, 1)

(~comb= {|t_trig= 0, freq= 300, dur= 0.5|
	var e, x;
	e= EnvGen.ar(Env.perc(0.001, dur), t_trig);
	x= Dust.ar(10000*e)*e;
	BPF.ar(CombN.ar(x, 0.2, (1/freq).clip(0, 0.1), 2, 1, x), freq, 0.01);
})
~comb.set(\t_trig, 1)
~comb.set(\t_trig, 1)

Tdef(\comb).play(c)
(Tdef(\comb, {
	inf.do{|i|
		~comb.set(\freq, i%4*40+400, \t_trig, 1);
		(i%5*0.25+0.25).wait;
	}
}))

(Tdef(\comb, {
	inf.do{|i|
		~comb.set(\freq, i%4*40+80, \t_trig, 1);
		(i%5*0.25+0.25).wait;
	}
}))

(~comb2= {|t_trig= 0, freq= 300, dur= 0.5|
	var e, x;
	e= EnvGen.ar(Env.perc(0.001, dur), t_trig);
	x= Dust.ar(10000*e)*e;
	BPF.ar(CombN.ar(x, 0.2, (1/freq).clip(0, 0.1), 2, 1, x), freq, 0.01);
})

Tdef(\comb2).play(c)
(Tdef(\comb2, {
	inf.do{|i|
		~comb2.set(\freq, i%4*40+400, \t_trig, 1);
		(i%5*0.25+0.25).wait;
	}
}))

~out.fadeTime_(10)
~out= ~comb+~comb2

(~comb2= {|t_trig= 0, freq= 300, dur= 0.5, amp= 0.5|
	var e, x;
	e= EnvGen.ar(Env.perc(0.001, dur), t_trig);
	x= Dust.ar(10000*e)*e;
	BPF.ar(CombN.ar(x, 0.2, (1/freq).clip(0, 0.1), 2, amp, x), freq, 0.01);
})

(Tdef(\comb2, {
	inf.do{|i|
		~comb2.set(\amp, i%4/3, \freq, i%4*80+400, \t_trig, 1);
		(i%5*0.25+0.25).wait;
	}
}))

(~comb3= {|t_trig= 0, freq= 300, dur= 0.5, amp= 0.5|
	var e, x;
	e= EnvGen.ar(Env.perc(0.001, dur), t_trig);
	x= Dust.ar(10000*e)*e;
	BPF.ar(CombN.ar(x, 0.2, (1/freq).clip(0, 0.1), 2, amp, x), freq, 0.01);
})

Tdef(\comb3).play(c)
(Tdef(\comb3, {
	inf.do{|i|
		~comb3.set(\amp, i%6/10, \freq, i%4*160+800, \t_trig, 1);
		(i%5*0.25+0.25).wait;
	}
}))
~out= ~comb+~comb2+~comb3

~pitch= {Pan2.ar(SinOsc.ar(Pitch.kr(~out.ar[0])[0], 0, LFNoise2.kr(~tempo.kr/8, 0.1, 0.1)), 0)}
~pitch.play
~pitch.stop
~pitch.play

~pitch[1]= \filter -> {|in| CombC.ar(in, 0.5, LFNoise2.kr(~tempo.kr/8, 0.1, 0.3), 2, 1, in)}
~pitch[1]= \filter -> {|in| CombC.ar(in, 0.5, LFNoise2.kr(~tempo.kr/8, 0.1, 0.3), LFNoise2.kr(~tempo.kr/8, 2, 2), 0.8, in)}

~out= ~comb+~comb2
~out= ~comb
~out= ~comb2+~comb3
~out= ~comb+~comb2+~comb3
~comb[1]= \filter -> {|in| in*SinOsc.ar(400)}
~comb[1]= \filter -> {|in| in*SinOsc.ar(800)}
~comb[1]= \filter -> {|in| in*SinOsc.ar(1600)}
~comb[1]= \filter -> {|in| in*SinOsc.ar(200)}
~comb[1]= \filter -> {|in| in*SinOsc.ar(120)}

(Tdef(\comb, {
	inf.do{|i|
		~comb.set(\freq, i%(i.div(4)%6)*40+80, \t_trig, 1);
		(i%5*0.25+0.25).wait;
	}
}))

(Tdef(\comb3, {
	inf.do{|i|
		~comb3.set(\amp, i%(i.div(2)%4)/10, \freq, i%4*160+800, \t_trig, 1);
		(i%5*0.25+0.25).wait;
	}
}))

(Tdef(\comb2, {
	inf.do{|i|
		~comb2.set(\amp, i%(i.div(3)%4)/3, \freq, i%4*80+400, \t_trig, 1);
		(i%5*0.25+0.25).wait;
	}
}))

(~comb3= {|t_trig= 0, freq= 300, dur= 0.5, amp= 0.5|
	var e, x;
	e= EnvGen.ar(Env.perc(0.001, dur), t_trig);
	x= Dust.ar(10000*e)*e;
	BPF.ar(CombN.ar(x, 0.2, (1/freq).clip(0, 0.1), 2, amp, x), freq, LFSaw.kr(~tempo.kr/4, 0, 0.1, 0.105));
})

(~comb2= {|t_trig= 0, freq= 300, dur= 0.5, amp= 0.5|
	var e, x;
	e= EnvGen.ar(Env.perc(0.001, dur), t_trig);
	x= Dust.ar(10000*e)*e;
	BPF.ar(CombN.ar(x, 0.2, (1/freq).clip(0, 0.1), 2, amp, x), freq, LFSaw.kr(~tempo.kr/4, 0, 0.1, 0.105));
})

(~comb= {|t_trig= 0, freq= 300, dur= 0.5, amp= 0.5|
	var e, x;
	e= EnvGen.ar(Env.perc(0.001, dur), t_trig);
	x= Dust.ar(10000*e)*e;
	BPF.ar(CombN.ar(x, 0.2, (1/freq).clip(0, 0.1), 2, amp, x), freq, LFSaw.kr(~tempo.kr/4, 0, 0.1, 0.105));
})

~pitch[1]= \filter -> {|in| CombC.ar(in, 0.5, LFSaw.ar(~tempo.kr/16, 0, 0.1, 0.101), LFSaw.ar(~tempo.kr/40, 0, 2, 2), 0.5, in)}

(Tdef(\comb3, {
	inf.do{|i|
		~comb3.set(\amp, i%(i.div(2)%4)/5, \freq, i%4*160+800, \t_trig, 1);
		(i%10*0.125+0.25).wait;
	}
}))

~pitch[1]= \filter -> {|in| CombC.ar(in, 0.5, LFTri.ar(~tempo.kr/16, 0, 0.1, 0.101), LFSaw.ar(~tempo.kr/40, 0, 2, 2), 0.2, in)}

(Tdef(\comb3, {
	inf.do{|i|
		~comb3.set(\amp, i%(i.div(2)%4)/5, \freq, i%4*160+800, \t_trig, 1);
		(i%(i%2)*0.125+0.25).wait;
	}
}))

(Tdef(\comb2, {
	inf.do{|i|
		~comb2.set(\amp, i%(i.div(3)%4), \freq, i%4*80+400, \t_trig, 1);
		(i%8*0.25+0.125).wait;
	}
}))

~tick= {Pan2.ar(Impulse.ar(~tempo.kr), SinOsc.ar(~tempo.kr/4, 0, 0.5, LFNoise2.kr(1, 0.4, 0.4)))}
~tick.play
~tick= {Pan2.ar(Impulse.ar(~tempo.kr/LFNoise0.kr(~tempo.kr/4, 1, 2).round(1)), SinOsc.ar(~tempo.kr/4, 0, 0.5, LFNoise2.kr(1, 0.4, 0.4)))}
~tick.quant_(1)

(Tdef(\comb, {
	inf.do{|i|
		~comb.set(\amp, 2, \dur, 0.2.rrand(0.4), \freq, i%(i.div(2)%8)*40+80, \t_trig, 1);
		(i%6*(1/3)+0.25).wait;
	}
}))

(~tick= {
	var z;
	z= Pan2.ar(Impulse.ar(~tempo.kr/LFNoise0.kr(~tempo.kr/4, 1, 2).round(1)), SinOsc.ar(~tempo.kr/4, 0, 0.5, LFNoise2.kr(1, 0.4, 0.4)));
	CombC.ar(z, 0.05, 0.05, 0.3, 0.3, z)
})

(~tick= {|t_trig= 0|
	var z;
	z= Pan2.ar(Trig1.ar(t_trig), SinOsc.ar(~tempo.kr/4, 0, 0.5, LFNoise2.kr(1, 0.4, 0.4)));
	CombC.ar(z, 0.01, 0.01, 0.8, 0.3, z)
})
~tick.set(\t_trig, 1)

(~tick= {|t_trig= 0|
	var z;
	z= Pan2.ar(Trig1.ar(t_trig)*0.2, SinOsc.ar(~tempo.kr/4, 0, 0.5, LFNoise2.kr(1, 0.4, 0.4)));
	CombC.ar(z, 0.01, 0.01, 0.8, 0.3, z)
})
~tick.set(\t_trig, 1)

Tdef(\trig).play(c)
(Tdef(\trig, {
	inf.do{|i|
		~tick.set(\t_trig, 1);
		0.125.wait
	}
}))
(Tdef(\trig, {
	var dur;
	dur= Pseq([Pn(0.125, 15), Prand([1, Pn(0.5, 2), Pn(1/3, 3), Pn(0.125, 4)], 1)], inf).asStream;
	inf.do{|i|
		~tick.set(\t_trig, 1);
		dur.next.wait
	}
}))
(Tdef(\trig, {
	var dur;
	dur= Pseq([Pn(0.125, 15), Prand([1, Pn(0.5, 2), Pn(1/3, 3), Pn(0.125, 4), Pn(0.2, 5)], 1)], inf).asStream;
	inf.do{|i|
		~tick.set(\t_trig, 1);
		dur.next.wait
	}
}))

(~tick= {|t_trig= 0, freq= 100|
	var z;
	z= Pan2.ar(Trig1.ar(t_trig)*0.2, SinOsc.ar(~tempo.kr/4, 0, 0.5, LFNoise2.kr(1, 0.4, 0.4)));
	CombC.ar(z, 0.1, 1/freq, 0.8, 0.3, z)
})

(Tdef(\trig, {
	var dur;
	dur= Pseq([Pn(0.125, 15), Prand([1, Pn(0.5, 2), Pn(1/3, 3), Pn(0.125, 4), Pn(0.2, 5)], 1)], inf).asStream;
	inf.do{|i|
		~tick.set(\freq, i.div(16)%10*10+50, \t_trig, 1);
		dur.next.wait
	}
}))

(Tdef(\comb2, {
	inf.do{|i|
		~comb2.set(\amp, i%(i.div(3)%4), \freq, i%4*80+600, \t_trig, 1);
		(i%8*0.25+0.125).wait;
	}
}))

(Tdef(\comb3, {
	inf.do{|i|
		~comb3.set(\amp, i%(i.div(5)%4)/5, \freq, i%4*160+80, \t_trig, 1);
		(i%(i%4)*0.125+0.25).wait;
	}
}))

(Tdef(\comb2, {
	inf.do{|i|
		~comb2.set(\amp, i%(i.div(7)%4), \freq, i%4*40+400, \t_trig, 1);
		(i%8*0.25+0.125).wait;
	}
}))

(Tdef(\comb, {
	inf.do{|i|
		~comb.set(\amp, 2, \dur, 0.2, \freq, i%(i.div(2)%8)*40+120, \t_trig, 1);
		(0.25).wait;
	}
}))

(Tdef(\comb, {
	inf.do{|i|
		~comb.set(\amp, 2, \dur, 0.2, \freq, i%(i.div(2)%(i.div(4)*2))*40+120, \t_trig, 1);
		(0.25).wait;
	}
}))

(Tdef(\comb2, {
	inf.do{|i|
		~comb2.set(\amp, i%(i.div(7)%4), \freq, i%4*40+200, \t_trig, 1);
		(i%8*0.25+0.125).wait;
	}
}))

(Tdef(\trig, {
	var dur;
	dur= Pseq([Pn(0.125, 15), Prand([1, Pn(0.5, 2), Pn(1/3, 3), Pn(0.125, 4), Pn(0.2, 5)], 1)], inf).asStream;
	inf.do{|i|
		~tick.set(\freq, i.div(8)%10*10+25, \t_trig, 1);
		dur.next.wait
	}
}))

~comb3.release(20)

(~tick= {|t_trig= 0|
	var z;
	z= Pan2.ar(Trig1.ar(t_trig, 0.01)*0.2, SinOsc.ar(~tempo.kr/4, 0, 0.5, LFNoise2.kr(1, 0.4, 0.4)));
	CombC.ar(z, 0.01, 0.01, 1, 0.3, z)
})

(~tick= {|t_trig= 0|
	var z;
	z= Pan2.ar(Trig1.ar(t_trig, 0.001)*0.2, SinOsc.ar(~tempo.kr/4, 0, 0.5, LFNoise2.kr(1, 0.4, 0.4)));
	CombC.ar(z, 0.01, 0.01, 1.2, 0.3, z)
})

(~tick= {|t_trig= 0|
	var z;
	z= Pan2.ar(Trig1.ar(t_trig, 0.01)*0.2, SinOsc.ar(~tempo.kr/4, 0, 0.5, LFNoise2.kr(1, 0.4, 0.4)));
	CombC.ar(z, 0.01, 0.01, 1.2, 0.5, z)
})

(~tick= {|t_trig= 0|
	var z;
	z= Pan2.ar(Trig1.ar(t_trig, 0.02)*0.2, SinOsc.ar(~tempo.kr/4, 0, 0.5, LFNoise2.kr(1, 0.4, 0.4)));
	CombC.ar(z, 0.01, 0.01, 2, 0.5, z)
})

~comb3.release(20)

~comb.release(20)

(~tick= {|t_trig= 0|
	var z;
	z= Pan2.ar(Trig1.ar(t_trig, 0.025)*0.2, SinOsc.ar(~tempo.kr/4, 0, 0.5, LFNoise2.kr(1, 0.4, 0.4)));
	CombC.ar(z, 0.01, 0.01, 2, 0.5, z)
})

(~tick= {|t_trig= 0|
	var z;
	z= Pan2.ar(Trig1.ar(t_trig, 0.02)*0.2, SinOsc.ar(~tempo.kr/4, 0, 0.5, LFNoise2.kr(1, 0.4, 0.4)));
	CombC.ar(z, 0.01, 0.01, 2, 0.5, z)
})

(~tick= {|t_trig= 0|
	var z;
	z= Pan2.ar(Trig1.ar(t_trig, 0.04)*0.2, SinOsc.ar(~tempo.kr/4, 0, 0.5, LFNoise2.kr(1, 0.4, 0.4)));
	CombC.ar(z, 0.01, 0.01, 2, 0.5, z)
})

~pitch.release(20)
Tdef(\pitch).stop
Tdef(\comb).stop
Tdef(\comb2).stop
Tdef(\comb3).stop
Tdef(\tick).stop
~tick.release(20)
Tdef(\trig).stop
p.clear
p.pop