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

//will try to code something calm and soft today
~out.ar(2)
~pip= {|freq= 900, pan= 0, amp= 0.1, t_trig= 0| Pan2.ar(Mix(SinOsc.ar(freq*[1, 2.01, 3.02], 0, amp*[1, 0.6, 0.3]))*EnvGen.kr(Env.perc, t_trig), pan)}
~out= ~pip
~out.play
Tdef(\pip).play(c, quant:4)
(Tdef(\pip, {
	inf.do{|i| if(i%3==0, {~pip.set(\t_trig, 1)}); 1.wait}
}))

~pip= {|freq= 900, pan= 0, amp= 0.1, t_trig= 0| Pan2.ar(Mix(SinOsc.ar(freq*[1, 2.01, 3.02], 0, amp*[1, 0.6, 0.3])*SinOsc.ar(200))*EnvGen.kr(Env.perc(0.1, 3), t_trig), pan)}

(Tdef(\pip, {
	inf.do{|i| if(i%3==0 or:{i.div(2)%3==0}, {~pip.set(\t_trig, 1)}); 1.wait}
}))

~pip= {|freq= 900, pan= 0, amp= 0.1, t_trig= 0| Pan2.ar(BPF.ar(Mix(Saw.ar(freq*[1, 2.01, 3.02], amp*[1, 0.6, 0.3])*SinOsc.ar(200)))*EnvGen.kr(Env.perc(0.1, 3), t_trig), pan)}

~pip= {|freq= 900, pan= 0, amp= 0.1, t_trig= 0| Pan2.ar(BPF.ar(Mix(Saw.ar(freq*[1, 2.01, 3.02], amp*[1, 0.6, 0.3])*SinOsc.ar(LFSaw.kr(0.2, 0, 100, 400).round(100))))*EnvGen.kr(Env.perc(0.01, 3), t_trig), pan)}
~pip.quant_(2)
~pip= {|freq= 900, pan= 0, amp= 0.1, t_trig= 0| Pan2.ar(BPF.ar(Mix(Saw.ar(freq*[1, 2.01, 3.02], amp*[1, 0.6, 0.3])*SinOsc.ar(LFSaw.kr(0.2, 0, SinOsc.kr(0.1, 0, 20, 100), 400).round(100))))*EnvGen.kr(Env.perc(0.01, 3), t_trig), pan)}

~pipefx= {DelayN.ar(~pip.ar, 0.2, 0.2, 0.5)}
~pipefx.play
~pipefx.quant_(2)
~pipefx= {DelayN.ar(~pip.ar, 0.2, 0.2, 0.6)}

(Tdef(\pip, {
	inf.do{|i|
		if(i%3==0 or:{i.div(2)%3==0}, {
			~pip.set(\t_trig, 1);
			~pip.set(\pan, 0.3.rand2);
			~pip.set(\freq, 900+(100.linrand).round(33.33));
		}); 1.wait}
}))

~pipefx2.quant_(2)
~pipefx2= {DelayN.ar(~pipefx.ar, 0.1, 0.1, 0.6)}
~pipefx2.play

~pip2.ar(2)
~pip2.quant_(2)
~pip2= {|freq= 333.33, pan= 0, amp= 0.1, t_trig= 0| Pan2.ar(BPF.ar(Mix(Saw.ar(freq*[1, 2.01, 3.02], amp*[1, 0.6, 0.3])*SinOsc.ar(LFSaw.kr(0.2, 0, SinOsc.kr(0.1, 0, 20, 100), 400).round(100))))*EnvGen.kr(Env.perc(0.01, 3), t_trig), pan)}

(Tdef(\pip2, {
	inf.do{|i|
		if(i%3==0 or:{i.div(2)%3==0}, {
			~pip2.set(\t_trig, 1);
			~pip2.set(\pan, 0.3.rand2);
			~pip2.set(\freq, 333.33+(100.linrand).round(33.33));
		}); 1.wait}
}))
Tdef(\pip2).play(c, quant:4)
~pip2.play
(Tdef(\pip2, {
	inf.do{|i|
		if(i%3==0 or:{i.div(2)%3==0}, {
			~pip2.set(\t_trig, 1);
			~pip2.set(\pan, 0.3.rand2);
			~pip2.set(\freq, 200+(100.linrand).round(33.33));
		}); 1.wait}
}))

~pip3.ar(2)
~pip3.quant_(2)
~pip3= {|freq= 50, pan= 0, amp= 0.1, t_trig= 0| Pan2.ar(BPF.ar(Mix(Saw.ar(freq*[1, 2.01, 3.02], amp*[1, 0.6, 0.3])*SinOsc.ar(LFSaw.kr(0.2, 0, SinOsc.kr(0.1, 0, 20, 50), 100).round(100))))*EnvGen.kr(Env.perc(0.01, 3), t_trig), pan)}

(Tdef(\pip3, {
	inf.do{|i|
		if(i%3==0 or:{i.div(2)%3==0}, {
			~pip3.set(\t_trig, 1);
			~pip3.set(\pan, 0.3.rand2);
			~pip3.set(\freq, 50+(100.linrand).round(33.33));
		}); 1.wait}
}))
Tdef(\pip3).play(c, quant:4)
~pip3.play

~pip3= {|freq= 50, pan= 0, amp= 0.1, t_trig= 0| Pan2.ar(BPF.ar(Mix(Saw.ar(freq*[1, 2.01, 3.02], amp*[1, 0.6, 0.3])*SinOsc.ar(LFSaw.kr(0.2, 0, SinOsc.kr(0.1, 0, 10, 50), 100).round(100))))*EnvGen.kr(Env.perc(0.01, 3), t_trig), pan)}

~pip2= {|freq= 333.33, pan= 0, amp= 0.1, t_trig= 0| Pan2.ar(BPF.ar(Mix(Saw.ar(freq*[1, 2.01, 3.02], amp*[1, 0.6, 0.3])*SinOsc.ar(LFSaw.kr(0.2, 0, SinOsc.kr(0.1, 0, 20, 50), 200).round(100))))*EnvGen.kr(Env.perc(0.01, 3), t_trig), pan)}

~pip= {|freq= 900, pan= 0, amp= 0.1, t_trig= 0| Pan2.ar(BPF.ar(Mix(Saw.ar(freq*[1, 2.01, 3.02], amp*[1, 0.6, 0.3])*SinOsc.ar(LFSaw.kr(0.2, 0, SinOsc.kr(0.15, 0, 30, 200), 400).round(100))))*EnvGen.kr(Env.perc(0.01, 3), t_trig), pan)}

~pip4.ar(2)
~pip4.quant_(2)
~pip4= {|freq= 5000, pan= 0, amp= 0.05, t_trig= 0| Pan2.ar(BPF.ar(Mix(Saw.ar(freq*[1, 2.01, 3.02], amp*[1, 0.6, 0.3])*SinOsc.ar(LFSaw.kr(0.1, 0, SinOsc.kr(0.1, 0, 20, 50), 100).round(100))))*EnvGen.kr(Env.perc(0.01, 3), t_trig), pan)}
~pip4.play
~pip4.set(\t_trig, 1)
~pip4.set(\t_trig, 1)
~pip4.set(\t_trig, 1)

(Tdef(\pip4, {
	inf.do{|i|
		if(i%3==1 or:{i.div(2)%3==1}, {
			~pip4.set(\t_trig, 1);
			~pip4.set(\pan, 0.3.rand2);
			~pip4.set(\freq, [5000, 5000, 5300, 5100].wrapAt(i));
		}); 1.wait}
}))
Tdef(\pip4).play(c, quant:4)

(Tdef(\pip2, {
	inf.do{|i|
		if(i%3==0 or:{i.div(2)%3==0}, {
			~pip2.set(\t_trig, 1);
			~pip2.set(\pan, 0.7.rand2);
			~pip2.set(\freq, 200+(100.linrand).round(33.33));
		}); (2/3).wait}
}))

(Tdef(\pip3, {
	inf.do{|i|
		if(i%3==0 or:{i.div(2)%3==0}, {
			~pip3.set(\t_trig, 1);
			~pip3.set(\pan, 0.3.rand2);
			~pip3.set(\freq, 50+(100.linrand).round(33.33));
		}); [0.5, 0.5, 1, 1, 1].wrapAt(i).wait}
}))

~pipefx2= {DelayN.ar(~pipefx.ar, 0.1, 0.1, 0.8)}

~pip4= {|freq= 5000, pan= 0, amp= 0.05, t_trig= 0| Pan2.ar(BPF.ar(Mix(Saw.ar(freq*[1, 2.01, 3.02]*Lag.kr((LFSaw.kr(0.2)>0.8*0.5+0.5), 0.5), amp*[1, 0.6, 0.3])*SinOsc.ar(LFSaw.kr(0.1, 0, SinOsc.kr(0.1, 0, 30, 50), 100).round(100))))*EnvGen.kr(Env.perc(0.01, 3), t_trig), pan)}

(Tdef(\pip2, {
	inf.do{|i|
		if(i%3==0 or:{i.div(2)%3==0}, {
			~pip2.set(\t_trig, 1);
			~pip2.set(\pan, 0.7.rand2);
			~pip2.set(\freq, 200+(200.linrand).round(33.33));
		}); ([2/3, 1/3].wchoose([0.9, 0.1])).wait}
}))

~pip2= {|freq= 333.33, pan= 0, amp= 0.1, t_trig= 0, lag= 0| Pan2.ar(BPF.ar(Mix(Saw.ar(Lag.kr(freq, lag)*[1, 2.01, 3.02], amp*[1, 0.6, 0.3])*SinOsc.ar(LFSaw.kr(0.2, 0, SinOsc.kr(0.1, 0, 20, 50), 200).round(100))))*EnvGen.kr(Env.perc(0.01, 3), t_trig), pan)}

(Tdef(\pip2, {
	inf.do{|i|
		if(i%3==0 or:{i.div(2)%3==0}, {
			~pip2.set(\t_trig, 1);
			~pip2.set(\pan, 0.7.rand2);
			~pip2.set(\freq, 200+(200.linrand).round(33.33));
			~pip2.set(\lag, (i%4)/4);
		}); ([2/3, 1/3].wchoose([0.9, 0.1])).wait}
}))

~pipefx= {DelayN.ar(~pip.ar+~pip3.ar, 0.2, 0.2, 0.5)}

Tdef(\pip3).stop
Tdef(\pip3).play

~pip4= {|freq= 5000, pan= 0, amp= 0.05, t_trig= 0| Pan2.ar(BPF.ar(Mix(Saw.ar(freq*[0.25, 1, 2.01, 3.02]*Lag.kr((LFSaw.kr(0.2)>0.8*0.5+0.5), 0.5), amp*[1, 1, 0.6, 0.3])*SinOsc.ar(LFSaw.kr(0.1, 0, SinOsc.kr(0.1, 0, 30, 50), 100).round(100))))*EnvGen.kr(Env.perc(0.01, 3), t_trig), pan)}

~pip4= {|freq= 5000, pan= 0, amp= 0.05, t_trig= 0| Pan2.ar(BPF.ar(Mix(Saw.ar(freq*[0.25, 1, 2.01, 3.02]*Lag.kr((LFSaw.kr(0.2)>0.3*0.5+0.5), 0.5), amp*[1, 1, 0.6, 0.3])*SinOsc.ar(LFSaw.kr(0.1, 0, SinOsc.kr(0.1, 0, 30, 50), 100).round(100))))*EnvGen.kr(Env.perc(0.01, 3), t_trig), pan)}

(Tdef(\pip2, {
	inf.do{|i|
		if(i%3==0 or:{i.div(2)%3==1}, {
			~pip2.set(\t_trig, 1);
			~pip2.set(\pan, 0.7.rand2);
			~pip2.set(\freq, 200+(200.linrand).round(33.33));
			~pip2.set(\lag, (i%4)/8);
		}); ([2/3, 1/3].wchoose([0.8, 0.2])).wait}
}))

~bass= {Pan2.ar(SinOsc.ar(50, ~pip3.ar, 0.1), SinOsc.kr(0.1, 0, 0.2))}
~bass.quant_(4)
~bass.play
~bass.stop
~bass.play
~bass.stop
~bass= {|amp= 0.1, freq= 50| Pan2.ar(SinOsc.ar(freq, ~pip3.ar, amp), SinOsc.kr(0.1, 0, 0.2))}

(Tdef(\bass, {
	inf.do{|i|
		if(i%8==0, {
			~bass.set(\amp, 0.06);
		});
		if(i%8==3, {
			~bass.set(\amp, 0);
		});
		1.wait
	}
}))
Tdef(\bass).play(c, quant:4)

~bass.play

(50.cpsmidi+5).midicps
(Tdef(\bass, {
	inf.do{|i|
		if(i%8==0, {
			~bass.set(\amp, 0.06);
		});
		if(i%8==3, {
			~bass.set(\amp, 0);
		});
		if(i%5==0, {
			~bass.set(\freq, [50, 50, 67].foldAt(i));
		});
		1.wait
	}
}))

~bass= {|amp= 0.1, freq= 50| Pan2.ar(SinOsc.ar(Lag.kr(freq, 0.5), ~pip3.ar, amp), SinOsc.kr(0.1, 0, 0.2))}

(Tdef(\pip2, {
	inf.do{|i|
		if(i%3==0 or:{i.div(2)%6==2}, {
			~pip2.set(\t_trig, 1);
			~pip2.set(\pan, 0.8.rand2);
			~pip2.set(\freq, 200+(200.linrand).round(33.33));
			~pip2.set(\lag, (i%4)/8);
		}); ([2/3, 1/3].wchoose([0.5, 0.5])).wait}
}))

~pip4= {|freq= 5000, pan= 0, amp= 0.05, t_trig= 0| Pan2.ar(BPF.ar(Mix(Saw.ar(freq*[0.125, 1, 2.01, 3.02]*Lag.kr((LFSaw.kr(0.5)>0.2*0.5+0.5), 0.2), amp*[1, 1, 0.6, 0.3])*SinOsc.ar(LFSaw.kr(0.2, 0, SinOsc.kr(0.2, 0, 30, 50), 100).round(100))))*EnvGen.kr(Env.perc(0.01, 2), t_trig), pan)}

(Tdef(\pip3, {
	inf.do{|i|
		if(i%3==1 or:{i.div(2)%3==0}, {
			~pip3.set(\t_trig, 1);
			~pip3.set(\pan, 0.4.rand2);
			~pip3.set(\freq, 50+(200.linrand).round(66.67));
		}); [0.5, 0.5, 0.5, 1, 1].wrapAt(i).wait}
}))

~pip= {|freq= 900, pan= 0, amp= 0.1, t_trig= 0| Pan2.ar(BPF.ar(Mix(Saw.ar(freq*[1, 2.01, 4.02], amp*[1, 0.6, 0.3])*SinOsc.ar(LFSaw.kr(0.2, 0, SinOsc.kr(0.5, 0, 30, 200), 400).round(100))))*EnvGen.kr(Env.perc(0.01, 1), t_trig), pan)}

~pip3= {|freq= 50, pan= 0, amp= 0.1, t_trig= 0| Pan2.ar(BPF.ar(Mix(Saw.ar(freq*[1, 2.01, 5.02], amp*[1, 0.6, 0.3])*SinOsc.ar(LFSaw.kr(1.2, 0, SinOsc.kr(0.1, 0, 10, 50), 100).round(100))))*EnvGen.kr(Env.perc(0.01, 1), t_trig), pan)}

~pip2= {|freq= 333.33, pan= 0, amp= 0.1, t_trig= 0| Pan2.ar(BPF.ar(Mix(Saw.ar(freq*[0.5, 2.01, 3.02], amp*[1, 0.6, 0.3])*SinOsc.ar(LFSaw.kr(0.2, 0, SinOsc.kr(0.1, 0, 10, 50), 200).round(100))))*EnvGen.kr(Env.perc(0.01, 1.5), t_trig), pan)}

(Tdef(\pip2, {
	inf.do{|i|
		if(i%3==0 or:{i.div(2)%6==2}, {
			~pip2.set(\t_trig, 1);
			~pip2.set(\pan, 0.8.rand2);
			~pip2.set(\freq, 200+(400.linrand).round(66.67));
			~pip2.set(\lag, (i%4)/8);
		}); ([2/3, 1/3, 1/3].foldAt(i)).wait}
}))

~pipefx= {CombN.ar(~pip.ar+~pip3.ar, 0.2, 0.2, 2, 0.5)}
~pipefx2= {CombN.ar(~pipefx.ar, 0.3, 0.3, 1.8, 0.8)}

~pip= {|freq= 900, pan= 0, amp= 0.1, t_trig= 0| Pan2.ar(BPF.ar(Mix(Saw.ar(freq*[1, 3.01, 4.02], amp*[1, 0.6, 0.3])*SinOsc.ar(LFSaw.kr(0.4, 0, SinOsc.kr(0.5, 0, 5, 200), 400).round(100))))*EnvGen.kr(Env.perc(0.01, 1), t_trig), pan)}

~pip2= {|freq= 333.33, pan= 0, amp= 0.1, t_trig= 0| Pan2.ar(BPF.ar(Mix(Saw.ar(freq*[0.5, 2.01, 5.02], amp*[1, 0.6, 0.3])*SinOsc.ar(LFSaw.kr(0.2, 0, SinOsc.kr(0.1, 0, 10, 40), 200).round(100))))*EnvGen.kr(Env.perc(0.01, 1.5), t_trig), pan)}

(Tdef(\pip3, {
	inf.do{|i|
		if(i%4==2 or:{i.div(2)%3==0}, {
			~pip3.set(\t_trig, 1);
			~pip3.set(\pan, 0.4.rand2);
			~pip3.set(\freq, 50+(200.linrand).round(100));
		}); [0.5, 0.5, 0.5, 0.25, 0.25, 1].wrapAt(i).wait}
}))

(Tdef(\bass, {
	var fade;
	fade= Pseries(1, -0.01, 100).asStream;
	inf.do{|i|
		if(i%8==0, {
			~bass.set(\amp, 0.06*fade.next);
		});
		if(i%8==3, {
			~bass.set(\amp, 0);
		});
		if(i%5==0, {
			~bass.set(\freq, [50, 50, 67].foldAt(i));
		});
		1.wait
	}
}))

~pipefx= {CombN.ar(~pip.ar+RLPF.ar(~pip3.ar, 900, 0.2), 0.2, 0.2, 3, 0.5)}
~pipefx2= {CombN.ar(~pipefx.ar*LFNoise0.kr(4).max(0), 0.2, 0.2, 3, 1)}

~pip4= {|freq= 5000, pan= 0, amp= 0.05, t_trig= 0| Pan2.ar(BPF.ar(Mix(Saw.ar(freq*[0.125, 1, 2.01, 3.02]*(LFSaw.kr(0.5)>0.2*0.5+0.75), amp*[1, 1, 0.6, 0.3])*SinOsc.ar(LFSaw.kr(0.2, 0, SinOsc.kr(0.2, 0, 30, 50), 100).round(100))))*EnvGen.kr(Env.perc(0.01, 2), t_trig), pan)}

~pip3= {|freq= 50, pan= 0, amp= 0.1, t_trig= 0| Pan2.ar(BPF.ar(Mix(Saw.ar(freq*[1, 2.01, 5.02], amp*[1, 0.6, 0.3])*SinOsc.ar(LFSaw.kr(2, 0, SinOsc.kr(0.4, 0, 10, 50), 400).round(100))))*EnvGen.kr(Env.perc(0.01, 0.5), t_trig), pan)}

~pip3= {|freq= 50, pan= 0, amp= 0.1, t_trig= 0| Pan2.ar(BPF.ar(Mix(Saw.ar(freq*[1, 2.01, 5.02], amp*[1, 0.6, 0.3])*SinOsc.ar(LFSaw.kr(2, 0, SinOsc.kr(1.4, 0, 20, 50), 400).round(100))))*EnvGen.kr(Env.perc(0.01, 0.4), t_trig), pan)}

(Tdef(\pip3, {
	inf.do{|i|
		if(i%4==2 or:{i.div(2)%3==0}, {
			~pip3.set(\t_trig, 1);
			~pip3.set(\pan, 0.4.rand2);
			~pip3.set(\freq, 50+(200.linrand).round(100));
		}); [0.5, 0.25, 0.25].wrapAt(i).wait}
}))

(Tdef(\pip2, {
	inf.do{|i|
		if(i%3==1 or:{i.div(2)%6==2 or:{i%4==0}}, {
			~pip2.set(\t_trig, 1);
			~pip2.set(\pan, 0.9.rand2);
			~pip2.set(\freq, [300, 400, 400, 200, 300].wrapAt(i));
			~pip2.set(\lag, (i%4)/4);
		}); (1/3).wait}
}))
Tdef(\bass).stop
~bass.release

(Tdef(\pip4, {
	inf.do{|i|
		if(i%3==1 or:{i%8==1}, {
			~pip4.set(\t_trig, 1);
			~pip4.set(\pan, 0.4.rand2);
			~pip4.set(\freq, [5000, 5000, 5300, 5100].wrapAt(i)/2);
		}); 1.wait}
}))

~pip4= {|freq= 5000, pan= 0, amp= 0.05, t_trig= 0| Pan2.ar(BPF.ar(Mix(Saw.ar(freq*[0.125, 1, 2.01, 3.02]*(LFSaw.kr(0.5)<0.2*0.5+0.75), amp*[1, 1, 0.6, 0.3])*SinOsc.ar(LFSaw.kr(0.2, 0, SinOsc.kr(0.2, 0, 2, 20), 50).round(66.67))))*EnvGen.kr(Env.perc(0.01, 2), t_trig), pan)}

(Tdef(\pip4, {
	inf.do{|i|
		if(i%3==1 or:{i%8==1}, {
			~pip4.set(\t_trig, 1);
			~pip4.set(\pan, 0.4.rand2);
			~pip4.set(\freq, [5000, 5000, 5300, 5100].wrapAt(i)/3);
		}); 1.wait}
}))

~pip4= {|freq= 5000, pan= 0, amp= 0.05, t_trig= 0| Pan2.ar(BPF.ar(Mix(Saw.ar(freq*[0.125, 1, 2.01, 3.02]*(LFSaw.kr(0.5)<0.2*0.5+0.75), amp*[1, 1, 0.6, 0.3])*SinOsc.ar(LFSaw.kr(0.2, 0, SinOsc.kr(0.2, 0, 2, 20), 25).round(33.33))))*EnvGen.kr(Env.perc(0.01, 2), t_trig), pan)}

(Tdef(\pip4, {
	inf.do{|i|
		if(i%3==1 or:{i%8==1}, {
			~pip4.set(\t_trig, 1);
			~pip4.set(\pan, 0.4.rand2);
			~pip4.set(\freq, [5000, 5000, 5300, 5100].wrapAt(i)/4);
		}); 1.wait}
}))

~pip4.release(30)
Tdef(\pip4).stop
Tdef(\pip2).stop
Tdef(\pip2).play
Tdef(\pip2).stop
Tdef(\pip2).play
Tdef(\pip2).stop
~pip2.release
~pip3.release(20)
Tdef(\pip3).stop
Tdef(\pip).stop
~pip.release

p.clear
p
p.pop