p= ProxySpace.push(s.boot)
p.makeTempoClock(110/60)
c= p.clock

(SynthDef(\asdf, {|out= 0, fm= 400, fms= 40, fmd= 10, pm= 20, pms= 7, pmd= 1, amp= 0.1, dur= 1, pan= 0|
	var e, z;
	e= EnvGen.kr(Env.perc(0.01, dur), doneAction:2);
	z= SinOsc.ar(SinOsc.ar(fms, 0, fmd, fm), SinOsc.ar(pms, 0, pmd*pi, pm), amp);
	Out.ar(out, Pan2.ar(e*z, pan))
}).store)

Pdef(\test).play(c)

Pdef(\test, Pbind(\instrument, \asdf, \dur, Prand([0.25, 0.5], inf)))

Pdef(\test, Pbind(\instrument, \asdf, \dur, Pseq({[0.25, 0.5].choose}.dup(8), inf)))

Pdef(\test2, Pbind(\instrument, \asdf, \dur, Pseq(0.25.dup(6)++1, inf), \fms, Pseq({10.rrand(100).round(10)}.dup(8), inf)))
Pdef(\test2).play(c)

Pdef(\test2, Pbind(\instrument, \asdf, \dur, Pseq(0.25.dup(6)++1, inf), \fms, Pseq({10.rrand(100).round(10)}.dup(8), inf), \fm, 800))

Pdef(\test2, Pbind(\instrument, \asdf, \dur, Pseq(0.25.dup(6)++1, inf), \fms, Pseq({10.rrand(100).round(10)}.dup(8), inf), \fm, Pseq([800, 800, 900, 400, 400], inf)))

Pdef(\test2, Pbind(\instrument, \asdf, \dur, Pseq(0.25.dup(6)++1, inf), \fms, Pseq({10.rrand(100).round(10)}.dup(8), inf), \fm, Pseq([800, 800, 900, 400, 400], inf), \pms, Pseq([20, 25, 40, 9, 33], inf)))

Pdef(\test).stop
a= Pseq([Pdef(\test), Pdef(\test2)], inf).play(c)

Pdef(\test2).stop

Pdef(\test, Pbind(\instrument, \asdf, \dur, Pseq({[0.25, 0.5].choose}.dup(8), 2)))

Pdef(\test2, Pbind(\instrument, \asdf, \dur, Pseq(0.25.dup(6)++1, inf), \fms, Pseq({10.rrand(100).round(10)}.dup(8), inf), \fm, Pseq([800, 800, 900, 400, 400], inf), \pms, Pseq([20, 25, 40, 9, 33], 2)))

Pdef(\test, Pbind(\instrument, \asdf, \dur, Pseq({[0.25, 0.5].choose}.dup(8), 1), \pan, -0.5, \fmd, Pseq([10, 200], inf)))

Pdef(\test2, Pbind(\instrument, \asdf, \dur, Pseq(0.25.dup(6)++1, inf), \fms, Pseq({10.rrand(100).round(10)}.dup(8), inf), \fmd, Pseq([3, 50], inf), \fm, Pseq([800, 800, 900, 400, 400], inf), \pms, Pseq([20, 25, 40, 9, 33], 2), \pan, 0.5))

Pdef(\test3, Pbind(\instrument, \asdf, \dur, Pseq(1.dup(8), 1), \pan, 0, \fm, 80, \fmd, Pseq([10, 200], inf)))

Pdef(\meta, Pseq([Pdef(\test), Pdef(\test2), Pdef(\test3)], inf))
Pdef(\meta).play(c)
a.stop

Pdef(\meta2, Pseq([Pdef(\test), Pdef(\test2), Pdef(\test3)], inf))
Pdef(\meta2).quant_([1, 0.5])
Pdef(\meta2).play(c)

Pdef(\meta, Prand([Pdef(\test), Pdef(\test2)], inf))

Pdef(\test3, Pbind(\instrument, \asdf, \dur, Pseq(1.dup(7)++[0.125, 0.125, 0.25, 0.5], 1), \pan, 0, \fm, 80, \fmd, Pseq([10, 200], inf)))

Pdef(\test3, Pbind(\instrument, \asdf, \dur, Pseq(1.dup(7)++[0.125, 0.125, 0.25, 0.5], 1), \pan, 0, \fm, 80, \fmd, Pseq([10, 200], inf), \pmd, 0.7, \pms, 2))

(Pdef(\test3, Pseq([
	Pbind(\instrument, \asdf, \dur, Pseq(1.dup(7)++[0.125, 0.125, 0.25, 0.5], 1), \pan, 0, \fm, 80, \fmd, Pseq([10, 200], inf), \pmd, 0.7, \pms, 2),
	Pbind(\instrument, \asdf, \dur, Pseq(1.dup(7)++[0.125, 0.125, 0.25, 0.5].reverse, 1), \pan, 0, \fm, 80, \fmd, Pseq([10, 200], inf), \pmd, 0.3, \pms, 20)
], inf))
)

Pdef(\test, Pbind(\instrument, \asdf, \dur, Pseq({[0.25, 0.5].choose}.dup(10), 1), \pan, -0.5, \fmd, Pseq([100, 10, 200], inf)))

Pdef(\test2, Pbind(\instrument, \asdf, \dur, Prand([Pseq(0.25.dup(6)++1, inf), Pn(0.25, 4)], inf), \fms, Pseq({20.rrand(200).round(20)}.dup(8), inf), \fmd, Pseq([15, 30], inf), \fm, Pseq([800, 800, 1200, 400, 400], inf), \pms, Prand([Pseq([20, 25, 40, 9, 33], 2), Pseq([20, 25, 40, 9, 33]*3, 1)], 1), \pan, 0.5))

Pdef(\test, Pbind(\instrument, \asdf, \dur, Pseq({[0.25, 0.5].choose}.dup(10), 1), \pan, -0.5, \fmd, Pseq([100, 10, 400], inf)))

(Pdef(\test3, Pseq([
	Pbind(\instrument, \asdf, \dur, Pseq(1.dup(7)++[0.125, 0.125, 0.25, 0.5], 1), \pan, 0, \fm, 80, \fmd, Pseq([10, 200], inf), \pmd, 0.7, \pms, 2),
	Pbind(\instrument, \asdf, \dur, Pseq(1.dup(7)++[0.125, 0.125, 0.25, 0.5].reverse, 1), \pan, 0, \fm, 80, \fmd, Pseq([10, 200], inf), \pmd, 0.3, \pms, 20),
	Pbind(\instrument, \asdf, \dur, Pseq([0.125, 0.125, 0.25], Pseq([4, 3, 1], 2)), \pan, Prand([-1, 1], inf), \fm, 180, \fmd, Pseq([10, 200]*10, inf), \pmd, 1, \pms, 20)
], inf))
)

Pdef(\test, Pbind(\instrument, \asdf, \dur, Pseq({[0.25, 0.5].choose}.dup(10), 1), \pan, -0.5, \fmd, Pseq([100, 10, 400]*2, inf)))

Pdef(\slow).play(c)
Pdef(\slow, Pbind(\instrument, \asdf, \dur, Pseq([4, 8, 4], inf), \amp, 0.05, \fm, Pseq([5000, 5500, 6000], inf)))

Pdef(\slow, Pbind(\instrument, \asdf, \dur, Pseq([4, 8, 6], inf), \amp, 0.03, \fm, Pseq([5000, 5500, 6000], inf)))

Pdef(\slow, Pseq([
	Pn(Pbind(\instrument, \asdf, \dur, Pseq([4, 8, 6], inf), \amp, 0.03, \fm, Pseq([5000, 5500, 6000], inf)), 2),
	Pbind(\instrument, \asdf, \dur, Pseq([3, 6, 6], inf), \amp, 0.03, \fm, Pseq([3000, 3500, 3000], inf))
], inf))

Pdef(\slow, Pseq([
	Pbind(\instrument, \asdf, \dur, Pseq([4, 8, 6]*0.5, inf), \amp, 0.03, \fm, Pseq([5000, 5500, 6000], 2)),
	Pbind(\instrument, \asdf, \dur, Pseq([3, 3, 6], inf), \amp, 0.02, \fm, Pseq([3000, 3500, 2000], 1))
], inf))

Pdef(\slow, Pseq([
	Pbind(\instrument, \asdf, \dur, Pseq([4, 8, 6]*0.5, inf), \amp, 0.03, \fm, Pseq([5000, 5500, 6000], 2)),
	Pbind(\instrument, \asdf, \dur, Pseq([3, 3, 6], inf), \amp, 0.02, \fm, Pseq([3000, 3500, 2000], 1)),
	Pbind(\instrument, \asdf, \dur, Pseq([2, 1, 4], inf), \amp, 0.02, \fm, Pseq([2000, 1500, 1000], 2))
], inf))

Pdef(\test, Pbind(\instrument, \asdf, \dur, Pseq({[0.25, 0.5].choose}.dup(10), 1), \pan, -0.5, \fmd, Pseq([100, 10, 400]*0.5, inf), \fm, 200))

Pdef(\test2, Pbind(\instrument, \asdf, \dur, Prand([Pseq(0.25.dup(6)++1, inf), Pn(0.25, 4)], inf), \fms, Pseq({20.rrand(2000).round(100)}.dup(8), inf), \fmd, Pseq([5, 3], inf), \fm, Pseq([800, 800, 1200, 400, 400], inf), \pms, Prand([Pseq([20, 25, 40, 9, 33]*2, 2), Pseq([20, 25, 40, 9, 33]*4, 1)], 1), \pan, 0.5))

(Pdef(\test3, Pmul(\dur, Pseq([1.5, 1, 1, 0.5], inf), Pseq([
	Pbind(\instrument, \asdf, \dur, Pseq(1.dup(7)++[0.125, 0.125, 0.25, 0.5], 1), \pan, 0, \fm, 80, \fmd, Pseq([10, 200], inf), \pmd, 0.7, \pms, 2),
	Pbind(\instrument, \asdf, \dur, Pseq(1.dup(7)++[0.125, 0.125, 0.25, 0.5].reverse, 1), \pan, 0, \fm, 80, \fmd, Pseq([10, 200], inf), \pmd, 0.3, \pms, 20),
	Pbind(\instrument, \asdf, \dur, Pseq([0.125, 0.125, 0.25], Pseq([4, 3, 1], 2)), \pan, Prand([-1, 1], inf), \fm, 180, \fmd, Pseq([10, 200]*10, inf), \pmd, 1, \pms, 20)
], inf)))
)

(Pdef(\test3, Padd(\fm, Pseq([1, 100], inf), Pmul(\dur, Pseq([1.5, 1, 1, 0.5], inf), Pseq([
	Pbind(\instrument, \asdf, \dur, Pseq(1.dup(7)++[0.125, 0.125, 0.25, 0.5], 1), \pan, 0, \fm, 80, \fmd, Pseq([10, 200], inf), \pmd, 0.7, \pms, 2),
	Pbind(\instrument, \asdf, \dur, Pseq(1.dup(7)++[0.125, 0.125, 0.25, 0.5].reverse, 1), \pan, 0, \fm, 80, \fmd, Pseq([10, 200], inf), \pmd, 0.3, \pms, 20),
	Pbind(\instrument, \asdf, \dur, Pseq([0.125, 0.125, 0.25], Pseq([4, 3, 1], 2)), \pan, Prand([-1, 1], inf), \fm, 180, \fmd, Pseq([10, 200]*10, inf), \pmd, 1, \pms, 20)
], inf))))
)

(Pdef(\test3, Pmul(\fm, Pseq([1, 1.5, 2, 0.5], inf), Pmul(\dur, Pseq([1.5, 1, 1, 0.5], inf), Pseq([
	Pbind(\instrument, \asdf, \dur, Pseq(1.dup(7)++[0.125, 0.125, 0.25, 0.5], 1), \pan, 0, \fm, 80, \fmd, Pseq([10, 200], inf), \pmd, 0.7, \pms, 2),
	Pbind(\instrument, \asdf, \dur, Pseq(1.dup(7)++[0.125, 0.125, 0.25, 0.5].reverse, 1), \pan, 0, \fm, 80, \fmd, Pseq([10, 200], inf), \pmd, 0.3, \pms, 20),
	Pbind(\instrument, \asdf, \dur, Pseq([0.125, 0.125, 0.25], Pseq([4, 3, 1], 2)), \pan, Prand([-1, 1], inf), \fm, 180, \fmd, Pseq([10, 200]*10, inf), \pmd, 1, \pms, 20)
], inf))))
)

(Pdef(\test2, Pmul(\fm, Pseq([1, 1.5], inf), Pbind(\instrument, \asdf, \dur, Prand([Pseq(0.25.dup(6)++1, inf), Pn(0.25, 4)], inf), \fms, Pseq({20.rrand(2000).round(100)}.dup(8), inf), \fmd, Pseq([5, 3], inf), \fm, Pseq([800, 800, 1200, 400, 400], inf), \pms, Prand([Pseq([20, 25, 40, 9, 33]*2, 2), Pseq([20, 25, 40, 9, 33]*4, 1)], 1), \pan, 0.5))))

Pdef(\test, Pmul(\dur, Pseq([Pn(0.5, 8), Pn(1, 4)], inf), Pbind(\instrument, \asdf, \dur, Pseq({[0.25, 0.5].choose}.dup(10), 1), \pan, -0.5, \fmd, Pseq([100, 10, 400]*0.5, inf), \fm, 200)))

(Pdef(\slow, Pmul(\fm, Pseq([0.125, 1, 1], inf), Pseq([
	Pbind(\instrument, \asdf, \dur, Pseq([4, 8, 6]*0.5, inf), \amp, 0.03, \fm, Pseq([5000, 5500, 6000], 2)),
	Pbind(\instrument, \asdf, \dur, Pseq([3, 3, 6], inf), \amp, 0.02, \fm, Pseq([3000, 3500, 2000], 1)),
	Pbind(\instrument, \asdf, \dur, Pseq([2, 1, 4], inf), \amp, 0.02, \fm, Pseq([2000, 1500, 1000], 2))
], inf))
))

(Pdef(\slow, Pmul(\dur, Pwrand([Pn(1, 8), Pn(0.125/2, 10)], [0.8, 0.2], inf), Pmul(\fm, Pseq([0.125, 1, 1], inf), Pseq([
	Pbind(\instrument, \asdf, \dur, Pseq([4, 8, 6]*0.5, inf), \amp, 0.03, \fm, Pseq([5000, 5500, 6000], 2)),
	Pbind(\instrument, \asdf, \dur, Pseq([3, 3, 6], inf), \amp, 0.02, \fm, Pseq([3000, 3500, 2000], 1)),
	Pbind(\instrument, \asdf, \dur, Pseq([2, 1, 4], inf), \amp, 0.02, \fm, Pseq([2000, 1500, 1000], 2))
], inf))
)))

Pdef(\test, Pmul(\dur, Pseq([Pn(0.5, 8), Pn(1, 4)], inf), Pbind(\instrument, \asdf, \dur, Pseq({[0.25, 0.5, 0.125].choose}.dup(8), 1), \pan, -0.5, \fmd, Pseq([100, 10, 400]*0.25, inf), \fm, 100)))

(Pdef(\test2, Pmul(\fm, Pseq([1, Prand([3, 2], 1)], inf), Pbind(\instrument, \asdf, \dur, Prand([Pseq({[0.25, 0.125].choose}.dup(6)++1, inf), Pn(0.25, 4)], inf), \fms, Pseq({20.rrand(2000).round(100)}.dup(8), inf), \fmd, Pseq([5, 3], inf), \fm, Pseq([800, 800, 1200, 100, 400], inf), \pms, Prand([Pseq([20, 25, 40, 9, 33]*2, 2), Pseq([20, 25, 40, 9, 33]*4, 1)], 1), \pan, 0.5))))

(Pdef(\test2, Pmul(\fm, Pseq([1, Prand([3, 2], 1)], inf), Pbind(\instrument, \asdf, \dur, Prand([Pseq({[0.25, 0.125].choose}.dup(6)++1, inf), Pn(0.125, 4)], inf), \fms, Pseq({20.rrand(2000).round(100)}.dup(8), inf), \fmd, Pseq([5, 3], inf), \fm, Pseq([400, 400, 1200, 100, 400], inf), \pms, Prand([Pseq([20, 25, 40, 9, 33]*2, 2), Pseq([20, 25, 40, 9, 33]*4, 1)], 1), \pan, 0.5))))

(Pdef(\test3, Pmul(\fm, Pseq([1, 1.5, 2, 0.5], inf), Pmul(\dur, Pseq([1.5, 1, 1, 0.5], inf), Pseq([
	Pbind(\instrument, \asdf, \dur, Pseq(0.5.dup(14)++[0.125, 0.125, 0.25, 0.5], 1), \pan, 0, \fm, 80, \fmd, Pseq([10, 200], inf), \pmd, 0.7, \pms, 2),
	Pbind(\instrument, \asdf, \dur, Pseq(1.dup(7)++[0.125, 0.125, 0.25, 0.5].reverse, 1), \pan, 0, \fm, 120, \fmd, Pseq([10, 200], inf), \pmd, 0.3, \pms, 20),
	Pbind(\instrument, \asdf, \dur, Pseq([0.125, 0.25, 0.125], Pseq([6, 3, 1], 2)), \pan, Prand([-1, 1], inf), \fm, 180, \fmd, Pseq([10, 200]*10, inf), \pmd, 1, \pms, Prand([20, 30, 40], inf))
], inf))))
)

Pdef(\meta).stop
Pdef(\meta2).fadeTime_(20)
Pdef(\meta2, Pdef(\test2))
Pdef(\meta2, Pdef(\test))
Pdef(\meta2, Pdef(\test2))
Pdef(\meta2, Pdef(\test3))
Pdef(\meta2, Pdef(\test))
Pdef(\meta2, Pdef(\test2))
Pdef(\meta2, Pdef(\test3))
Pdef(\slow).stop
Pdef(\meta2, Pdef(\test2))
Pdef(\meta2).stop
p.clear
p.pop