Codigo 2 Martin Dominguez ////////////// ( SynthDef(\cuerda2,{|midi=70,amp=0.7,glis=0.0001| var sen,env,grano,out,midipi; midipi=[midi,midi/1.002].midicps.reciprocal; env=EnvGen.kr(Env.perc(0,0.01)); grano=Saw.ar(100)*env; sen=CombL.ar(grano,Line.kr((midipi+glis),midipi,0.2),Line.kr((midipi+glis),midipi,0.2),4); //sen=sen*SinOsc.kr(12,0,0.3,0.5); DetectSilence.ar(sen,doneAction:2); Out.ar(0,sen*amp) }).send(s) ); /* Synth(\cuerda2,[\glis,0.0002]) */ /////////// ( SynthDef(\tar, {|freq=200, dur=0.3, amp=0.03| var sig, entorchado, env; sig=SinOsc.ar(Line.kr(freq*1.05,freq,0.1),0,amp); entorchado=WhiteNoise.ar(amp/2)*Line.kr(1,0,dur/2); env=EnvGen.kr(Env.perc(0.01,dur),doneAction:2); Out.ar([0,1], (sig+entorchado)*env); }).send(s) ); /* Synth(\tar).play */ ////////////// ( SynthDef(\bom, {|freq=75, dur=1, amp=0.1| var sig, env, ataque; ataque=EnvGen.ar(Env([1,0],[0.01])); sig=SinOsc.ar(Line.kr(freq*1.2,freq*[1,1.1],0.1),0,amp); env=EnvGen.kr(Env.perc(0.01,dur),doneAction:2); Out.ar([0,1], (sig+ataque)*env); }).send(s) ); /* Synth(\bom); */ ///////////////////// ( SynthDef(\con, {var sig, env; sig=PinkNoise.ar(0.02); env=EnvGen.kr(Env.perc(0.05,0.2),doneAction:2); Out.ar([0,1],sig*env) }).send(s); ); /* Synth(\contra).play; */ //////// ( SynthDef(\brown, {|gate=1, freq=1, dur=9| var sig, env; sig=LPF.ar(BrownNoise.ar(0.2),160); env=EnvGen.kr(Env.new([0,1,0.3,0.8,0],[7,3,1,9],'sine',4,2),gate, doneAction:2); Out.ar([0,1],sig*env) }).send(s); ); /* a=Synth(\brown, [\gate,1]); a.set(\gate,0); */ /////////// ( SynthDef(\saw, {|gate=1, freq=1, dur=9| var sig, env; sig=HPF.ar(Saw.ar(10,0.3)*WhiteNoise.ar(0.3),10000); env=EnvGen.kr(Env.new([0,1,0.3,0.8,0],[7,3,1,9],'sine',4,2),gate, doneAction:2); Out.ar([0,1],sig*env) }).send(s); ); /* b=Synth(\saw, [\gate,1]); b.set(\gate,0); */ //////////////// ( SynthDef(\lftri, {|gate=1, freq=1, dur=9| var sig, env; sig=LFTri.ar(1,0,0.3)*LPF.ar(Pulse.ar(30,0.1,0.3),100); env=EnvGen.kr(Env.new([0,1,0],[3,17],'sine'),gate, doneAction:2); Out.ar([0,1],sig*env) }).send(s); ); /* c=Synth(\lftri); */ //////////////// ( SynthDef(\rlpf, {|gate=1, freq=220, dur=9| var sig, env; sig=RLPF.ar(Pulse.ar([freq,250],0.5,0.01), XLine.kr(8000,400,5), 0.04); env=EnvGen.kr(Env.new([0,1,0],[7,9],'sine'),gate, doneAction:2); Out.ar([0,1],sig*env) }).send(s); ); /* c=Synth(\rlpf, [\freq,[60,63].midicps.choose]); c.set(\gate,0); */ //////////////// ( SynthDef(\t1, {|gate=1, freq=220, dur=9| var sig, env; sig=RLPF.ar(Pulse.ar([freq,250],0.5,0.01), XLine.kr(8000,400,5), 0.5); env=EnvGen.kr(Env.perc(0.05,1),doneAction:2); Out.ar([0,1],sig*env) }).send(s); ); /* Synth(\t1).play; */ //////////////// ( SynthDef(\t2, {|gate=1, freq=100, dur=9| var sig, env; sig=LPF.ar(Pulse.ar(freq*[1.5],0.1,0.2),300); env=EnvGen.kr(Env.perc(0.1,2),doneAction:2); Out.ar([0,1],sig*env) }).send(s); ); /* Synth(\t2, [\freq, [36,43].midicps.choose]).play; */ //////////////////////// ( Tdef(\ze, { z=Prand(([54,62,69,76]+12),inf).asStream; z=Prand(([56,62,69,74]+12),inf).asStream; z=Prand(([56,64,69,68]+12),inf).asStream; z=Prand(([56,64,67,68]+12),inf).asStream; inf.do{|i| Synth(\cuerda2,[\midi,z.next,\amp, [0.4,0.3,0.2,0.01].choose]); 0.2.wait }; }).quant_(0) ); /* Tdef(\ze).play; Tdef(\ze).stop; */ ////////////////////// ( Tdef(\aco, {c=Prand([64,69,71,66,59,67,69].midicps,inf).asStream; 8.do{| i | Synth(\rlpf, [\freq, c.next]); 7.wait; }; }).quant_(0) ); /* Tdef(\aco).play; Tdef(\aco).stop; */ ////////////////////// ( Tdef(\t2, { 19.do{| i | Synth(\t2, [\freq, ~at2[i%~at2.size].midicps]); ~rt2[i%~rt2.size].wait; } }).quant_(0) ); /* Tdef(\t2).play; Tdef(\t2).stop; */ ( Tdef(\duo, { ~rd2=([1/2, 1/8,1/16,1/8,1/16,1/16,1/16, 1/4,1/2, 1/32,3/48,2/48,3/48,1/32,3/48,2/48,3/48, 1/4 ] *4); ~ad2=[69,63,65,68,71,62,72,68,61,67,61,68,69,68,68,65,65,64]+19; 18.do{| i | Synth(\t1, [\freq, ~ad2[i%~ad2.size].midicps]); ~rd2[i%~rd2.size].wait; }; }).quant_(0) ); /* Tdef(\duo).play; */ ////////////// ~bom=[0,1,4,7,9,11,12,15 ]; ( Tdef(\bom, { inf.do{| i | if(~bom.find([i%16])!=nil,{Synth(\bom)}); 0.25.wait; }; }).quant_(0) ); ~con=[0,1,2,3 ]; ( Tdef(\con, { inf.do{| i | if(~con.find([i%4])!=nil,{Synth(\con)}); 0.25.wait; }; }).quant_(0) ); /////////////////////////////////////////////////////////// ~bom2=[0,2 ]; ( Tdef(\bom2, { inf.do{| i | if(~bom2.find([i%4])!=nil,{Synth(\bom)}); 0.25.wait; }; }).quant_(0)); ~con2=[1,3,5,7,9,11,13,15 ]; ( Tdef(\con2, { inf.do{| i | if(~con2.find([i%16])!=nil,{Synth(\con)}); 0.25.wait; }; }).quant_(0) ); ////////////////////////////////////// ~tar=[2,6,10,14 ]; ( Tdef(\tar, { inf.do{| i | if(~tar.find([i%4])!=nil,{Synth(\tar)}); 0.25.wait; }; }).quant_(0) ); /*( Tdef(\bom).stop; Tdef(\con).stop; Tdef(\tar).stop; )*/ //////////////// ( Tdef(\bktr,{ 1.do{ a=Prand([60,65,63,68]-24,inf).asStream; 100.do{|i| Tdef(\aco).play; Synth(\cuerda2,[\midi,36,\amp, 0.rrand(i%[5,3,2,6].choose)/6,\glis,0.0002]); 0.2.wait }; ~rm2=([1/16,1/16,1/16,1/16, 1/16,1/16,1/16,1/8,1/8,1/16, 1/16,1/16,1/16,1/16,]*4); ~am2=[60,60,65,60,68,65,68,63,60,68,68,68,60,68,60,65,68,63]-12; 72.do{|i| Tdef(\aco).stop; Synth(\cuerda2,[\midi,[36,41].choose,\amp,\glis,0.0002]); ~rm2[i%~rm2.size].wait; }; 72.do{|i| Synth(\cuerda2,[\midi,~am2[i%~am2.size],\amp,\glis,0.0002]); ~rm2[i%~rm2.size].wait; }; ~am2=[61,61,66,61,68,66,68,63,61,68,68,68,61,68,61,66,68,63]-12; 50.do{|i| Synth(\cuerda2,[\midi,~am2[i%~am2.size],\amp,\glis,0.0002]); ~rm2[i%~rm2.size].wait; }; ~am2=([60,60,65,60,68,65,68,63,60,68,68,68,60,68,60,65,68,63]-12).scramble; 50.do{|i| Synth(\cuerda2,[\midi,~am2[i%~am2.size],\amp,\glis,0.0002]); ~rm2[i%~rm2.size].wait; }; ~am2=[61,61,66,61,68,66,68,63,61,68,68,68,61,68,61,66,68,63]-12; 50.do{|i| Synth(\cuerda2,[\midi,~am2[i%~am2.size],\amp,\glis,0.0002]); ~rm2[i%~rm2.size].wait; }; 100.do{|i| Synth(\cuerda2,[\midi,~am2[i%~am2.size],\amp,0.rrand(i%[5,3,2,6].choose)/6,\glis,0.0002]); ~rm2[i%~rm2.size].wait; }; a=Prand([60,64,66,67,69,70,71]-12,inf).asStream; 100.do{|i| Synth(\cuerda2,[\midi,a.next,\amp, 0.rrand(i%[5,3,2,6].choose)/6]); [0.12,0.2,0.07,0.1].wchoose([0.3,0.2,0.3,0.2]).wait; }; c=Prand([64,69,71,66,59,67,69].midicps,inf).asStream; 8.do{| i | Synth(\rlpf, [\freq, c.next]); 7.wait; }; ~rt2=([1/6,3/24,2/24,3/24, 1/2, 1/8,9/8, 1/32,3/48,2/48,3/48,1/16,3/16,9/8,1/8,3/16,1/16,1] *4); ~at2=[60,60,66,61,68,65,68,62,60,68,72,68,61,67,61,70,69,67]; 18.do{| i | Tdef(\duo).play; Synth(\t2, [\freq, ~at2[i%~at2.size].midicps]); ~rt2[i%~rt2.size].wait; }; c=Prand([60,66,65,61,62,69,63].midicps,inf).asStream; 4.do{| i | Tdef(\aco).play; Synth(\t2, [\freq, [63,63,60,68,61,69].midicps.choose]); [1,0.5].choose.wait; }; 4.do{| i | Synth(\t2, [\freq, [63,69,63,72,69].midicps.choose]); 1.wait; }; 4.do{| i | Synth(\t2, [\freq, [63,69,51,57,51,39,45].midicps.choose]); 1.25.wait; }; ~rt2=([1/6,3/24,2/24,3/24,1/8,1/8,1/16,3/16] *4); ~at2=[60,60,66,61,68,65,68,62,60,68]; 8.do{| i | Synth(\t2, [\freq, ~at2[i%~at2.size].midicps]); ~rt2[i%~rt2.size].wait; }; ~rt2=(([1/6,3/24,2/24,3/24,1/8,1/8,1/16,3/16]+[1/16]) *4).scramble; ~at2=([60,60,66,61,68,65,68,62,60,68]+3).scramble; 9.do{| i | Synth(\t2, [\freq, ~at2[i%~at2.size].midicps]); ~rt2[i%~rt2.size].wait; }; 4.do{| i | Synth(\t2, [\freq, [63,63,60,68,61,69].midicps.choose]); [1,0.5].choose.wait; }; 4.do{| i | Synth(\t2, [\freq, [63,69,63].midicps.choose]); 1.wait; }; 4.do{| i | Synth(\t2, [\freq, [63,69,51,57,51,39,45].midicps.choose]); 1.25.wait; }; ~art3=[1,3,4,6,7,10,11,12,16]-1; ~art4=[2,5,8,9,13,14,15]-1; 25.do{| i | if(~art3.find([i%16])!=nil,{Synth(\t2, [\freq, [60,65,62,68].midicps.choose])}); if(~art4.find([i%16])!=nil,{Synth(\t1, [\freq, [61,63,66,54,51,73].midicps.choose])}); 0.2.wait; }; c=Prand([68,65,63,60,56,61,66].midicps,inf).asStream; 25.do{| i | Tdef(\aco).play; if(~art3.find([i%16])!=nil,{Synth(\t2, [\freq, [60,65,62,68].midicps.choose])}); if(~art4.find([i%16])!=nil,{Synth(\t1, [\freq, [61,63,66,54,51,73].midicps.choose])}); if(~art3.find([i%16])!=nil,{Synth(\t2, [\freq, ([60,65,62,68]-[12,7].choose).midicps.choose])}); if(~art4.find([i%16])!=nil,{Synth(\t1, [\freq, ([61,63,66,54,51,73]-[24,12].choose).midicps.choose])}); 0.2.wait; }; 25.do{| i | if(~art3.find([i%16])!=nil,{Synth(\t2, [\freq, [60,65,62,68].midicps.choose])}); if(~art4.find([i%16])!=nil,{Synth(\t1, [\freq, [61,63,66,54,51,73].midicps.choose])}); 0.2.wait; }; ~art3=[0,1,2,3,4,5,6,7,8,10,11,12,13,15]; 25.do{| i | if(~art3.find([i%16])!=nil,{Synth(\t2, [\freq, ([60,65,62,68]-24).midicps.choose])}); if(~art4.find([i%16])!=nil,{Synth(\t1, [\freq, [61,63,66,54,51,73].midicps.choose])}); 0.2.wait; }; ~art3=[0,1,2,3,5,6,7,9,10,11,12,13,14,15]; 32.do{| i | if(~art3.find([i%16])!=nil,{Synth(\t2, [\freq, ([60,60,65,60,68,65,68,63,60,68,68,68,60,68,60,65,68,63]-24).midicps.choose])}); 0.2.wait; }; 32.do{| i | if(~art3.find([i%16])!=nil,{Synth(\t2, [\freq, ([60,60,65,60,68,65,68,63,60,68,68,68,60,68,60,65,68,63]-20).midicps.choose])}); 0.2.wait; }; ~art3=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]; a=Prand([60,64,66,67,69,70,71]-24,inf).asStream; 48.do{|i| if(~art3.find([i%16])!=nil,{Synth(\t2, [\freq, ([36,36,38,36,36,36,36]-5).midicps.choose])}); Synth(\cuerda2,[\midi,a.next,\amp, 0.rrand(i%[5,3,2,6].choose)/6,\glis,0.0002]); 0.2.wait }; 48.do{|i| if(~art3.find([i%16])!=nil,{Synth(\t2, [\freq, ([36,36,38,36,36,36,36]-3).midicps.choose])}); Synth(\cuerda2,[\midi,a.next,\amp, 0.rrand(i%[5,3,2,6].choose)/6,\glis,0.0002]); 0.2.wait }; ~art3=[0,1,2,3,5,7,9,10,11,13,14]; a=Prand([60,60,65,60,68,65,68,63,60,68,68,68,60,68,60,65,68,63]-24,inf).asStream; 48.do{|i| if(~art3.find([i%16])!=nil,{Synth(\t2, [\freq, ([60,60,65,60,68,65,68,63,60,68,68,68,60,68,60,65,68,63]-24).midicps.choose])}); Synth(\cuerda2,[\midi,a.next,\amp, 0.rrand(i%[5,3,2,6].choose)/6,\glis,0.0002]); 0.2.wait }; a=Prand([61,61,66,61,68,66,68,63,61,68,68,68,61,68,61,66,68,63]-24,inf).asStream; ~art3=[0,6,8,14,15]; 33.do{|i| if(~art3.find([i%16])!=nil,{Synth(\t2, [\freq, ([61,61,66,61,68,66,68,63,61,68,68,68,61,68,61,66,68,63]-24).midicps.choose])}); Synth(\cuerda2,[\midi,a.next,\amp, 0.rrand(i%[5,3,2,6].choose)/6,\glis,0.0004]); [0.2,0.5].choose.wait; }; 50.do{|i| Synth(\cuerda2,[\midi,a.next,\amp, 0.rrand(i%[5,3,2,6].choose)/6,\glis,0.0004]); [0.2,0.5].choose.wait; }; a=Prand([60,64,66,67,69,70,71]-12,inf).asStream; 100.do{|i| Synth(\cuerda2,[\midi,a.next,\amp, 0.rrand(i%[5,3,2,6].choose)/6]); [0.12,0.2,0.07,0.1].wchoose([0.3,0.2,0.3,0.2]).wait }; ~rm2=([1/16,1/16,1/16,1/16, 1/16,1/16,1/16,1/8,1/8,1/16, 1/16,1/16,1/16,1/16]*4); z=Prand(([56,64,67,68]+12),inf).asStream; 42.do{|i| Synth(\rlpf, [\freq,[44,44].midicps.choose]).play; Synth(\cuerda2,[\midi,56,\amp,\glis,0.0002]); ~rm2[i%~rm2.size].wait; }; 42.do{|i| Synth(\rlpf, [\freq,[40,40].midicps.choose]).play; Synth(\cuerda2,[\midi,52,\amp,\glis,0.0002]); ~rm2[i%~rm2.size].wait; }; z=Prand(([56,64,69,68]+12),inf).asStream; 42.do{|i| Synth(\rlpf, [\freq,[43,43].midicps.choose]).play; Synth(\cuerda2,[\midi,[55,55,55,55,57].choose,\amp,\glis,0.0002]); ~rm2[i%~rm2.size].wait; }; ~rm2=([1/16,1/16,1/16,1/16, 1/16,1/16,1/16,1/8,1/8,1/16, 1/16,1/16,1/16,1/16]*4).scramble; 42.do{|i| Synth(\rlpf, [\freq,[45,45].midicps.choose]).play; Synth(\cuerda2,[\midi,57,\amp,\glis,0.0002]); ~rm2[i%~rm2.size].wait; }; z=Prand(([54,62,69,76]+12),inf).asStream; 42.do{|i| Synth(\rlpf, [\freq,[38,38].midicps.choose]).play; Synth(\cuerda2,[\midi,50,\amp,\glis,0.0002]); ~rm2[i%~rm2.size].wait; }; z=Prand(([56,62,69,74]+12),inf).asStream; 42.do{|i| Synth(\rlpf, [\freq,[42,42].midicps.choose]).play; Synth(\cuerda2,[\midi,[54,54,54,54,56].choose,\amp,\glis,0.0002]); ~rm2[i%~rm2.size].wait; }; ~rm2=([1/16,1/16,1/16,1/16, 1/16,1/16,1/16,1/8,1/8,1/16, 1/16,1/16,1/16,1/16]*4).scramble; 42.do{|i| Synth(\cuerda2,[\midi,[54,55,54,56].choose,\amp,\glis,0.0002]); ~rm2[i%~rm2.size].wait; }; 28.do{|i| Synth(\rlpf, [\freq,[40,40].midicps.choose]).play; Synth(\cuerda2,[\midi,52,\amp,\glis,0.0002]); ~rm2[i%~rm2.size].wait; }; 42.do{|i| Synth(\rlpf, [\freq,[36,36].midicps.choose]).play; Synth(\cuerda2,[\midi,48,\amp,\glis,0.0002]); ~rm2[i%~rm2.size].wait; }; 42.do{|i| Synth(\rlpf, [\freq,[45,45].midicps.choose]).play; Synth(\cuerda2,[\midi,57,\amp,\glis,0.0002]); ~rm2[i%~rm2.size].wait; }; ~rm2=([1/16,1/16,1/16,1/16, 1/16,1/16,1/16,1/8,1/8,1/16, 1/16,1/16,1/16,1/16]*4).scramble; 20.do{|i| Synth(\rlpf, [\freq,[41,41].midicps.choose]).play; Synth(\cuerda2,[\midi,53,\amp,\glis,0.0002]); ~rm2[i%~rm2.size].wait; }; 20.do{|i| Synth(\rlpf, [\freq,[46,46].midicps.choose]).play; Synth(\cuerda2,[\midi,58,\amp,\glis,0.0002]); ~rm2[i%~rm2.size].wait; }; 38.do{|i| Synth(\rlpf, [\freq,[41,41].midicps.choose]).play; Synth(\cuerda2,[\midi,53,\amp,\glis,0.0002]); ~rm2[i%~rm2.size].wait; }; 20.do{|i| Synth(\rlpf, [\freq,[36,36].midicps.choose]).play; Synth(\cuerda2,[\midi,48,\amp,\glis,0.0002]); ~rm2[i%~rm2.size].wait; }; ~rm2=([1/16,1/16,1/16,1/16, 1/16,1/16,1/16,1/8,1/8,1/16, 1/16,1/16,1/16,1/16]*6).scramble; 20.do{|i| Synth(\rlpf, [\freq,[36,36].midicps.choose]).play; Synth(\cuerda2,[\midi,48,\amp,\glis,0.0002]); ~rm2[i%~rm2.size].wait; }; ~rm2=([ 1/4,1/14,1/4,1/2,1/2,1/4, ]*4); 28.do{|i| Synth(\rlpf, [\freq,[36,36].midicps.choose]).play; Synth(\cuerda2,[\midi,48,\amp,\glis,0.0002]); ~rm2[i%~rm2.size].wait; }; }; }) ) /* Tdef(\bktr).play; Tdef(\bktr).stop; */ /* Synth(\brown, [\gate,1]).play; b=Synth(\saw, [\gate,1]); Synth(\lftri).play; Tdef(\aco).play; Tdef(\aco).stop; Tdef(\ze).play; Tdef(\ze).stop; */ /*( Tdef(\con).play; Tdef(\bom).play; Tdef(\tar).play; )*/ /*( Tdef(\con).stop; Tdef(\bom).stop; Tdef(\tar).stop; )*/ /*( Tdef(\bom2).play; Tdef(\con2).play; )*/ /*( Tdef(\bom2).stop; Tdef(\con2).stop; Tdef(\bom2).play; Tdef(\con2).play; )*/ /*( Tdef(\bom2).stop; Tdef(\con2).stop; )*/