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

//perhaps melodies+fmsynthesis
~out.ar(2)
~out.fadeTime_(2)
~hassleholm= {|freq= 300, amp= 0.1, depth= 10| Pan2.ar(SinOsc.ar(SinOsc.ar(400, 0, depth, freq), 0, amp))}
~out= ~hassleholm
~out.play
Tdef(\mel1).play(c)
Tdef(\mel1, {inf.do{|i| ~hassleholm.set(\freq, i%12*100+100, \amp, 0.3+0.1.rand2, \depth, 4.rrand(50)); 1.wait}})
Tdef(\mel2).play(c)
Tdef(\mel2, {0.125.wait; inf.do{|i| ~hassleholm.set(\freq, i%12*100+200, \amp, 0.3+0.1.rand2, \depth, 4.rrand(50)); 0.99.wait}})
~berlin= {|freq= 300, amp= 0.1, depth= 10| Pan2.ar(SinOsc.ar(Saw.ar(400, depth, freq), 0, amp))}
Tdef(\mel3).play(c)
Tdef(\mel3, {0.25.wait; inf.do{|i| ~berlin.set(\freq, i%10*50+50, \amp, 0.3+0.1.rand2, \depth, 4.rrand(50)); 3.wait}})
~out= ~hassleholm+~berlin
Tdef(\mel4).play(c)
Tdef(\mel4, {0.25.wait; inf.do{|i| ~berlin.set(\freq, i%10*50+150, \amp, 0.3+0.1.rand2, \depth, 4.rrand(50)); 2.99.wait}})
Tdef(\mel4, {0.25.wait; inf.do{|i| ~hassleholm.set(\freq, i%12*200+300, \amp, 0.3+0.1.rand2, \depth, 4.rrand(50)); ~berlin.set(\freq, i%10*50+150, \amp, 0.3+0.1.rand2, \depth, 4.rrand(50)); 2.99.wait}})
~ryd= {|freq= 300, amp= 0.1, depth= 10| Pan2.ar(SinOsc.ar(Pulse.ar(400, LFNoise2.kr(0.3, 0.2, 0.5), depth, freq), 0, amp))}
Tdef(\mel5).play(c)
Tdef(\mel5, {0.5.wait; inf.do{|i| ~ryd.set(\freq, i%8*75+75, \amp, 0.3+0.1.rand2, \depth, 30.rrand(80)); 4.99.wait}})
~out= ~hassleholm+~berlin+~ryd
~sticks= {|t_trig, freq= 400, amp= 0.1| Pan2.ar(EnvGen.kr(Env.perc, t_trig)*CombN.ar((RLPF.ar(Saw.ar(freq, 0.1, amp), freq*2)+GrayNoise.ar(amp*0.01)), 0.12, 0.12, 2, 0.7), LFNoise2.kr)}
~out= ~hassleholm+~berlin+~ryd+~sticks
Tdef(\sticks).play(c)
Tdef(\sticks, {inf.do{|i| if([0, 1, 3].includes((i%5).asInteger), {~sticks.set(\t_trig, 1, \amp, 0.1.rrand(0.2))}); 0.25.wait}})

Tdef(\mel1, {inf.do{|i| ~hassleholm.set(\freq, i%14*100+100, \amp, 0.3+0.1.rand2, \depth, 40.rrand(170)); 1.wait}})
Tdef(\mel2, {0.125.wait; inf.do{|i| ~hassleholm.set(\freq, i%14*100+200, \amp, 0.3+0.1.rand2, \depth, 40.rrand(150)); 0.99.wait}})
~ryd= {|freq= 300, amp= 0.1, depth= 10| Pan2.ar(SinOsc.ar(Pulse.ar(50, LFNoise2.kr(0.3, 0.2, 0.5), depth, freq), 0, amp))}
~berlin= {|freq= 300, amp= 0.1, depth= 10| Pan2.ar(SinOsc.ar(Saw.ar(100, depth, freq), 0, amp))}
~hassleholm= {|freq= 300, amp= 0.1, depth= 10| Pan2.ar(SinOsc.ar(SinOsc.ar(150, 0, depth, freq), 0, amp))}
Tdef(\sticks, {inf.do{|i| if([2, 1, 4].includes((i%5).asInteger), {~sticks.set(\t_trig, 1, \amp, 0.1.rrand(0.2), \freq, ([1, 2, 3]*[100, 200].choose).choose)}); 0.25.wait}})
~berlin= {|freq= 300, amp= 0.1, depth= 10| Pan2.ar(SinOsc.ar(Saw.ar(25, depth, freq), 0, amp))}
~hassleholm= {|freq= 300, amp= 0.1, depth= 10| Pan2.ar(SinOsc.ar(SinOsc.ar(75, 0, depth, freq), 0, amp))}
~ryd= {|freq= 300, amp= 0.1, depth= 10| Pan2.ar(SinOsc.ar(Pulse.ar(10, LFNoise2.kr(0.3, 0.2, 0.5), depth, freq), 0, amp))}
~hassleholm= {|freq= 300, amp= 0.1, depth= 10| Pan2.ar(SinOsc.ar(SinOsc.ar(25, 0, depth, freq), 0, amp))}
~berlin= {|freq= 300, amp= 0.1, depth= 10| Pan2.ar(SinOsc.ar(Saw.ar(12.5, depth, freq), 0, amp))}
~ryd= {|freq= 300, amp= 0.1, depth= 10| Pan2.ar(SinOsc.ar(Pulse.ar(5, LFNoise2.kr(0.3, 0.2, 0.5), depth, freq), 0, amp))}
~berlin= {|freq= 300, amp= 0.1, depth= 10| Pan2.ar(SinOsc.ar(Saw.ar(7.5, depth, freq), 0, amp))}
~hassleholm= {|freq= 300, amp= 0.1, depth= 10| Pan2.ar(SinOsc.ar(SinOsc.ar(12.5, 0, depth, freq), 0, amp))}
Tdef(\mel5, {0.5.wait; inf.do{|i| ~ryd.set(\freq, i%8*75+75, \amp, 0.2.rand, \depth, 30.rrand(80)); 4.99.wait}})
Tdef(\mel1, {inf.do{|i| ~hassleholm.set(\freq, i%14*100+100, \amp, 0.2.rand, \depth, 40.rrand(170)); 1.wait}})
Tdef(\mel2, {0.125.wait; inf.do{|i| ~hassleholm.set(\freq, i%14*50+200, \amp, 0.2.rand, \depth, 40.rrand(150)); 0.99.wait}})

Tdef(\mel5, {0.5.wait; inf.do{|i| ~ryd.set(\freq, i%8*75+75, \amp, 0.1.rand, \depth, 30.rrand(80)); 6.99.wait}})
Tdef(\mel1, {inf.do{|i| ~hassleholm.set(\freq, i%14*100+100, \amp, 0.1.rand, \depth, 40.rrand(170)); 2.wait}})
Tdef(\mel2, {0.125.wait; inf.do{|i| ~hassleholm.set(\freq, i%14*50+200, \amp, 0.1.rand, \depth, 40.rrand(150)); 1.99.wait}})

Tdef(\mel5).stop
Tdef(\mel1).stop
Tdef(\mel2).stop
Tdef(\mel3).stop
Tdef(\mel4).stop
~ryd.end(10)
~hassleholm.end(10)

Tdef(\mel3, {inf.do{|i| ~berlin.set(\freq, [100, 50].foldAt(i)); 2.wait}})
Tdef(\mel3).play
Tdef(\mel4, {inf.do{|i| ~berlin.set(\freq, [400, 300, 200].foldAt(i)); 4.75.wait}})
Tdef(\mel4).play

Tdef(\sticks, {inf.do{|i| if([0, 4].includes((i%6).asInteger), {~sticks.set(\t_trig, 1, \amp, 0.1.rrand(0.2), \freq, ([1, 2, 3, 6]*[100, 100, 200].choose).wrapAt(i))}); 0.25.wait}})

Tdef(\sticks2, {inf.do{|i| if([0, 4].includes((i%6).asInteger), {~sticks.set(\t_trig, 1, \amp, 0.1.rand, \freq, ([1, 2, 3, 6]*[1000, 1000, 2000].choose).wrapAt(i))}); (2/3).wait}})
Tdef(\sticks2).play(c)

Tdef(\sticks3, {inf.do{|i| if([0, 4].includes((i%6).asInteger), {~sticks.set(\t_trig, 1, \amp, 0.1.rand, \freq, ([1, 2, 3, 6]*[60, 60, 80].choose).wrapAt(i))}); 1.5.wait}})
Tdef(\sticks3).play(c)

Tdef(\sticks2, {inf.do{|i| if([0, 4].includes((i%6).asInteger), {~sticks.set(\t_trig, 1, \amp, 0.1.rand, \freq, ([1, 3, 6]*[1200, 1000, 2000].choose).wrapAt(i))}); (2/3).wait}})

~ryd.play
~ryd.set(\freq, 450)
~ryd.set(\freq, 400)
Tdef(\ryd).play
Tdef(\ryd, {inf.do{|i| ~ryd.set(\freq, 400+(i%2*50)); 8.wait}})
Tdef(\ryd, {inf.do{|i| if(i%2==0, {~ryd.set(\freq, 400); 8.wait}, {~ryd.set(\freq, 450); 3.wait})}})

Tdef(\sticks, {inf.do{|i| if([0, 4].includes((i%6).asInteger), {~sticks.set(\t_trig, 1, \amp, 0.05.rand, \freq, ([1, 2, 3, 6]*[100, 100, 200].choose).wrapAt(i))}); 0.25.wait}})
Tdef(\sticks2, {inf.do{|i| if([0, 4].includes((i%6).asInteger), {~sticks.set(\t_trig, 1, \amp, 0.05.rand, \freq, ([1, 2, 3, 6]*[1000, 1000, 2000].choose).wrapAt(i))}); (2/3).wait}})
Tdef(\sticks3, {inf.do{|i| if([0, 4].includes((i%6).asInteger), {~sticks.set(\t_trig, 1, \amp, 0.1.rand, \freq, ([1, 2, 3, 6]*[60, 60, 80].choose).wrapAt(i))}); 1.5.wait}})
Tdef(\sticks, {inf.do{|i| if([0, 4].includes((i%6).asInteger), {~sticks.set(\t_trig, 1, \amp, 0, \freq, ([1, 2, 3, 6]*[100, 100, 200].choose).wrapAt(i))}); 0.25.wait}})
Tdef(\sticks2, {inf.do{|i| if([0, 4].includes((i%6).asInteger), {~sticks.set(\t_trig, 1, \amp, 0, \freq, ([1, 2, 3, 6]*[1000, 1000, 2000].choose).wrapAt(i))}); (2/3).wait}})
Tdef(\sticks3, {inf.do{|i| if([0, 4].includes((i%6).asInteger), {~sticks.set(\t_trig, 1, \amp, 0, \freq, ([1, 2, 3, 6]*[60, 60, 80].choose).wrapAt(i))}); 1.5.wait}})
Tdef(\sticks3).stop
Tdef(\sticks2).stop
Tdef(\sticks1).stop

~berlin.end(30)
~ryd.end(20)
Tdef(\sticks).stop
p.end