s.boot

p=ProxySpace.push(s)

~out.stop(4)

~out.play

~una={Mix(Decay2.ar(Impulse.ar(10),0.01,LFNoise0.kr(10,0.015,0.015),RLPF.ar(Dust.ar(100),[LFNoise0.kr(10,1500,2000),60],0.01)))}
~unaTrig={Impulse.ar(10)}
~unaAmp={Demand.ar(~unaTrig.ar,0,Dseq(Array.rand(10,0,0.02),10000))}

~out=~una
~out=~cresc*~crescEnv
~out=~cresc*~crescEnv+~una
~out=~cresc*~crescEnv+~una+~tambor
~out=~cresc*~crescEnv+~tambor
~out=0

(
Tdef(\cresc, {
			inf.do{

~cresc={Klank.ar(`[Array.rand(17,200,3000),nil,0.1],Demand.ar(Impulse.ar(100),0,Drand([-1,0,1,0],10000))*0.001)};
~crescEnv={EnvGen.kr(Env([0,0.5,1,0],[2,0.06,0.01]),1)};
[2,4,8].choose.wait;
}
})
)

(
Tdef(\cresc2, {
			inf.do{

~cresc={Klank.ar(`[Array.rand(17,200,13000),nil,0.1],Demand.ar(Impulse.ar(100),0,Drand([-1,0,1,0],10000))*0.001)};
~crescEnv={EnvGen.kr(Env([0,1,0.5,0],[0.01,0.2,2]),1)};
[2,4].choose.wait;
}
})
)

Tdef(\cresc).play
Tdef(\cresc2).play

(
Tdef(\tambor, {var si=0, att=0.05, decay=0.01,vol=0.02, tempo=0.05, arm=1, wrap=0.012, fund=100;
			inf.do{
					switch(si%32, 0,{~tambor={Blip.ar(fund*1,arm,vol).wrap2(wrap)*EnvGen.kr(Env.perc(att,decay),1)}},
								7,{~tambor={Blip.ar(fund*2,arm,vol).wrap2(wrap)*EnvGen.kr(Env.perc(att,decay),1)}},
								10,{~tambor={Blip.ar(fund*2,arm,vol).wrap2(wrap)*EnvGen.kr(Env.perc(att,decay),1)}},
								17,{~tambor={Blip.ar(fund*3,arm,vol).wrap2(wrap)*EnvGen.kr(Env.perc(att,decay),1)}},
								31,{~tambor={Blip.ar(fund*3,arm,vol).wrap2(wrap)*EnvGen.kr(Env.perc(att,decay),1)}},
								31.rand,{~tambor={Blip.ar(fund*4,arm,vol).wrap2(wrap)*EnvGen.kr(Env.perc(att,decay),1)}},
								31.rand,{~tambor={Blip.ar(fund*4,arm,vol).wrap2(wrap)*EnvGen.kr(Env.perc(att,decay),1)}},
								31.rand,{~tambor={Blip.ar(fund*5,arm,vol).wrap2(wrap)*EnvGen.kr(Env.perc(att,decay),1)}},
								31.rand,{~tambor={Blip.ar(fund*6,arm,vol).wrap2(wrap)*EnvGen.kr(Env.perc(att,decay),1)}}

								
						);
						si=si+1;
						tempo.wait;
					};
			})
)

Tdef(\tambor).play