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

//silly music
~blip= {|freq= 400, t_trig= 0, amp= 0.1, cutoff= 900| EnvGen.ar(Env.perc, t_trig)*LPF.ar(Saw.ar(freq, amp), cutoff)}
~out.ar(2)
~out.play
~out= ~blip
~blip.set(\t_trig, 1)
Tdef(\blip).play(c, quant:4)
(Tdef(\blip, {
	inf.do{|i|
		if(i%4==0, {
			~blip.set(\freq, [400, 500].choose);
			~blip.set(\t_trig, 1);
		});
		1.wait;
	}
}))

~blip= {|freq= 400, t_trig= 0, amp= 0.1, cutoff= 900, pan= 0| Pan2.ar(EnvGen.ar(Env.perc, t_trig)*LPF.ar(Saw.ar(freq, amp), cutoff), pan)}

(Tdef(\blip, {
	var dur, fre;
	dur= Pseq([0.5, 0.25, 0.25], inf).asStream;
	fre= Pseq([400, 500], inf).asStream;
	inf.do{|i|
		if(i%4==0, {
			~blip.set(\pan, 1.0.rand2);
		});
		~blip.set(\freq, fre.next);
		~blip.set(\t_trig, 1);
		dur.next.wait;
	}
}))

(Tdef(\blip, {
	var dur, fre, pan;
	dur= Pseq([0.5, 0.25, 0.25], inf).asStream;
	fre= Pseq([400, 500], inf).asStream;
	pan= Pseq([Pseries(-0.9, 0.2, 10)], inf).asStream;
	inf.do{|i|
		if(i%4==0, {
			~blip.set(\pan, pan.next);
		});
		~blip.set(\freq, fre.next);
		~blip.set(\cutoff, 400.rrand(1000));
		~blip.set(\t_trig, 1);
		dur.next.wait;
	}
}))

~blip= {|freq= 400, t_trig= 0, amp= 0.1, cutoff= 900, pan= 0, dur= 1, lag= 0.1| Pan2.ar(EnvGen.ar(Env.perc(0.01, dur), t_trig)*LPF.ar(Saw.ar(Lag.kr(freq, lag), amp), Lag.kr(cutoff, lag)), pan)}

(Tdef(\blip, {
	var dur, fre, pan;
	dur= Pseq([0.5, 0.25, 0.25], inf).asStream;
	fre= Pseq([400, 500], inf).asStream;
	pan= Pseq([Pseries(-0.9, 0.2, 10), Pseries(0.9, -0.2, 10)], inf).asStream;
	inf.do{|i|
		if(i%4==0, {
			~blip.set(\pan, pan.next);
		});
		~blip.set(\freq, fre.next);
		~blip.set(\cutoff, 400.rrand(1000));
		~blip.set(\dur, 0.8.rrand(1.2));
		~blip.set(\t_trig, 1);
		dur.next.wait;
	}
}))

Tdef(\disrupt).play(c, quant:4)
(Tdef(\disrupt, {
	var dur, fre;
	dur= Pseq([0.5, 0.5, 0.25, 2]*4, inf).asStream;
	fre= Pseq([80, 90, 60], inf).asStream;
	0.1.wait;
	inf.do{|i|
		~blip.set(\freq, fre.next);
		~blip.set(\lag, [0.01, 0.02].choose);
		~blip.set(\t_trig, 1);
		dur.next.wait;
	}
}))
Tdef(\blip).quant_(4)
Tdef(\disrupt).quant_(4)
(Tdef(\blip, {
	var dur, fre, pan;
	dur= Pseq([0.5, 0.25, 0.25], inf).asStream;
	fre= Pseq([Pseq([400, 500], 48), Pseq({400.rrand(800).round(100)}.dup(12), 2)], inf).asStream;
	pan= Pseq([Pseries(-0.9, 0.2, 10), Pseries(0.9, -0.2, 10)], inf).asStream;
	inf.do{|i|
		if(i%4==0, {
			~blip.set(\pan, pan.next);
		});
		~blip.set(\freq, fre.next);
		~blip.set(\cutoff, 400.rrand(1000));
		~blip.set(\dur, 0.8.rrand(1.2));
		~blip.set(\t_trig, 1);
		dur.next.wait;
	}
}))

~blop= {|freq= 400, t_trig= 0, amp= 0.1, cutoff= 900, pan= 0, dur= 1, lag= 0.1| Pan2.ar(EnvGen.ar(Env.perc(0.01, dur), t_trig)*BPF.ar(Pulse.ar(Lag.kr(freq, lag), SinOsc.kr(0.2, 0, 0.2, 0.5), amp), Lag.kr(cutoff, lag)), pan)}
~out= ~blip+~blop
~blop.set(\t_trig, 1)
~blop.set(\t_trig, 1)
~blop.set(\t_trig, 1)

Tdef(\blop).quant_(4).play(c)
(Tdef(\blop, {
	var dur, fre, pan;
	dur= Pseq([0.5, 0.25, 0.25], inf).asStream;
	fre= Pseq([Pseq([800, 1000], 48), Pseq({400.rrand(800).round(100)}.dup(12), 2)], inf).asStream;
	pan= Pseq([Pseries(-0.9, 0.2, 10), Pseries(0.9, -0.2, 10)], inf).asStream;
	inf.do{|i|
		if(i%4==0, {
			~blop.set(\pan, pan.next);
		});
		~blop.set(\freq, fre.next);
		~blop.set(\cutoff, 400.rrand(1000));
		~blop.set(\dur, 0.8.rrand(1.2));
		~blop.set(\t_trig, 1);
		dur.next.wait;
	}
}))

Tdef(\disrupt).stop
~bass= {|freq= 60, t_trig= 0, amp= 0.1, cutoff= 900, pan= 0, dur= 1, lag= 0.1| Pan2.ar(EnvGen.ar(Env.perc(0.01, dur), t_trig)*BPF.ar(LFTri.ar(Lag.kr(freq, lag), 0, amp), Lag.kr(cutoff, lag)), pan)}
~bass.set(\t_trig, 1)
~out= ~blip+~blop+~bass
(Tdef(\disrupt, {
	var dur, fre;
	dur= Pseq([0.5, 0.5, 0.25, 2]*4, inf).asStream;
	fre= Pseq([80, 90, 60], inf).asStream;
	0.1.wait;
	inf.do{|i|
		~bass.set(\freq, fre.next);
		~bass.set(\lag, [0.01, 0.01].choose);
		~bass.set(\t_trig, 1);
		dur.next.wait;
	}
}))
Tdef(\disrupt).play(c)
(Tdef(\disrupt, {
	var dur, fre;
	dur= Pseq([0.5, 0.5, 0.25, 2]*4, inf).asStream;
	fre= Pseq([50, 100, 120], inf).asStream;
	inf.do{|i|
		~bass.set(\freq, fre.next);
		~bass.set(\lag, [0.01, 0.6, 0.01].foldAt(i));
		~bass.set(\amp, 0.2.rrand(0.3));
		~bass.set(\dur, 1.0.rrand(1.5));
		~bass.set(\t_trig, 1);
		dur.next.wait;
	}
}))

~bits= {|t_trig= 0| Pan2.ar(EnvGen.ar(Env.perc(0.01, 0.1), t_trig)*RLPF.ar(WhiteNoise.ar(0.1), 2000, 0.4), SinOsc.kr(~tempo.kr, 0, 0.9))}
~out= ~blip+~blop+~bass+~bits
~bits.set(\t_trig, 1)
~bits.set(\t_trig, 1)
~bits.set(\t_trig, 1)
Tdef(\hh).quant_(4).play(c)
(Tdef(\hh, {
	inf.do{|i|
		if(i%4==(i%3), {
			~bits.set(\t_trig, 1);
		});
		0.25.wait;
	}
}))

~bits= {|t_trig= 0| Pan2.ar(EnvGen.ar(Env.perc(0.01, 0.1), t_trig)*RLPF.ar(WhiteNoise.ar(0.1), SinOsc.kr(~tempo.kr/2, 0, 500, 2000), 0.4), SinOsc.kr(~tempo.kr, 0, 0.9))}
~bits= {|t_trig= 0| Pan2.ar(EnvGen.ar(Env.perc(0.01, 0.1), t_trig)*RLPF.ar(WhiteNoise.ar(0.1), SinOsc.kr(~tempo.kr/2, 0, 500, 2000), 0.4).round(SinOsc.kr(0.1, 0, 0.02, 0.02)), SinOsc.kr(~tempo.kr, 0, 0.9))}

~bdrm= {|freq= 60, t_trig= 0| EnvGen.ar(Env.perc(0.01, 0.2), t_trig)*(SinOsc.ar(freq*[1, 1.01], 0, 0.5)+Impulse.ar(0))}
~out= ~blip+~blop+~bass+~bits+~bdrm
~bdrm.set(\t_trig, 1)
~bdrm= {|freq= 60, t_trig= 0, amp= 0.2| EnvGen.ar(Env.perc(0.01, 0.2), t_trig)*(SinOsc.ar(freq*[1, 1.01], 0, amp)+Impulse.ar(0))}
~bdrm.set(\t_trig, 1)
~bdrm.set(\t_trig, 1)
~bdrm.set(\t_trig, 1)
Tdef(\bd).quant_(4).play(c)
(Tdef(\bd, {
	inf.do{|i|
		if(i%3==(i%2), {
			~bdrm.set(\t_trig, 1);
		});
		0.5.wait;
	}
}))
(Tdef(\bd, {
	inf.do{|i|
		if(i%3==(i%2) or:{i%8==0}, {
			~bdrm.set(\t_trig, 1);
		});
		0.5.wait;
	}
}))

(Tdef(\blop, {
	var dur, fre, pan;
	dur= Pseq([0.5, 0.25, 0.25], inf).asStream;
	fre= Pseq([Pseq([800, 1200], 24), Pseq({400.rrand(800).round(100)}.dup(12), 2)], inf).asStream;
	pan= Pseq([Pseries(-0.9, 0.2, 10), Pseries(0.9, -0.2, 10)], inf).asStream;
	inf.do{|i|
		if(i%4==0, {
			~blop.set(\pan, pan.next);
		});
		~blop.set(\freq, fre.next);
		~blop.set(\cutoff, 400.rrand(1000));
		~blop.set(\dur, 0.8.rrand(1.2));
		~blop.set(\t_trig, 1);
		dur.next.wait;
	}
}))

(Tdef(\bd, {
	inf.do{|i|
		if(i%4==0, {
			~bdrm.set(\amp, 0.2);
			~bdrm.set(\t_trig, 1);
		}, {
			if(i%3==(i%2), {
				~bdrm.set(\amp, 0.1.rand);
				~bdrm.set(\t_trig, 1);
			});
		});
		0.5.wait;
	}
}))

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

(Tdef(\blip, {
	var dur, fre, pan;
	dur= Pseq([0.5, 0.25, 0.25], inf).asStream;
	fre= Pseq([400, 500, 400, 600], inf).asStream;
	pan= Pseq([Pseries(-0.9, 0.2, 10), Pseries(0.9, -0.2, 10)], inf).asStream;
	inf.do{|i|
		if(i%4==0, {
			~blip.set(\pan, pan.next);
			~blip.set(\lag, 0.01);
		});
		~blip.set(\freq, fre.next);
		~blip.set(\cutoff, 400.rrand(1000));
		~blip.set(\dur, 0.8.rrand(1.2));
		~blip.set(\t_trig, 1);
		dur.next.wait;
	}
}))

(Tdef(\blop, {
	var dur, fre, pan;
	dur= Pseq([0.5, 0.25, 0.25], inf).asStream;
	fre= Pseq([Pseq([800, 1200], 24), Prand({Pseq({400.rrand(800).round(100)}.dup(12), 2)}.dup(2), 1)], inf).asStream;
	pan= Pseq([Pseries(-0.9, 0.2, 10), Pseries(0.9, -0.2, 10)], inf).asStream;
	inf.do{|i|
		if(i%4==0, {
			~blop.set(\pan, pan.next);
			~blop.set(\lag, 0.01);
		});
		~blop.set(\freq, fre.next);
		~blop.set(\cutoff, 400.rrand(1000));
		~blop.set(\dur, 0.8.rrand(1.2));
		~blop.set(\t_trig, 1);
		dur.next.wait;
	}
}))

(Tdef(\blop, {
	var dur, fre, pan;
	dur= Pseq([0.5, 0.25, 0.25], inf).asStream;
	fre= Pseq([Pseq([800, 1200], 24), Pseq([Pseq({200.rrand(400).round(100)}.dup(12), 2), Pseq({400.rrand(800).round(100)}.dup(12), 2)], 1)], inf).asStream;
	pan= Pseq([Pseries(-0.9, 0.2, 10), Pseries(0.9, -0.2, 10)], inf).asStream;
	inf.do{|i|
		if(i%4==0, {
			~blop.set(\pan, pan.next);
		});
		~blop.set(\freq, fre.next);
		~blop.set(\cutoff, 400.rrand(1000));
		~blop.set(\dur, 0.8.rrand(1.2));
		~blop.set(\t_trig, 1);
		dur.next.wait;
	}
}))

(Tdef(\blop, {
	var dur, fre, pan;
	dur= Pseq([0.5, 0.25, 0.25], inf).asStream;
	fre= Pseq([Pseq([800, 600], 24), Pseq([Pseq({200.rrand(400).round(100)}.dup(12), 2), Pseq({400.rrand(800).round(100)}.dup(12), 2)], 1)], inf).asStream;
	pan= Pseq([Pseries(0.9, -0.2, 10), Pseries(-0.9, 0.2, 10)], inf).asStream;
	inf.do{|i|
		if(i%4==0, {
			~blop.set(\pan, pan.next);
			~blop.set(\lag, [0.01, 0.1, 0.2].choose);
		});
		~blop.set(\freq, fre.next);
		~blop.set(\cutoff, 1000.rrand(1600));
		~blop.set(\dur, 0.4.rrand(0.7));
		~blop.set(\t_trig, 1);
		dur.next.wait;
	}
}))

(Tdef(\blop, {
	var dur, fre, pan, oct;
	dur= Pseq([0.5, 0.25, 0.25], inf).asStream;
	fre= Pseq([Pseq([800, 600], 24), Pseq([Pseq({200.rrand(400).round(100)}.dup(12), 2), Pseq({400.rrand(800).round(100)}.dup(12), 2)], 1)], inf).asStream;
	pan= Pseq([Pseries(0.9, -0.2, 10), Pseries(-0.9, 0.2, 10)], inf).asStream;
	oct= Pseq([Pn(1, 24), Pn(2, 24), Pn(3, 24)], inf).asStream;
	inf.do{|i|
		if(i%4==0, {
			~blop.set(\pan, pan.next);
			~blop.set(\lag, [0.01, 0.1, 0.2].choose);
		});
		~blop.set(\freq, fre.next/oct.next);
		~blop.set(\cutoff, 1000.rrand(3600));
		~blop.set(\dur, 0.3.rrand(0.5));
		~blop.set(\t_trig, 1);
		dur.next.wait;
	}
}))

(Tdef(\blop, {
	var dur, fre, pan, oct;
	dur= Pwrand([Pseq([0.5, 0.25, 0.25], 48), Pn(0.125, 12)], [0.7, 0.3], inf).asStream;
	fre= Pseq([Pseq([800, 600], 24), Pseq([Pseq({200.rrand(400).round(100)}.dup(12), 2), Pseq({400.rrand(800).round(100)}.dup(12), 2)], 1)], inf).asStream;
	pan= Pseq([Pseries(0.9, -0.2, 10), Pseries(-0.9, 0.2, 10)], inf).asStream;
	oct= Pseq([Pn(1, 24), Pn(2, 24), Pn(3, 24)], inf).asStream;
	inf.do{|i|
		if(i%4==0, {
			~blop.set(\pan, pan.next);
			~blop.set(\lag, [0.01, 0.1, 0.2].choose);
		});
		~blop.set(\freq, fre.next/oct.next);
		~blop.set(\cutoff, 1000.rrand(3600));
		~blop.set(\dur, 0.3.rrand(0.5));
		~blop.set(\t_trig, 1);
		dur.next.wait;
	}
}))

(Tdef(\blip, {
	var dur, fre, pan;
	dur= Pseq([0.5, 0.25, 0.25], inf).asStream;
	fre= Pseq([400, 500, 400, 800, 400, 250, 400, 600], inf).asStream;
	pan= Pseq([Pseries(-0.9, 0.2, 10), Pseries(0.9, -0.2, 10)], inf).asStream;
	inf.do{|i|
		if(i%4==0, {
			~blip.set(\pan, pan.next);
			~blip.set(\lag, 0.01);
		});
		~blip.set(\freq, fre.next);
		~blip.set(\cutoff, 400.rrand(1000));
		~blip.set(\dur, 0.8.rrand(1.2));
		~blip.set(\t_trig, 1);
		dur.next.wait;
	}
}))

(Tdef(\blip, {
	var dur, fre, pan;
	dur= Pseq([0.5, 0.25, 0.25], inf).asStream;
	fre= Pseq([400, 500, 400, 800, 400, 250, 400, 150], inf).asStream;
	pan= Pseq([Pseries(-0.9, 0.2, 10), Pseries(0.9, -0.2, 10)], inf).asStream;
	inf.do{|i|
		if(i%4==0, {
			~blip.set(\pan, pan.next);
			~blip.set(\lag, 0.01);
		});
		~blip.set(\freq, fre.next);
		~blip.set(\cutoff, 400.rrand(1000));
		~blip.set(\dur, 0.8.rrand(1.2));
		~blip.set(\t_trig, 1);
		dur.next.wait;
	}
}))

(Tdef(\blip, {
	var dur, fre, pan;
	dur= Pseq([0.5, 0.25, 0.25]/2, inf).asStream;
	fre= Pseq([400, 500, 400, 800, 400, 250, 400, 150]/2, inf).asStream;
	pan= Pseq([Pseries(-0.9, 0.2, 10), Pseries(0.9, -0.2, 10)], inf).asStream;
	inf.do{|i|
		if(i%16==0, {
			~blip.set(\pan, pan.next);
			~blip.set(\lag, 0.1.rand);
		});
		~blip.set(\freq, fre.next);
		~blip.set(\cutoff, 400.rrand(1000));
		~blip.set(\dur, 0.8.rrand(1.2));
		~blip.set(\t_trig, 1);
		dur.next.wait;
	}
}))

~bits= {|t_trig= 0| Pan2.ar(EnvGen.ar(Env.perc(0.01, 0.1), t_trig)*RLPF.ar(WhiteNoise.ar(0.1), SinOsc.kr(~tempo.kr/2, 0, 200, 2000), 0.5).round(SinOsc.kr(0.1, 0, 0.03, 0.08)), SinOsc.kr(~tempo.kr, 0, 0.9))}

~bdrm= {|freq= 60, t_trig= 0, amp= 0.2| EnvGen.ar(Env.perc(0.001, 0.3), t_trig)*Pan2.ar(Mix(SinOsc.ar(freq*[1, SinOsc.kr(~tempo.kr, 0, 0.1, 2).round(0.1)], 0, amp))+Impulse.ar(0))}

(Tdef(\bd, {
	inf.do{|i|
		if(i%2==0, {
			~bdrm.set(\amp, 0.2);
			~bdrm.set(\freq, 60);
			~bdrm.set(\t_trig, 1);
		}, {
			if(i%3==(i%2), {
				~bdrm.set(\amp, 0.1.rand);
				~bdrm.set(\freq, 70);
				~bdrm.set(\t_trig, 1);
			});
		});
		0.5.wait;
	}
}))

(Tdef(\blip, {
	var dur, fre, pan;
	dur= Pseq([0.5, 0.25, 0.25]/2, inf).asStream;
	fre= Pseq([400, 500, 400, 800, 400, 250, 400, 150], inf).asStream;
	pan= Pseq([Pseries(-0.9, 0.2, 10), Pseries(0.9, -0.2, 10)], inf).asStream;
	inf.do{|i|
		if(i%16==0, {
			~blip.set(\pan, pan.next);
			~blip.set(\lag, 0.1.rand);
		});
		~blip.set(\freq, fre.next);
		~blip.set(\cutoff, i.div(10)%10*100+100);
		~blip.set(\dur, i.div(30)%10*0.1+0.1);
		~blip.set(\t_trig, 1);
		dur.next.wait;
	}
}))

(Tdef(\bd, {
	inf.do{|i|
		if(i%2==0, {
			~bdrm.set(\amp, 0.2);
			~bdrm.set(\freq, 60);
			~bdrm.set(\t_trig, 1);
			0.5.wait;
		}, {
			if(i%4==(i%5), {
				~bdrm.set(\amp, 0.1.rand);
				~bdrm.set(\freq, 70);
				~bdrm.set(\t_trig, 1);
				0.25.wait;
				~bdrm.set(\amp, 0.1.rand);
				~bdrm.set(\freq, 70);
				~bdrm.set(\t_trig, 1);
				0.25.wait;
			}, {
				0.5.wait;
			});
		});
	}
}))

~bits= {|t_trig= 0| Pan2.ar(EnvGen.ar(Env.perc(0.01, 0.1), t_trig)*RLPF.ar(WhiteNoise.ar(0.1), SinOsc.kr(~tempo.kr/2, 0, 200, 2500), 0.5).round(SinOsc.kr(0.1, 0, 0.03, 0.1)), SinOsc.kr(~tempo.kr, 0, 0.9))}

~bass= {|freq= 60, t_trig= 0, amp= 0.1, cutoff= 900, pan= 0, dur= 1, lag= 0.1| Pan2.ar(EnvGen.ar(Env.perc(0.001, dur), t_trig)*RLPF.ar((ClipNoise.ar(0.01)*EnvGen.kr(Env.perc(0, dur/3), t_trig))+LFTri.ar(Lag.kr(freq, lag), 0, amp), EnvGen.kr(Env.sine(dur), t_trig)+1*4*cutoff), pan)}
~bass= {|freq= 60, t_trig= 0, amp= 0.1, cutoff= 900, pan= 0, dur= 1, lag= 0.1| Pan2.ar(EnvGen.ar(Env.perc(0.001, dur), t_trig)*LPF.ar((ClipNoise.ar(0.01)*EnvGen.kr(Env.perc(0, dur/3), t_trig))+Mix(LFTri.ar(Lag.kr(freq*[1, 2, 3], lag), 0, amp*0.5)), EnvGen.kr(Env.sine(dur), t_trig)+1*4*cutoff), pan)}
~bass= {|freq= 60, t_trig= 0, amp= 0.1, cutoff= 900, pan= 0, dur= 1, lag= 0.1| Pan2.ar(EnvGen.ar(Env.perc(0.001, dur), t_trig)*LPF.ar((ClipNoise.ar(0.01)*EnvGen.kr(Env.perc(0, dur/3), t_trig))+Mix(LFTri.ar(Lag.kr(freq*[1, 2, 0.5], lag), 0, amp*0.5)).round(0.1), EnvGen.kr(Env.sine(dur), t_trig)+1*3*cutoff), pan)}

(Tdef(\disrupt, {
	var dur, fre;
	dur= Pseq([0.5, 0.5, 0.25, 2.75]*2, inf).asStream;
	fre= Pseq([50, 100, 120, 50], inf).asStream;
	inf.do{|i|
		~bass.set(\freq, fre.next);
		~bass.set(\lag, [0.01, 0.1, 0.01].foldAt(i));
		~bass.set(\amp, 0.2.rrand(0.3));
		~bass.set(\dur, 1.0.rrand(1.5));
		~bass.set(\t_trig, 1);
		dur.next.wait;
	}
}))

(Tdef(\disrupt, {
	var dur, fre, mul;
	mul= Prand([Pn(0.125, 8), Pn(1, 16)], inf).asStream;
	dur= Pseq([0.5, 0.5, 0.25, 2.75]*2, inf).asStream;
	fre= Pseq([50, 100, 120, 50], inf).asStream;
	inf.do{|i|
		~bass.set(\freq, fre.next);
		~bass.set(\lag, [0.01, 0.1, 0.01].foldAt(i));
		~bass.set(\amp, 0.2.rrand(0.3));
		~bass.set(\dur, 1.0.rrand(1.5));
		~bass.set(\t_trig, 1);
		(dur.next*mul.next).wait;
	}
}))

(Tdef(\bd, {
	inf.do{|i|
		if(i%2==0, {
			~bdrm.set(\amp, 0.2);
			~bdrm.set(\freq, 60);
			~bdrm.set(\t_trig, 1);
		}, {
			if(i%3==(i%2), {
				~bdrm.set(\amp, 0.1.rand);
				~bdrm.set(\freq, 70);
				~bdrm.set(\t_trig, 1);
			}, {
				if(i%5==(i%4), {
					8.do{|j|
						~bdrm.set(\amp, j*0.01);
						~bdrm.set(\freq, 70+(j*30));
						~bdrm.set(\t_trig, 1);
						0.125.wait;
					};
				});
			});
		});
		0.5.wait;
	}
}))

(Tdef(\hh, {
	inf.do{|i|
		if(i%4==3, {
			~bits.set(\t_trig, 1);
		}, {
			if(i%4==(i%3), {
				~bits.set(\t_trig, 1);
			}, {
				if(i%5==(i%4), {
					8.do{|j|
						~bits.set(\t_trig, 1);
						0.125.wait;
					};
				});
			});
		});
		0.25.wait;
	}
}))

(Tdef(\blip, {
	var dur, fre, pan;
	dur= Pseq([0.5, 0.25, 0.25]/2, inf).asStream;
	fre= Pseq([400, 500, 400, 800, 400, 250, 400, 150], inf).asStream;
	pan= Pseq([Pseries(-0.9, 0.2, 10), Pseries(0.9, -0.2, 10)], inf).asStream;
	inf.do{|i|
		if(i%16==0, {
			~blip.set(\pan, pan.next);
			~blip.set(\lag, 0.1.rand);
		});
		~blip.set(\freq, fre.next);
		~blip.set(\cutoff, i.div(10)%10*100+100);
		~blip.set(\dur, i.div(30)%10*0.1+0.1);
		~blip.set(\t_trig, 1);
		dur.next.wait;
		if(i%16==8.rand, {
			8.do{|j|
				~blip.set(\freq, 1000);
				~blip.set(\dur, 0.1);
				~blip.set(\t_trig, 1);
				(j*0.125+0.125).wait;
			};
			
		});
	}
}))

(Tdef(\disrupt, {
	var dur, fre, mul;
	mul= Prand([Pn(0.125, 8), Pn(1, 16)], inf).asStream;
	dur= Pseq([0.5, 0.5, 0.25, 2.75]*2, inf).asStream;
	fre= Pseq([Pseq([50, 100, 120, 50], 4), Pseq([100, 180, 200, 180], 1)], inf).asStream;
	inf.do{|i|
		~bass.set(\freq, fre.next);
		~bass.set(\lag, [0.01, 0.1, 0.01].foldAt(i));
		~bass.set(\amp, 0.2.rrand(0.3));
		~bass.set(\dur, 1.0.rrand(1.5));
		~bass.set(\t_trig, 1);
		(dur.next*mul.next).wait;
	}
}))

(Tdef(\blop, {
	var dur, fre, pan, oct;
	dur= Pwrand([Pseq([0.5, 0.25, 0.25], 48), Pn(0.125, 12)], [0.7, 0.3], inf).asStream;
	fre= Pseq([Pseq([800, 600], 24), Pseq([Pseq({200.rrand(400).round(100)}.dup(24), 2), Pseq({400.rrand(800).round(100)}.dup(12), 2)], 1)], inf).asStream;
	pan= Pseq([Pseries(0.9, -0.2, 10), Pseries(-0.9, 0.2, 10)], inf).asStream;
	oct= Pseq([Pn(1, 24), Pn(2, 12), Pn(4, 24)], inf).asStream;
	inf.do{|i|
		if(i%4==0, {
			~blop.set(\pan, pan.next);
			~blop.set(\lag, [0.01, 0.1, 0.2].choose);
		});
		~blop.set(\freq, fre.next/oct.next);
		~blop.set(\cutoff, 1000.rrand(3600));
		~blop.set(\dur, 0.3.rrand(0.5));
		~blop.set(\t_trig, 1);
		dur.next.wait;
	}
}))

(Tdef(\bd, {
	inf.do{|i|
		if(i%12==0, {
			~bdrm.set(\amp, 0.2);
			~bdrm.set(\freq, 60);
			~bdrm.set(\t_trig, 1);
		}, {
			if(i%13==(i%2), {
				~bdrm.set(\amp, 0.1.rand);
				~bdrm.set(\freq, 70);
				~bdrm.set(\t_trig, 1);
			}, {
				if(i%15==(i%4), {
					8.do{|j|
						~bdrm.set(\amp, j*0.01);
						~bdrm.set(\freq, 70+(j*30));
						~bdrm.set(\t_trig, 1);
						0.125.wait;
					};
				});
			});
		});
		0.5.wait;
	}
}))

~bits= {|t_trig= 0| Pan2.ar(EnvGen.ar(Env.perc(0.01, 0.1), t_trig)*RLPF.ar(WhiteNoise.ar(0.1), SinOsc.kr(~tempo.kr/2, 0, 400, 3000), 0.5).round(SinOsc.kr(0.1, 0, 0.03, 0.15)), SinOsc.kr(~tempo.kr, 0, 0.9))}

(Tdef(\hh, {
	inf.do{|i|
		if(i%8==3, {
			~bits.set(\t_trig, 1);
		}, {
			if(i%8==(i%3), {
				~bits.set(\t_trig, 1);
			}, {
				if(i%5==(i%4), {
					8.do{|j|
						~bits.set(\t_trig, 1);
						0.125.wait;
					};
				});
			});
		});
		0.25.wait;
	}
}))

(Tdef(\blip, {
	var dur, fre, pan;
	dur= Pseq([0.5, 0.25, 0.25]/2, inf).asStream;
	fre= Pseq([400, 500, 400, 800, 400, 250, 400, 150], inf).asStream;
	pan= Pseq([Pseries(-0.9, 0.2, 10), Pseries(0.9, -0.2, 10)], inf).asStream;
	inf.do{|i|
		if(i%16==0, {
			~blip.set(\pan, pan.next);
			~blip.set(\lag, 0.1.rand);
		});
		~blip.set(\freq, fre.next);
		~blip.set(\cutoff, i.div(10)%10*100+100);
		~blip.set(\dur, i.div(30)%10*0.1+0.1);
		~blip.set(\t_trig, 1);
		dur.next.wait;
		if(i%8==8.rand, {
			16.do{|j|
				~blip.set(\freq, [1000, 2000].choose);
				~blip.set(\dur, 0.1);
				~blip.set(\t_trig, 1);
				(j*0.125+0.125).wait;
			};
			
		});
	}
}))
Tdef(\disrupt).stop
Tdef(\disrupt).play
Tdef(\disrupt).stop

Tdef(\blip).stop
Tdef(\blop).stop
Tdef(\disrupt).play

Tdef(\disrupt).stop
Tdef(\bd).stop

~bits.release(20)

Tdef(\hh).stop
p.clear
p.pop