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

//--?
~pad= {|amp= 0.1| Pan2.ar(PMOsc.ar(LFSaw.ar(200.2, 100, 200), Mix(LFSaw.kr([0.22, 0.23], 102, 202)), LFNoise0.kr(0.1).max(0), amp))}
~pad.play

~pad= {|amp= 0.1| Pan2.ar(PMOsc.ar(LFSaw.ar(200.2, 100, 200), Mix(LFSaw.kr([0.22, 0.23, 0.25], [102, 103, 104], 202)), LFNoise0.kr(0.1).max(0), amp))}

~pad= {|amp= 0.1| Pan2.ar(PMOsc.ar(LFSaw.ar(202, 100, 200), Mix(LFSaw.kr([0.22, 0.3, 0.25], [102, 103, 104], 102)), LFNoise0.ar(0.1).round(0.2), amp))}

~pad= {|amp= 0.1| Pan2.ar(PMOsc.ar(LFSaw.ar(202, 0, 100, 200), Mix(LFSaw.kr([0.22, 0.3, 0.25], 0, [102, 103, 104], 102)), LFNoise0.ar(0.1).round(0.2), amp))}

~pad= {|amp= 0.1| Pan2.ar(PMOsc.ar(LFSaw.ar(202, 0, 100, 200), Mix(LFSaw.kr([0.22, 0.3, 0.25], 0, [102, 103, 104]/2, 102)), LFNoise0.ar(0.1).round(0.2), amp))}

~pad= {|amp= 0.1| Pan2.ar(PMOsc.ar(LFSaw.ar([202, 404], 0, 100, 200), Mix(LFSaw.kr([0.22, 0.3, 0.25], 0, [102, 103, 104]/2, 102))*[1, 1.01], LFNoise0.ar(0.1!2).round(0.2)), 0, amp)}
~pad.set(\amp, 0.5)

~pad= {|amp= 0.1| Pan2.ar(PMOsc.ar(LFSaw.ar([202, 404+LFNoise0.kr(~tempo.kr/4).round(0.5)], 0, 100, 200), Mix(LFSaw.kr([0.22, 0.3, 0.25], 0, [102, 103, 104]/2, 102))*[1, 1.01], LFNoise0.ar(0.1!2).round(0.2)), 0, amp)}

~pad= {|amp= 0.1| Pan2.ar(PMOsc.ar(LFSaw.ar([202, 404+LFNoise0.kr(~tempo.kr/4).round(0.5)], 0, 100, LFNoise0.kr(~tempo.kr/2, 100, 300).round(100)), Mix(LFSaw.kr([0.22, 0.3, 0.25], 0, [102, 103, 104]/2, 102))*[1, 1.01], LFNoise0.ar(0.1!2).round(0.2)), 0, amp)}

~pad= {|amp= 0.1, freq= 200| Pan2.ar(PMOsc.ar(LFSaw.ar([202, 404+LFNoise0.kr(~tempo.kr/4).round(0.5)], 0, 100, freq+LFNoise0.kr(~tempo.kr/2, 10)), Mix(LFSaw.kr([0.22, 0.3, 0.25], 0, [102, 103, 104]/2, 102))*[1, 1.01], LFNoise0.ar(0.1!2).round(0.2)), 0, amp)}

~freq= {Demand.kr(Impulse.kr(~tempo.kr), 0, Dseq([100, 200, 300, 200, 120], inf))}
~pad.map(\freq, ~freq)

~freq= {Demand.kr(Impulse.kr(~tempo.kr/2), 0, Dseq([100, 200, 300, 200, 50], inf))}

~pad= {|amp= 0.1, freq= 200| Pan2.ar(PMOsc.ar(LFSaw.ar([202, 404+LFNoise0.kr(~tempo.kr/4).round(0.5)], 0, 100, freq+LFNoise0.kr(~tempo.kr/2, 10)), Mix(LFSaw.kr([0.22, 0.3, 0.5], 0, [102, 103, 40]/2, 42))*[1, 1.01], LFNoise0.ar(0.1!2).round(0.2)), 0, amp)}

~pad= {|amp= 0.1, freq= 200| Pan2.ar(PMOsc.ar(LFSaw.ar([202, 404+LFNoise0.kr(~tempo.kr/4).round(0.5)], 0, 100, freq+LFNoise0.kr(~tempo.kr/2, 10)), Mix(LFSaw.kr([0.22, 0.3, 0.5]*10, 0, [102, 103, 40]/2, 42))*[1, 1.01], LFNoise0.ar(0.1!2).round(0.2)), 0, amp)}

~pad= {|amp= 0.1, freq= 200| Pan2.ar(PMOsc.ar(LFSaw.ar([202, 404+LFNoise0.kr(~tempo.kr/4).round(0.5)], 0, 100, freq+LFNoise0.kr(~tempo.kr/2, 10)), Mix(LFSaw.kr([0.22, 0.3, 0.5]*10, 0, [52, 53, 40]/2, 62))*[1, 1.01], LFSaw.kr(0.2!2).round(0.2)), 0, amp)}

~freq= {Demand.kr(Dust.kr(~tempo.kr/2), 0, Dseq([100, 200, 300, 200, 50], inf))}
~freq2= {Demand.kr(Dust.kr(~tempo.kr/2), 0, Dseq([100, 200, 300, 200, 50]*3, inf))}

~pad.map(\freq, ~freq2)
~pad.fadeTime_(5)
~pad.xmap(\freq, ~freq)
~pad.xmap(\freq, ~freq2)

Tdef(\freq).play(c)
Tdef(\freq, {inf.do{|i| if(i%2==0, {~pad.xmap(\freq, ~freq)}, {~pad.xmap(\freq, ~freq2)}); 20.wait}})

~pad= {|amp= 0.1, freq= 200| Pan2.ar(PMOsc.ar(SinOsc.ar([202, 404+LFNoise0.kr(~tempo.kr/4).round(0.5)], 0, 100, freq+LFNoise0.kr(~tempo.kr/2, 10)), Mix(LFSaw.kr([0.22, 0.3, 0.5]*10, 0, [52, 53, 40]/2, 62))*[1, 1.01], LFSaw.kr(0.2!2).round(0.2)), 0, amp)}

~pad= {|amp= 0.1, freq= 200| Pan2.ar(PMOsc.ar(SinOsc.ar([202, 404+LFNoise0.kr(~tempo.kr/4).round(0.5)], 0, 100, freq+LFNoise0.kr(~tempo.kr/2, 10)), Mix(LFSaw.kr([0.22, 0.3, 0.5]*10, 0, [52, 53, 40]/2, 62))*[1, 1.01], SinOsc.kr(0.2!2).round(0.2)), 0, amp)}

~pad= {|amp= 0.1, freq= 200| Pan2.ar(PMOsc.ar(SinOsc.ar([202, 404+SinOsc.kr(~tempo.kr/4).round(0.5)], 0, 100, freq+LFNoise0.kr(~tempo.kr/2, 10)), Mix(SinOsc.kr([0.22, 0.3, 0.5]*10, 0, [52, 53, 40]/2, 62))*[1, 1.01], SinOsc.kr(0.2!2).round(0.2)), 0, amp)}

~freq2= {Demand.kr(Dust.kr(~tempo.kr/2), 0, Dseq([100, 200, 300, 200, 50]*2, inf))}
~freq3= {Demand.kr(Dust.kr(~tempo.kr/2), 0, Dseq([100, 200, 300, 200, 50]*4, inf))}

Tdef(\freq, {inf.do{|i| if(i%3==0, {~pad.xmap(\freq, ~freq)}, {if(i%3==1, {~pad.xmap(\freq, ~freq2)}, {~pad.xmap(\freq, ~freq3)})}); 20.wait}})

~freq3= {Demand.kr(Dust.kr(~tempo.kr/3), 0, Dseq([100, 200, 300, 200, 50]*3, inf))}
~freq= {Demand.kr(Dust.kr(~tempo.kr), 0, Dseq([100, 200, 300, 200, 50], inf))}

~pip= {|amp= 0.1, freq= 200| Pan2.ar(SinOsc.ar(SinOsc.ar([202, 404+SinOsc.kr(~tempo.kr/4).round(0.5)], 0, 100, freq+LFNoise0.kr(~tempo.kr/2, 10)), Mix(SinOsc.kr([0.22, 0.3, 0.5]*10, 0, [52, 53, 40]/2, 62))*[1, 1.01], SinOsc.kr(0.2!2).round(0.2)), 0, amp)}
~pip.play
~pip.set(\freq, 2000)
~pip.set(\amp, 0.01)

Tdef(\pip).play(c)
Tdef(\pip, {inf.do{|i| ~pip.set(\freq, (2000*(i%5/4+0.5)).postln); 20.wait}})

~pip.lag(\freq, 1)
~amp= {Demand.kr(Impulse.kr(~tempo.kr), 0, Dseq([1, 0.5, 0.25, 0.25, 0, 0, 0].scramble*0.1, inf))}
~pip.map(\amp, ~amp)

~pip= {|amp= 0.1, freq= 200| Pan2.ar(SinOsc.ar(SinOsc.ar([202, 404+SinOsc.kr(~tempo.kr/4).round(0.5)], 0, 100, freq+LFNoise0.kr(~tempo.kr/2, 10)), Mix(SinOsc.kr([0.22, 0.3, 0.5]*10, 0, [100, 120, 130], 162))*[1, 1.01], SinOsc.kr([0.12, 0.13]).round(0.2)), 0, amp)}

~bass= {|amp= 0.1, freq= 50| Pan2.ar(LPF.ar(Saw.ar(SinOsc.ar([202, 404+SinOsc.kr(~tempo.kr/4).round(0.5)], 0, 100, freq+LFNoise0.kr(~tempo.kr/2, 10)), Mix(SinOsc.kr([0.22, 0.3, 0.5]*10, 0, [100, 120, 130], 162))*[1, 1.01])), 0, amp)}
~bass.play
~bass.stop
~bass= {|amp= 0.1, freq= 50| Pan2.ar(LPF.ar(Saw.ar(SinOsc.ar([202, 404+SinOsc.kr(~tempo.kr/4).round(0.5)], 0, 100, freq+LFNoise0.kr(~tempo.kr/2, 10)), Mix(SinOsc.kr([0.22, 0.3, 0.5]*10, 0, 0.5))*[1, 1.01])), 0, amp)}
~bass.play
~bass.set(\freq, 60)
~bass= {|amp= 0.1, freq= 50| Pan2.ar(LPF.ar(Saw.ar(SinOsc.ar([202, 404+SinOsc.kr(~tempo.kr/4).round(0.5)], 0, 100, freq+LFNoise0.ar(~tempo.kr/2, 10)), Mix(SinOsc.ar([0.22, 0.3, 0.5]*10, 0, 0.25)))), 0, amp)}
~pad.pause
~bass.set(\freq, 50)
~bass.set(\freq, 60)
~bass.set(\freq, 100)

~bass= {|amp= 0.1, freq= 50| Pan2.ar(LPF.ar(Saw.ar(SinOsc.ar([102, 204+SinOsc.kr(~tempo.kr/4).round(0.5)], 0, 100, freq), Mix(SinOsc.ar([0.22, 0.3, 0.5]*10, 0, 1)))), 0, amp)}
~bass.set(\freq, 150)
~bass.set(\freq, 100)

Tdef(\bass).play(c)
Tdef(\bass, {inf.do{|i| ~bass.set(\freq, i%2*50+100); 8.wait}})

~bd.ar(2)
~bd.fadeTime_(8)
~bd.play
~bd= {|t_trig= 0, amp= 0.1| var e= EnvGen.ar(Env.perc(0.001, 0.1), t_trig); Pan2.ar(Mix(SinOsc.ar([50, 55], 0, amp*e)))}
Tdef(\bd).play(c)
Tdef(\bd, {inf.do{|i| if(i%2==0, {~bd.set(\t_trig, 1)}); 1.wait}})
~bd.set(\amp, 0.3)
Tdef(\bd, {inf.do{|i| if(i%2==0||(i%3==(i%4)), {~bd.set(\t_trig, 1)}); 1.wait}})

~hh.ar(2)
~hh.fadeTime_(8)
~hh.play
~hh= {|t_trig= 0, amp= 0.1| var e= EnvGen.ar(Env.perc(0.001, 0.1), t_trig); BPF.ar(WhiteNoise.ar(amp*e), [500, 550])}
Tdef(\hh).play(c)
Tdef(\hh, {0.5.wait; inf.do{|i| if(i%2==0, {~hh.set(\t_trig, 1)}); 0.5.wait}})
~hh.set(\amp, 0.3)
Tdef(\hh, {0.5.wait; inf.do{|i| if(i%2==0||(i%3==(i%5)), {~hh.set(\t_trig, 1)}); 0.5.wait}})

~hh= {|t_trig= 0, amp= 0.1| var e= EnvGen.ar(Env.perc(0.001, 0.1), t_trig); BPF.ar(WhiteNoise.ar(amp*e), [500, 550]*(1-e+0.5), 0.2)}
~hh.set(\amp, 0.8)
~hh.set(\amp, 1)

Tdef(\pip, {inf.do{|i| ~pip.set(\freq, (2000*(i%3/3+0.5))); 1.wait}})
Tdef(\bass, {inf.do{|i| ~bass.set(\freq, i%5%2*50+100); 2.wait}})
Tdef(\bass, {inf.do{|i| if(i%8!=0, {~bass.set(\freq, i%5%2*50+100)}, {~bass.set(\freq, 82)}); 2.wait}})

Tdef(\hh, {0.5.wait; inf.do{|i| if(i%4==0||(i%3==(i%4)), {~hh.set(\t_trig, 1)}); 0.5.wait}})
Tdef(\hh, {0.5.wait; inf.do{|i| if(i%2==0||(i%3==(i%5)), {~hh.set(\t_trig, 1)}); 0.5.wait}})

~pad.resume
~pad.set(\amp, 0.05)
~pad.map(\amp, ~bd)
~bdkr= {~bd.kr*2}
~pad.map(\amp, ~bdkr)
~hhkr= {~hh.kr*2}
~pad.map(\amp, ~hhkr)
~pad.map(\amp, ~bdkr)
~pad[1]= \filter -> {|in| CombL.ar(in, 1, ~tempo.kr.reciprocal, 2, 0.9, in)}
~pad[1]= \filter -> {|in| CombL.ar(in, 1, ~tempo.kr.reciprocal/3, 2, 0.9, in)}
~pad[1]= \filter -> {|in| CombL.ar(in, 1, ~tempo.kr.reciprocal/1.5, 2, 0.9, in)}
~pad[1]= \filter -> {|in| CombL.ar(in, 1, ~tempo.kr.reciprocal/1.5, 5, 0.5, in)}
~pad.map(\amp, ~hhkr)
~pad[1]= \filter -> {|in| CombL.ar(in, 1, ~tempo.kr.reciprocal/1.5, 3, 0.8, in)}
~pad[1]= \filter -> {|in| CombL.ar(in, 1, ~tempo.kr.reciprocal/3, 3, 0.9, in)}
~bass.release(20)
~pip.stop
Tdef(\pip).stop
Tdef(\bass).stop
~bass.set(\freq, 50)
~bass.rebuild
~bass.set(\amp, 0.05)
~bass.set(\freq, 40)
~bass.set(\freq, 50)
~bass.set(\freq, 40)
~bass.set(\freq, 50)
~bass.set(\freq, 55)
~bass.set(\freq, 50)
~bass.set(\freq, 40)
~bass.set(\freq, 50)
~bass.set(\amp, 0.04)
~bass.set(\freq, 40)

Tdef(\bass, {inf.do{|i| ~bass.set(\freq, i%2*10+40); 4.wait}})
Tdef(\bass).play(c)

Tdef(\hh, {0.5.wait; inf.do{|i| if(i%4==0||(i%3==(i%4)), {~hh.set(\t_trig, 1)}); 0.5.wait}})
Tdef(\hh, {0.5.wait; inf.do{|i| if(i%2==0||(i%3==(i%5)), {~hh.set(\t_trig, 1)}); (1/3).wait}})
Tdef(\hh, {0.5.wait; inf.do{|i| if(i%2==0||(i%3==(i%5)), {~hh.set(\t_trig, 1)}); 0.25.wait}})
Tdef(\hh, {0.5.wait; inf.do{|i| if(i%4==0||(i%3==(i%8)), {~hh.set(\t_trig, 1)}); 0.25.wait}})
Tdef(\hh, {0.5.wait; inf.do{|i| if(i%2==0||(i%3==(i%5)), {~hh.set(\t_trig, 1)}); 0.5.wait}})

Tdef(\bass, {inf.do{|i| ~bass.set(\freq, i%2*10+40+(50*2.rand)); 4.wait}})
Tdef(\bass, {inf.do{|i| ~bass.set(\freq, i%2*10+40+(50*(i%5%2))); 4.wait}})

Tdef(\bd, {inf.do{|i| if(i%2==0||(i%3==(i%2)), {~bd.set(\t_trig, 1)}); 0.5.wait}})
~pip.set(\amp, 0.01)
~pip.play
~pip.set(\amp, 0.02)
~pip.set(\freq, 1000)
~pip.set(\freq, 2000)
~pip.set(\freq, 1000)
~pip.set(\freq, 500)

~bd.release(10)
~bass.release(10)
~hh.release(10)
~pad.release(10)
~pip.release(10)

Tdef.all.do{|x| x.stop}
p.clear
p.pop