Hackpact.Mx

. . . make and document something new everyday, for one month
Inicio Proyectos     Contacto Ligas

Carlos Hasbun

29 Julio 2011
   
28 Julio 2011

//código SuperCollider

 

 
27 Julio 2011

//código SuperCollider

 

 
26 Julio 2011

//código SuperCollider

///////////hackPact mx #26jul11
/////////////un sinte con un switch para cambiar sus valores
s.boot;
s.quit;
s.scope;
s.record
s.stopRecording;
(////
(
SynthDef(\cambiante,{|gate=0,nota=60,windowSize=0.2,pRatio=1,rel=0.25
pDisp=0,tDisp=0,rTime=3,damp=0.05,lineTime=0.25|
var un,env;
un=LFTri.ar(nota.midicps,0,0.1)*LFNoise0.ar(LFCub.ar((4..8),120,1800));
un=PitchShift.ar(un,windowSize,pRatio,pDisp,tDisp);
un=GVerb.ar(un,10,rTime,damp,0.5);
un=Limiter.ar(un,0.5);
un=RHPF.ar(un,Line.kr(10000,140,lineTime));
env=EnvGen.ar(Env.perc(0.25,rel),gate,doneAction:2);
Out.ar(0,Pan2.ar(un*env,[0.9,-0.92]));
}).add;
);
(
Tdef(\cambiador,{|cambios|
var c=0;
var tiempo=Pwrand([0.25,0.5,1,2],[0.2,0.43,0.23,0.13],inf).asStream;
var notas=Pxrand([55,63,67,74,75],inf).asStream;
var oct=Prand([1,2,3],inf).asStream;
loop{
y=Array.series(4,0,1);//[0,1,2,3]
c=c+1;
cambios=3-y.scramble[c%y.size];
cambios.value.postln;
switch(cambios.value,0,{
Synth(\cambiante,[\gate,1,
\nota,60,
\windowSize,0.02,
\pRatio,oct.next,
\pDisp,0.15,
\tDisp,0.025,
\rTime,4,
\lineTime,0.25,
\rel,1.75]);
},
1,{
Synth(\cambiante,[\gate,1,
\nota,notas.next,
\windowSize,0.1,
\pRatio,oct.next,
\pDisp,0.3,
\tDisp,0.25,
\rTime,8,
\lineTime,0.5,
\rel,2.5]);
},
2,{
Synth(\cambiante,[\gate,1,
\nota,notas.next,
\windowSize,0.2,
\pRatio,oct.next,
\pDisp,0.2,
\tDisp,0.1,
\rTime,2,
\lineTime,0.2,
\rel,0.25]);
},
3,{
Synth(\cambiante,[\gate,1,
\nota,notas.next,
\windowSize,0.05,
\pRatio,oct.next,
\pDisp,0.04,
\tDisp,0.5,
\rTime,6,
\lineTime,0.35,
\rel,0.5]);
}
);
tiempo.next.wait;
}
})
);
);////////final
Tdef(\cambiador).play;
Tdef(\cambiador).stop;

reproducir muestra

descargar código

hp-26jul11-JCHasbun

25 Julio 2011

//código SuperCollider

///////////hackPact #23jul11
/////// ...un mini generador de escalas a la oldSchool!
//////con un boton y dos popUpMenu para seleccionar la escala y el tempo
/////todas partiendo de la tonalidad de do "C'
s.boot;
s.quit;
s.scope;
s.record;
s.stopRecording;
//
(////timbre sencillo
SynthDef(\oscilador,{|gate=1,nota|
var in,env;
in=SinOsc.ar(12-nota.midicps,0,0.75)+
LFTri.ar(nota.midicps,0.5,0.75);
env=EnvGen.ar(Env.perc(0.01,0.1),gate,doneAction:2);
Out.ar(0,Pan2.ar(in*env),[1,-1]);
}).add;
);
(//cont
(
Tdef(\contador,{
var c=0,sig=0,notas,escala=~a[1],tiempo=1;//si sig es 1 pasa al siguiente elemento del array de arrays
~a=[
~cromatica=Array.series(12,60,1).mirror1,
~mayor=[60,62,64,65,67,69,71,72].mirror2,//.stutter(2)regresa s/ultimo elemento y duplica cada nota 2 veces
~menor=[60,62,63,65,67,69,70,72].mirror2,//regresa repitiendo el ultimo elemento
~menorArmonica=[60,62,63,65,67,71,72].mirror2,//.pyramid,//regresa valores en piramide
~pentatonicaMayor=[60,62,64,67,69,72].mirror2,
~pentatonicaMenor=[60,63,65,67,68,72].mirror2
];
inf.do{
notas=(escala[c%escala.size]).postln;//mira el post #midicps q se esta tocando
c=c+sig;
~inst=Synth(\oscilador);
~inst.set(\nota,notas);
~butt.action={|val|if(val.value==0,{sig=0},{sig=1})};
~popum.action={|ind|
ind.value.postln;
switch(ind.value,
0,{escala=~a[0]},
1,{escala=~a[1]},
2,{escala=~a[2]},
3,{escala=~a[3]},
4,{escala=~a[4]},
5,{escala=~a[5]}
);
};
~popum1.action={|index|
index.value.postln;
switch(index.value,
0,{tiempo=4},
1,{tiempo=2},
2,{tiempo=1},
3,{tiempo=0.5},
4,{tiempo=0.25},
5,{tiempo=0.125}
);
};
tiempo.wait;
};
});
);
~win=JSCWindow("escalas",Rect(0,100,300,140)).front;
~butt=JSCButton(~win,Rect(10,10,280,40));
~butt.states=[["continuar escala",Color.white,Color.green],["detener la escala",Color.black,Color.red]];
~popum=JSCPopUpMenu(~win,Rect(10,50,280,40));
~popum.items=["cromatica","mayor","menor", "menorArmonica","pentatonicaMayor","pentatonicaMenor"];
~popum1=JSCPopUpMenu(~win,Rect(10,90,280,40));
~popum1.items=["1 entero","1/2","1/4","1/8","1/16","1/32"];
);
Tdef(\contador).play;//play del contador escalar
Tdef(\contador).stop;
/////buena opcion para hacer escalas -> thnx @rukano
Scale
Tuning

reproducir muestra

descargar código

hp-25jul11-JCHasbun

24 Julio 2011

//código SuperCollider

 

 
23 Julio 2011

//código SuperCollider

 

 
22 Julio 2011

//código SuperCollider

/////////////hackPact mx 22jul11
/////////// ... HxC kicks! II
s.boot;
s.quit;
s.scope;
/////
(//sintes
(
SynthDef(\hckick,{|amp=0.8|
var kick,env;
kick=Pulse.ar(Pulse.ar(2,0.5,60,82),0.5,amp);
env=EnvGen.ar(Env.perc(0.01,0.5),1,doneAction:2);
Out.ar(0,Pan2.ar(kick*env,[1,-1]));
}).add;
);
(
SynthDef(\hcsnare,{|amp=0.9|
var snare,env;
snare=WhiteNoise.ar(Pulse.ar(10,0.15,600,8200),0.1);
snare=RLPF.ar(snare,3200,0.45);
snare=Limiter.ar(snare,amp-0.05);
snare=GVerb.ar(snare,6,4,0.05);
env=EnvGen.ar(Env.perc(0.01,0.25),1,doneAction:2);
Out.ar(0,Pan2.ar(snare*env,[1,-1]));
}).add;
);
(
SynthDef(\hchats,{|amp=0.7|
var hihats,env;
hihats=WhiteNoise.ar(Pulse.ar(10,0.5,600,8200),0.1);
hihats=RHPF.ar(hihats,4200,0.45);
hihats=Limiter.ar(hihats,amp);
env=EnvGen.ar(Env.perc(0.01,0.15),1,doneAction:2);
Out.ar(0,Pan2.ar(hihats*env,[1,-1]));
}).add;
);
(
SynthDef(\sinte,{|amp=0.5,rel|
var sint,env;
sint=LFTri.ar(LFNoise0.kr(2,120,440)+LFNoise0.kr(4,120,240));
sint=InRange.ar(sint,0.01,0.5,0.1);
sint=PitchShift.ar(sint,Line.kr(0.05,0.5,0.25),XLine.kr((1..2),(1..3)));
sint=Limiter.ar(sint,amp);
sint=FreeVerb.ar(sint,0.5,0.9,0.05);
env=EnvGen.ar(Env.perc(0.01,rel),1,doneAction:2);
Out.ar(0,Pan2.ar(sint*env,[0.9,-0.8]));
}).add;
);
(////secs
(
Pdef(\kk,(
Pbind(\instrument,\hckick,
\dur, Pseq([
Pseq([0.25,0.25,0.25,0.25]/2,7),
Pseq([0.25,0.25,0.25,0.125,0.125],1)
],inf),
\amp, Pseq([
Pseq([0.8,0.6,0.7,0.5],7),
Pseq([0.8,0.4,0.6,0.5,0.4],1)
],inf)
)
))
);
(
Pdef(\snr,(
Pbind(\instrument,\hcsnare,
\dur, Pseq([
Pseq([0.5,0.5,0.5,0.5]/2,7),
Pseq([0.5,0.5,0.5,0.125,0.125,0.125,0.125],1)
],inf),
\amp, Pseq([
Pseq([0,0.9,0,0.75],7),
Pseq([0,0.9,0,0.9,0.8,0.7,0.6],1)
],inf)
)
))
);
(
Pdef(\hh,(
Pbind(\instrument,\hchats,
\dur, Pseq([
Pseq([0.125,0.125,0.125,0.125]/2,7),
Pseq([0.125,0.125,0.0625,0.0625,0.125,0.125,0.25,0.0625,0.0625],1)
],inf),
\amp, Pseq([
Pseq([0.7,0.5,0.65,0.45],7),
Pseq([0.7,0.5,0.6,0.4,0.7,0.5,0.6,0.4,0.35],1)
],inf)
)
))
);
(
Pdef(\snt,(
Pbind(\instrument,\sinte,
\dur, Pseq([
Pseq([0.25,0.25,0.25,0.25]/0.25,7),
Pseq([0.25,0.25,0.25,0.125,0.125],1)
],inf),
\amp, Pseq([
Pseq([0.8,0.6,0.7,0.5],7),
Pseq([0.8,0.4,0.6,0.5,0.4],1)
],inf),
\rel, Pseq([
Pseq([0.25,0.5,0.25,0.75]/2,7),
Pseq([0.5,0.25,0.5,0.25,0.25],1)
],inf)
)
))
);
);
);
//
(
Pdef(\kk).play;
Pdef(\snr).play;
Pdef(\hh).play;
Pdef(\snt).play;
)
//
Pdef(\kk).stop;
Pdef(\snr).stop;
Pdef(\hh).stop;
Pdef(\snt).stop;
////
s.record;
s.stopRecording;

reproducir muestra

descargar código

hp-22jul11-JCHasbun

21 Julio 2011

//código SuperCollider

/////////////////hackPact #21jul11
/////////////140 caracteres - SCTwit
s.boot;
s.scope;
//0
play{|i|GVerb.ar(VarSaw.ar(LFDClipNoise.kr((2..6),77,220),0.1,0.3) *Pulse.ar(TChoose.kr(Dust.kr(4+i),[61,76,68].midiratio*0.06),0.5,0.025))};
///140
s.record;
s.stopRecording;

reproducir muestra

descargar código

hp-21jul11-JCHasbun

20 Julio 2011

//código SuperCollider

/////////////hackPact mx # 20jul11
//////////////// cyberArpa ...tonal o cromatico? ...los dos!
s.boot;
s.quit;
s.scope;
s.record;
s.stopRecording;
//////
(
SynthDef(\sinte,{|gate=1,nota|
var timbre,env;
timbre=(LFTri.ar(nota.midicps,-0.5,0.2)*LFTri.ar(nota.midicps,0.5,0.1))+
TChoose.ar(Impulse.kr(2),[
SinOsc.ar(nota.midicps,0.25,0.035),
Saw.ar(nota.midicps,0.25,0.02),
Pulse.ar(nota.midicps,0.25,0.015),
LFTri.ar(nota.midicps,0.25,0.035)
]);
timbre=RLPF.ar(timbre,XLine.kr(220,13200, TChoose.kr(Impulse.kr(2),[1,2,0.5,1])),0.25);
timbre=GVerb.ar(timbre,10,8,0.01,mul:0.5);
env=EnvGen.ar(Env.perc(0.1,2),gate,doneAction:2);
Out.ar(0,Pan2.ar(timbre*env,[1,-0.95]));
}).add;
);
~cromatico=Array.newClear(12);
~tonal=Array.newClear(8);
(
r=Routine({
var x,y,z;
var tiempo=Pwrand([0.25,0.25,0.125,1],[0.45,0.35,0.15,0.05],inf).asStream;
var secrome=Pseq([0,1,2,3,4,5,6,7,8,9,10,11],inf).asStream;
var secton=Pseq([0,1,2,3,4,5,6,7],inf).asStream;
inf.do{
x=(60..72).choose;
y=[60,63,67,71,72].choose;
z=[-24,-12,-5,0,7,12,24].choose;
if(x==y,{//
~tonal.put((0..7).choose,y);
},
{
~cromatico.put((0..11).choose,x+z);
});
~cromatico.put((0..11).choose,x);
~cromatico.postln;//mira el post
~tonal.postln;//mira el post
w=Synth(\sinte);
if(secrome.next+60==y,
{
w.set(\nota,~tonal[secrome.next]);
},
{
w.set(\nota,~cromatico[secton.next]);
});
tiempo.next.wait;
}
});
);
////
r.play;
r.stop;
r.free;

reproducir muestra

descargar código

hp-20jul11-JCHasbun

19 Julio 2011

//código SuperCollider

/////////////////////hackPact mx #19jul11
/////////////// ...un liveCoding X
s.boot;
s.quit;
s.scope;
//////
p=ProxySpace.push(s);
p.fadeTime=10;
/////
~o.play;
//////
~homero={Limiter.ar(Spring.ar(LFTri.ar(LFNoise0.kr(2,100,100),0,0.5) *LFNoise0.kr(TChoose.kr(Impulse.kr(0.25),[2,4,16]),0.5),10,0.01),0.5)!2};
~bart={Gate.ar(Saw.ar(TChoose.kr(Impulse.kr(2),[100,200,300,400]), Demand.kr(Impulse.kr(TChoose.kr(Impulse.kr(2),[1,2,4])),0, Drand([0,0.1,0.2,0.3,0.4,0.5],inf)),0.1) *LFNoise0.kr(TChoose.kr(Impulse.kr(0.25),[2,4]),0.1),LFNoise2.kr(4))};
~maggie={EnvGen.ar(Env.perc(0.01,0.25), Demand.kr(Impulse.kr(2),0,Drand([0,1],inf))) *SinOsc.ar(Demand.kr(Impulse.kr(1),0, Drand([40,50,60,70,80,90].midiratio*20,inf)),0,0.5)};
~magverb={FreeVerb.ar(~maggie.ar,0.75,0.96,0.05,1.2)}
~nelson={Gate.ar(Pulse.ar((60..72),0.5,0.05) ,LFNoise2.kr(MouseButton.kr(2,16,0.1)))};
~liza={Gate.ar(LFTri.ar(MouseButton.kr(200,5600,10),0,0.05) *LFNoise0.kr(mul:0.1),LFNoise0.kr(4))};
~lizaverb={Limiter.ar(GVerb.ar(~liza.ar,5, Demand.kr(Impulse.kr(1),0,Drand([1,2,4,6],inf)),0.1),0.5)}
//////
~o=~homero;
~o=~magverb;
~o=~bart+~magverb+~homero//+~nelson;
~o=~magverb+~lizaverb;
~o=~magliza+~lizaverb+~bart+~homero;
~o=~nelson+~magliza
~o=~homero+~bart+~magverb+~nelson+~lizaverb;
~o=~lizaverb+~magverb+~bart;
~o=0;
s.record;
s.stopRecording;

reproducir muestra

descargar código

hp-19jul11-JCHasbun

18 Julio 2011

//código SuperCollider

////////////hackpact mx #18jul11
/////////////////// ... du_ub !!! or pseudub
s.boot;
s.quit;
s.scope;
/////////
p=ProxySpace.push(s);
p.fadeTime=0.01;
////
~o.play
////kk
~bmb={|t_trig,amp|EnvGen.ar(Env.perc(0.01,0.15),t_trig) *SinOsc.ar(Pulse.ar(2,0.3,60,92),0,0.2+amp)};
(
Tdef(\bmbs,{
var bmbacc=Pseq([0.95,0.75,0.9,0.7],inf).asStream;
var bmbTime=Pseq([Pseq([1.5,0.5,1.5,2],1),
Pseq([1.5,0.5,1.5,0.25,0.25],1),
Pseq([1.5,0.5,1.5,1.75,0.25],1),
Pseq([1.5,0.5,1.5,0.25,0.125,0.125],1)],
inf).asStream;
inf.do{
~bmb.set(\t_trig,1);
~bmb.set(\amp,bmbacc.next);
bmbTime.next.wait;
}
})
);
///////
~dubass={|t_trig,nota,basosc|Limiter.ar(Pan2.ar(EnvGen.ar( Env.asr(0.01,5,5),t_trig)*RLPF.ar((LFTri.ar(nota.midicps,0,0.35) *Saw.ar(nota.midicps+basosc,0.35,0.5))+LFTri.ar(nota.midicps +basosc,0,0.25),LFNoise1.kr(4,100,Line.kr(101,1250,30)),0.25),[1,-0.95]),0.9)};
(
Tdef(\bassec,{
var bassfilt=Pxrand([480,960,1920,2600,4200,6000],inf).asStream;
var bassnote=Pwrand([60,67,63,72]-24,[0.3,0.3,0.3,0.1],inf).asStream;
var oscbass=Pseq([Pseq([2,2,2,2],16),
Pseq([4,4,4,4],2),
Pseq([1,2,1,2,1,2,1,2,1,2],1),
Pxrand([1,2,4,8],1)
],inf).asStream;
var snrTime=Pseq([Pseq([1.5,0.5,1.5,2],1),
Pseq([1.5,0.5,1.5,0.25,0.25],1),
Pseq([1.5,0.5,1.5,1.75,0.25],1),
Pseq([1.5,0.5,1.5,0.25,0.125,0.125],1)
],inf).asStream;
inf.do{
~dubass.set(\t_trig,1);
~dubass.set(\nota,bassnote.next);
~dubass.set(\bfilt,bassfilt.next);
~dubass.set(\basosc,oscbass.next);
snrTime.next.wait;
}
})
);
//////hihats
~hht={|t_trig|EnvGen.ar(Env.perc(0.01,0.1),t_trig) *HPF.ar(WhiteNoise.ar(0.25),5600,0.5)};//sin_delay
~hht={|t_trig|CombN.ar(EnvGen.ar(Env.perc(0.01,0.1),t_trig) *HPF.ar(WhiteNoise.ar(0.35),5600,0.5),0.5,MouseY.kr(0.01,0.26),0.9)};
(
Tdef(\hhts,{
var contrastie=Pseq([Pseq([1,1,1,0.5,0.5],1), Pwrand([1,0.75,0.5,0.25],[0.55,0.25,0.15,0.05],1)],inf).asStream;
inf.do{
~hht.set(\t_trig,1);
contrastie.next.wait;
}
})
);
/////snare
~snr={|t_trig,amp|FreeVerb.ar(EnvGen.ar(Env.perc(0.01,0.2),t_trig) *LPF.ar(GrayNoise.ar(amp),8600,0.45),MouseX.kr(0,0.6),0.9,0.01)};
(
Tdef(\snrs,{
var tarolAmp=Pseq([Pseq([0,0.7]),Pseq([0,0.7]),Pseq([0,0.7]), Pseq([0,0.5,0.65,0.7])],inf).asStream;
var taroltime=Pseq([Pseq([1,1,1,0.25,0.5,0.25],4), Pseq([1,1,1,0.25,0.25,0.25,0.25],1)],inf).asStream;
inf.do{
~snr.set(\t_trig,1);
~snr.set(\amp,tarolAmp.next);
taroltime.next.wait;
}
})
);
//////synths
~synt={|t_trig,nota,sfilt,rel|Normalizer.ar(BPF.ar(EnvGen.ar( Env.perc(0.05,rel),t_trig)*FreeVerb.ar((Pulse.ar(nota.midicps +LFNoise2.kr(nota.midicps,0.25,nota.midicps,nota.midicps).range(nota.midicps,3 +nota.midicps),0.5,0.15)*Saw.ar(7+nota.midicps,0.35,0.5) +LFTri.ar(12+nota.midicps,0,0.2)),0.9,0.5,0.1),sfilt,0.5),0.25)};
(
Tdef(\synths,{
var synthfilt=Pxrand([120,240,480,960,1920],inf).asStream;
var synthnote=Pwrand([60,67,63,72],[0.3,0.3,0.3,0.1],inf).asStream;
var syntrel=Prand([0.25,0.5,0.125],inf).asStream;
inf.do{
~synt.set(\t_trig,1);
~synt.set(\nota,synthnote.next);
~synt.set(\sfilt,synthfilt.next);
~synt.set(\rel,syntrel.next);
1.5.wait;
}
})
);
(//play all
Tdef(\bassec).play;
Tdef(\bmbs).play;
Tdef(\hhts).play;
Tdef(\snrs).play;
Tdef(\synths).play;
);
Tdef(\bassec).stop;
Tdef(\bmbs).stop;
Tdef(\hhts).stop;
Tdef(\snrs).stop;
Tdef(\synths).stop;
////
~o=~hht+~bmb+~snr+~dubass+~synt;
~o=~bmb+~snr
~o=~bmb+~snr+~hht
~o=~bmb+~snr+~hht+~dubass
~o=~bmb+~snr+~hht+~dubass+~synt;
~o=~hht+~synt
~o=~synt
~o=0;
///////
s.record;
s.stopRecording;

reproducir muestra

descargar código

hp-18jul11-JCHasbun

17 Julio 2011
   
16 Julio 2011
   
15 Julio 2011
   
14 Julio 2011

//código SuperCollider

///////////hackpact #14jul11
////////////////////////////escalar
/////por alguna razon desconocida al usar el metodo .record, generaba clipping cada trigger y mejor
/////fue grabado directamente a audacity x jack
s.boot;
s.quit;
s.scope;
FreqScope.new;
s.meter;
/////
TempoClock.default.tempo=86/60;
(
SynthDef(\fx,{|gate=1|
var efx,env;
efx=In.ar(30);
efx=FreeVerb.ar(efx,0.5,0.96,0.15);
env=EnvGen.ar(Env.asr(0.01,0.98,0.01),gate,doneAction:2);
Out.ar(0,Pan2.ar(efx*env,[1,-0.9]));
}).add;
);
Synth(\fx);
(
SynthDef(\escala,{|gate=1,nota,nota1,trans|
var ton,notas,env;
ton=trans+nota;
notas=Limiter.ar(Resonz.ar(Pulse.ar(ton.midicps,0.1,0.65),MouseX.kr(60,6000),0.25)+
Resonz.ar(LFTri.ar(nota1.midicps,0,0.75),MouseY.kr(260,6000),0.25),0.5);
env=EnvGen.ar(Env.perc(0.01,0.5),gate,doneAction:2);
Out.ar(30,Pan2.ar(notas*env,[1,-0.9]));
}).add;
);
(
Pdef(\escalasec,(
Pbind(\instrument, \escala,
\dur, Prand([Pxrand([2,1,0.5,0.25],1),
Prand([1,0.75,0.5,0.25],1)],
inf),
\nota, Prand([60,62,64,65,67,69,71,72],inf),//[60,62,64,65,67,69,71,72]mayor
\nota1, Prand([60,62,64,65,67,69,71,72],inf),//[69,71,72,74,76,77,79,81]menor
\trans, Pxrand([0,7,12,-12],inf)
)
))
);
Pdef(\escalasec).play;
Pdef(\escalasec).stop;
//////////
//s.record;

reproducir muestra

descargar código

hp-14jul11-JCHasbun

13 Julio 2011

//código SuperCollider

//////////hackpact mx #13jul11
////////////////TripGrains! no audios!
s.boot;
s.scope;
s.quit;
/////////////
b=Buffer.alloc(s, s.sampleRate * 8, 1);
b.plot
//b.free
(//////timbres
(
SynthDef(\bombo,{|out,gate=1,amp|
var kick,env;
kick=SinOsc.ar(60,mul:amp)+LFTri.ar(Pulse.ar(2,0.3,60,75),0,amp);
env=EnvGen.ar(Env.perc(0.01,0.3),gate,doneAction:2);
Out.ar(out,Pan2.ar(kick*env,[0.95,-1]));
}).add
);
(
SynthDef(\tarola,{|out,gate=1,amp|
var tar,env;
tar=BPF.ar(Saw.ar([440,880,1600,3200],mul:amp)+WhiteNoise.ar(amp),2040,0.75);
env=EnvGen.ar(Env.perc(0.01,0.25),gate,doneAction:2);
Out.ar(out,Pan2.ar(tar*env,[0.75,-0.75]));
}).add
);
(
SynthDef(\hhts,{|out,gate=1,amp|
var hats,env;
hats=RHPF.ar(WhiteNoise.ar(amp),2000,0.25);
hats=CombC.ar(hats,0.5,0.02,4);
env=EnvGen.ar(Env.perc(0.025,0.05),gate,doneAction:2);
Out.ar(out,Pan2.ar(hats*env,[1,-1]));
}).add
);
);
(////////secuencias
(
Pdef(\bomb,(
Pbind(\instrument, \bombo,
\dur, Pxrand([Pseq([0.25,0.25,0.5,0.75,0.25],1),
Pseq([0.5,0.5,0.25,0.75],1),
Pseq([0.75,0.25,1],1),
Pseq([0.75,0.5,0.25,0.5],1)],inf),
\amp, Pseq([0.85,0],inf),
\out, 30
)
))
);
(
Pdef(\tar,(
Pbind(\instrument, \tarola,
\dur, Pseq([Pseq([0.5,0.5,0.75,0.25],2),
Pseq([0.5,0.5,0.5,0.125,0.125,0.25],2),
Pseq([0.5,0.5,0.5,0.5],2),
Pseq([0.5,0.5,0.5,0.125,0.125,0.125,0.125],2)],inf),
\amp, Pseq([0,0.5],inf),
\out, 30
)
))
);
(
Pdef(\hat,(
Pbind(\instrument, \hhts,
\dur, Pseq([Pseq([0.125,0.125,0.25,0.25,0.25],4),
Pseq([0.5,0.25,0.25,0.125,0.125,0.25,0.5],4),
Pseq([0.5,0.125,0.5,0.125,0.25,0.25],4),
Pseq([0.125,0.125,0.125,0.125,0.125,0.125,0.125,0.125],1)],inf),
\amp, 0.15,
\out, 30
)
))
);
);
(//timbres play
Pdef(\bomb).play;
Pdef(\tar).play;
Pdef(\hat).play;
);
(///rec
~baserec = {|gate=1,vol=0.5|
var in,env;
in=In.ar(30);
in=RecordBuf.ar(in,b,0,1);
env=EnvGen.ar(Env.asr(0.01,0.98,0.01),gate,doneAction: 2);
Out.ar(32,Pan2.ar(in*env,[1, -1])* vol)
}.play
);
(//granulos
~granos={|vol=0.25,vel=2,d=2,rat=1|
var granus,dur,trate;
trate=MouseX.kr(1,4).poll;
dur=d/trate;
granus=TGrains.ar(2,Impulse.kr(trate),b,MouseY.kr(-1,8).poll,0,dur,0.5);
Out.ar(0,Normalizer.ar(Pan2.ar(granus,[1, -1]),vol));
};
);
(
SynthDef(\sintamb,{|gate=1,nota=61|
var amb,env;
amb=LFTri.ar(nota.midicps,0,0.05);
amb=FreeVerb.ar(amb,1,0.99,0.1,1.1);
env=EnvGen.ar(Env.perc(0.9,4),gate,doneAction:2);
Out.ar(0,Pan2.ar(amb*env,[1,-9]));
}).add;
);
(//secs
Tdef(\cambios,{
var velocidad=Pxrand([0.5,1,2],inf).asStream;
var de=Prand([1,4],inf).asStream;
~granos.play;
inf.do{
~granos.set(\vel,velocidad.next);
~granos.set(\d,de.next);
0.5.wait;
}
});
);
(//secs
Tdef(\sint,{
var tono=Pxrand([61,64,68,73,75,78],inf).asStream,time=Prand([0.5,1,2,4],inf).asStream;
inf.do{
x=Synth(\sintamb);
x.set(\nota,tono.next);
time.next.wait;
}
});
);
Tdef(\cambios).play;
Tdef(\sint).play;
//Tdef(\cambios).stop;
Tdef(\sint).stop;
///////////
s.record;
s.stopRecording;

reproducir muestra

descargar código

hp-13jul11-JCHasbun

12 Julio 2011

//código SuperCollider

//////hackPact #12jul11
///////////// reremix del dia 11 en proxy y con 9na mayor jjjjjj
////////en gedit aun tira un error pero auditivamente todo esta correcto.
s.boot;
s.quit;
s.scope;
////
p=ProxySpace.push(s);
p.fadeTime=0.5;
//////
~o.play
(////
~tec={|t_trig,nota=60|EnvGen.ar(Env.perc(0.01,0.5),t_trig) *LFTri.ar(nota.midicps,0,0.45)};
~alea={|t_trig|EnvGen.ar(Env.perc(0.01,0.3),t_trig) *Limiter.ar(InRange.ar(LFTri.ar(LFNoise0.kr(3,100,120),0,0.1) *Pulse.kr((6),mul:0.1).range(0.1,1),0.01,0.1),0.2)!2};
~se={|t_trig|EnvGen.ar(Env.perc(0.01,0.11),t_trig) *SinOsc.ar(SinOsc.kr(6,0,440,880),0,0.35)};
~ru={|t_trig|EnvGen.ar(Env.perc(0.01,0.15),t_trig) *LFNoise0.ar(Pulse.ar(3,0.1,100,1000),0.1)};
);//~o=sintes.next.postln;
v=Array.newClear(4);//notas
w=Array.newClear(4);//sintes
(
Tdef(\evals,{
var a,x,y,z;
var trans=Prand([7,12,-12,-5,0],inf).asStream;
var tono=Pxrand([v[0],v[1],v[2],v[3]],inf).asStream;
inf.do{
x=[0,1].choose;
y=x+1;//1,2
z=2;
a=x+y+z;//3,4
if(y==z,{//
v.put(0,[61,64,68].choose-trans.next);//base [61,64,68,72,73,75]c#maj7M9
w.put(0,[~alea,~tec,~se,~ru].choose);//[~alea,~tec,~se,~ru]
},
{
v.put(1,[64,68,72].choose+trans.next);//
w.put(1,[~alea,~tec,~se,~ru].scramble.choose);
});
if(a-1==z,{
v.put(2,[68,72,73].choose+trans.next);//
w.put(2,[~alea,~tec,~se,~ru].scramble.choose);
},
{
v.put(3,[72,72,75].choose-trans.next);//
w.put(3,[~alea,~tec,~se,~ru].choose);
});
~tec.set(\t_trig,1);
~tec.set(\nota,tono.next);
~ru.set(\t_trig,1);
~se.set(\t_trig,1);
~alea.set(\t_trig,1);
//v.postln;
//w.postln;
0.25.wait;
}
});
);
(
Tdef(\salida,{
var tiempo=Prand([
Pwrand([0.25,0.5,1,2],[0.15,0.35,0.25,0.25],1),
Pwrand([0.25,0.5,1,2],[0.45,0.35,0.15,0.05],1),
Pwrand([0.25,0.5,1,2],[0.45,0.25,0.25,0.05],1),
Pseq([0.25,0.25,0.25,0.25],4)
],inf).asStream;
inf.do{
~o=w[1];//Mix(w[0],w[2]);
tiempo.next.wait;
}
})
)
~rev={Pan2.ar(FreeVerb.ar(~o.ar,0.5,0.95,0.1,1.2),[1,-1])};
~rev.play;
////
Tdef(\evals).play;
Tdef(\salida).play;
Tdef(\evals).stop;
Tdef(\evals).stop;
//////
s.record;
s.stopRecording;

reproducir muestra

descargar código

hp-12jul11-JCHasbun

11 Julio 2011

//código SuperCollider

///////hackPact mx 10jul11
//////...mas arrays 2 osciladores totalmente paneados
s.boot;
s.quit;
s.scope;
////
Tdef(\evals).play;
Tdef(\evals).stop;
//////
(
SynthDef(\tecladito,{|gate=1,nota,nota2|
var tim,env;
tim=FreeVerb.ar([LFTri.ar(nota.midicps,0,0.25), Pulse.ar(nota2.midicps,0.5,0.15)],0.75,0.9,0.1);
env=EnvGen.ar(Env.perc(0.01,2.5),gate,doneAction:2);
Out.ar(0,Pan2.ar(tim*env,[-0.05,0.05]))
}).add;
);
v=Array.newClear(3);
w=Array.newClear(3);
(
Tdef(\evals,{
var a,x,y,z;
var trans=Prand([12,5,0,0],inf).asStream;
var trans2=Prand([7,12,0,0],inf).asStream;
var tono=Prand([v,w] ,inf).asStream;
var tono2=Pxrand([w,v],inf).asStream;
var tiempo=Pseq([
Pwrand([0.25,0.5,1,2],[0.15,0.35,0.25,0.25],1),
Pwrand([0.25,0.5,1,2],[0.45,0.35,0.15,0.05],1),
Pwrand([0.25,0.5,1,2],[0.45,0.25,0.25,0.05],1),
Pseq([0.25,0.25,0.25,0.25],2)
],inf).asStream;
inf.do{
x=[0,1].choose;
y=x+1;//1,2
z=2;
a=x+y+z;//3,4
if(y==z,{//
v.put(0,[61,64].choose-trans.next);//[61,64,68,72,73,74]c#maj7m9
w.put(0,[74,73].choose+trans2.next);
},
{
v.put(0,[64,68].choose+trans2.next);//
w.put(0,[73,72].choose-trans.next);
});
if(a-1==z,{
v.put(1,[68,72].choose-trans.next);//
w.put(1,[72,68].choose+trans2.next);
},
{
v.put(1,[72,73].choose+trans2.next);//
w.put(1,[68,64].choose-trans.next);
});
if(a-1==(a-y),{
v.put(2,[73,74].choose-trans.next);//
w.put(2,[64,61].choose+trans2.next);
},
{
v.put(2,[74,76].choose+trans2.next);//
w.put(2,[76,61].choose-trans.next);
});
t=Synth(\tecladito);
t.set(\nota,tono.next);
t.set(\nota,tono2.next);
//v.postln;
w.postln;
tiempo.next.wait;
}
});
)
//////
s.record;
s.stopRecording;

reproducir muestra

descargar código

hp-11jul11-JCHasbun

10 Julio 2011

//código SuperCollider

///////////hackpact mx #10jul11
////////////...subass and drums!
s.boot;
s.quit;
s.scope;
////
TempoClock.default.tempo=95/60;
///////
p=ProxySpace.push(s);
p.fadeTime=0.01;
/////////
~out.play;
/////kick
~kk={|t_trig=0,amp=0.15|Limiter.ar(RHPF.ar(EnvGen.ar(Env.perc(0.01,0.5),t_trig) *LFTri.ar(Pulse.ar(1,0.1,60,60),0.4,amp) +LFTri.ar(Pulse.ar(1,0.5,60,62),0,amp),90,0.25),0.5)}; //basskick abierto
~kk={|t_trig=0,amp=0.15|Limiter.ar(EnvGen.ar(Env.perc(0.01,0.25),t_trig) *LFTri.ar(Pulse.ar(4,0.5,60,60),0.4,amp),0.75)};
(
Tdef(\kicksec,{
var ampp=Pseq([
Pseq([0.75,0,0.5,0.5],1),
Pseq([0.65,0,0,0.5],1),
Pseq([0.75,0,0.5,0],1),
Pseq([0.5,0,0,0.5],1)
],inf).asStream;
var weit=Prand([
Prand([0.5,0.25,0.75,1],1),
Pseq([0.5,0.5,0.75,0.25],2)
],inf).asStream;
inf.do{
~kk.set(\t_trig,1);
~kk.set(\amp,ampp.next);
weit.next.wait;
}}
);
);
//tarola
(
~tar={|t_trig=0,amp=0.45,ancho=0.5,rel=0.1|
EnvGen.kr(Env.perc(0.01,rel),t_trig)*
RLPF.ar(Pulse.ar(Mix(880,2000,6000,12000),ancho,amp)*
WhiteNoise.ar(amp),6200,0.25)}
);
(
Tdef(\tarsec,{
a=Pseq([0,0.5,0,0.5],inf).asStream;
t=Pseq([
Pseq([0.25,0.5,0.25,0.5],2),
Pseq([0.25,0.25,0.25,0.25],4),
Pseq([0.75,0.25,0.5,0.5],2),
Pseq([0.5,0.25,0.75,0.5],2)],inf).asStream;
inf.do{
~tar.set(\t_trig,1);
~tar.set(\amp,a.next);
~tar.set(\rel,wchoose([0.1,0.15,0.25,0.5,0.75],[0.2,0.38,0.2,0.2,0.02]));
t.next.wait;
}}
)
);
~tarev={FreeVerb.ar(~tar.ar,0.3,0.9,0.01,1.1)};
~tardel={CombC.ar(~tar.ar,0.5,0.125,0.5,0.95)};
////hihats
~hh={|t_trig|EnvGen.ar(Env.perc(0.01,0.05),t_trig) *RHPF.ar(WhiteNoise.ar(0.1),6000,0.1)};
(
Tdef(\hhsec,{
u=Pseq([
Pseq([0.25,0.5,0.25,0.5],2),
Pseq([0.25,0.25,0.25,0.25],2),
Pseq([0.75,0.25,0.5,0.5],2),
Pseq([0.5,0.25,0.75,0.5],2)],inf).asStream;
q=Prand([0.05,0.02,0.08,0.04],inf).asStream;
inf.do{
~hh.set(\t_trig,1);
~hhdel.set(\delt,q.next);
u.next.wait;
}}
)
);
~hhdel={|delt=0.1|CombC.ar(~hh.ar,0.05,delt,0.55)};

~bass={|t_trig,nota,cutf|RLPF.ar(EnvGen.ar(Env.asr(0.01,2,1),t_trig) *SinOsc.ar([nota.midicps,nota.midicps+2],0,0.25) +LFTri.ar([nota.midicps,nota.midicps+2],0.2,0.25),cutf,0.2)};
(
Tdef(\basssec,{
var ton=Pxrand([61,68,66,56]-24,inf).asStream;
var cuthz=Pseq([610,440,660,2200,660,3200,665,6400],inf).asStream;
var tontime=Pseq([
Pseq([2,0.5,1,0.5],2),
Pseq([2,0.5,0.5,0.25,0.25],2)
],inf).asStream;
inf.do{
~bass.set(\t_trig,1);
~bass.set(\nota,ton.next);
~bass.set(\cutf, cuthz.next.value.postln);
tontime.next.wait;
}}
)
);
(
Tdef(\tarsec).play;
//Tdef(\tarsec).stop;
Tdef(\hhsec).play;
//Tdef(\hhsec).stop;
Tdef(\kicksec).play;
//Tdef(\kicksec).stop;
Tdef(\basssec).play;
//Tdef(\basssec).stop;
)

///////////////////
~out=o;
~out=~bass+~kk+~tarev+~hh;
~out=~bass+~kk+~tarev+~hh+~tar;
~out=~bass+~kk+~tarev+~hh+~tar+~hhdel;
~out=~kk+~tardel+~hhdel+~tarev;
~out=0
/////
s.meter
s.record;
s.stopRecording;

reproducir muestra

descargar código

hp-10jul11-JCHasbun

9 Julio 2011

//código SuperCollider

/////////////hackPact mx #09jul11
//////////// choose 0 o 1 !????
s.boot
s.quit
s.scope
//////
p=ProxySpace.push(s);
//p.pop;
p.fadeTime=0.01;
/////
(
~amb.play;
~drums.play;
)
(
~bombolow={|t_trig=0|
FreeVerb.ar(
EnvGen.ar(Env.perc(0.01,0.15),t_trig)*
(SinOsc.ar(Saw.kr(4,0.5,85,220),0,0.85)+Pulse.ar(60,0.5,0.2))*Saw.ar(60)
,0.3,0.9,0.01)
}
);
(
~sint={|t_trig=0,frec=61,amp=0.05,ffreq=270,trans,trans1|
FreeVerb.ar(
RLPF.ar(
EnvGen.ar(Env.perc(0.02,0.1),t_trig)*
(Pulse.ar(trans1+frec.midicps/2,0.5,amp+0.03)+
Pulse.ar(trans+frec.midicps,0.1,amp)*
Saw.ar(trans1+frec.midicps*2,0.1,amp -4)),
ffreq ,0.3)
,0.5,0.95,0.01)
}
);
(
Tdef(\tsint,{
inf.do{
~sint.set(\t_trig,1);
~bombolow.set(\t_trig,1);
~sint.set(\frec,[61,66,70,73,75,78,82,85,90].choose);
~sint.set(\ffreq,[45,190,327,478,663,1071,1541,2000].choose);
~sint.set(\trans,[0,7].choose);
~sint.set(\trans1,[3,7,11].choose);
[0.25,0.5,0.75,1].choose.wait;
}}
)
);
~tarola={|t_trig=0,amp|EnvGen.ar(Env.perc(0.02,0.2), t_trig) *RLPF.ar(WhiteNoise.ar(amp),3200,0.75)};
~bomb={|t_trig=0,amp|EnvGen.ar(Env.perc(0.005,0.3), t_trig) *SinOsc.ar(Pulse.ar(2,0.15,60,92),0,amp)};
(
~contras={|amp|EnvGen.ar(Env.perc(0.01,0.08), Demand.kr(Impulse.kr(Demand.kr(Impulse.kr(1),0,Dseq([8,4,12,6],inf))),
0,Dseq([0,1],inf)))*FreeVerb.ar(RHPF.ar(WhiteNoise.ar(amp-0.025),2900,0.5),
0.9,0.95,0.01,1.2)};
)
(//ritmo
Tdef(\tsint2,{
inf.do{
var x=0,num=[0,1].choose;
if(num.value.postln==x,{~bomb.set(\t_trig,1);
~bomb.set(\amp,[0.5,0.4].choose);
},
{~tarola.set(\t_trig,1);
~tarola.set(\amp,[0.4,0.25].choose);
});
~contras.set(\amp,[0.1,0.05].choose);
0.25.wait;
}}
)
)
Tdef(\tsint).play;
Tdef(\tsint2).play;
Tdef(\tsint).stop;
Tdef(\tsint2).stop;
//~out=~sint+~bombolow
~drums=0//=~bomb+~tarola;
~drums=~contras;
~drums=~bomb+~tarola+~contras;
~amb=~bombolow;
~amb=~sint;
~amb=~sint+~bombolow;

s.record;
s.stopRecording;

reproducir muestra

descargar código

hp-9ul11-JCHasbun

8 Julio 2011

//código SuperCollider

///////////// hackPactMx #08jul11
/////////// ...un oscilador a traves de un TGrains y un chingo de reverb!!!
s.boot;
s.quit;
//s.makeWindow;
s.scope;
/////

b=Buffer.alloc(s, s.sampleRate * 8, 1);

b.plot

//b.free
(//tod0****
(//esta funcion no se escucha solo se graba

~osciladores = {|gate=1,vol=0.5,d=4|

var os,env;

os=SinOsc.kr+Pulse.ar(LFNoise0.ar(d,33.midicps,69.midicps),mul:0.35);

os=RecordBuf.ar(os,b,0,1);
os=GVerb.ar(os,1,1,0.75,mul:0.5);

env=EnvGen.ar(Env.asr(0.01,0.98,0.01),gate,doneAction: 2);

Out.ar(30,Pan2.ar(os*env,[1, -1])* vol)

}.play

);

(//granuloides

~granos={|vol=0.15,vel=2,d=2,revtim=2,rat=1|

var granus,dur,trate;
trate=MouseX.kr(0.01,8).poll;
dur=d/trate;

granus=TGrains.ar(2,Dust.kr(trate),b,
Linen.kr(Impulse.kr(vel*MouseY.kr(0.01,2).poll),0.01,1,1),0,dur,0.5);

granus=PitchShift.ar(granus,0.2,rat);
granus=GVerb.ar(granus,2,revtim,0.5,mul:0.5);

Out.ar(0,Normalizer.ar(Pan2.ar(granus,[1, -1]),vol));

};

);
(//secs
Tdef(\cambios,{
var velocidad=Pxrand([0.5,1,2],inf).asStream;
var de=Prand([1,2,4],inf).asStream;
//var terate=Pxrand([2,3,4],inf).asStream;
var windowsize1=Prand([0.1,0.5,0.9],inf).asStream;
var revt=Pwrand([1,3,4,2],[0.65,0.05,0.05,0.15],inf).asStream;
var orate=Pwrand([0.5,1,2,3],[0.45,0.25,0.05,0.15],inf).asStream;
~granos.play;
inf.do{
~granos.set(\vel,velocidad.next);
~granos.set(\revtim,revt.next);
//~granos.set(\trate,terate.next);
~granos.set(\d,de.next);
~granos.set(\rat,orate.next.value.postln);
~osciladores.set(\d,de.next.value.postln);
1.wait;
}
});
);
);
Tdef(\cambios).play;//no para;
s.record;
s.stopRecording;

reproducir muestra

descargar código

hp-8jul11-JCHasbun

7 Julio 2011

//código SuperCollider

//////hackPact mx 07jul11
////////// ...pinche crudota!
////////// ...un poco de techno!
s.boot;
//s.quit;
s.scope;
/////////
p=ProxySpace.push(s);
p.fadeTime=0.01;
////
~o.play
////kickDrum
~kick={|t_trig,amp|EnvGen.ar(Env.perc(0.01,0.15),t_trig) *SinOsc.ar(Pulse.ar(2,0.1,60,93),0,amp)};
(
Tdef(\kicksec,{
var kickacc=Pseq([0.95,0.75,0.9,0.7],inf).asStream;
inf.do{
~kick.set(\t_trig,1);
~kick.set(\amp,0.3-kickacc.next);
0.5.wait;
}
})
);
///////basses
~dirtbassy={|t_trig,bfilt,nota|RLPF.ar(EnvGen.ar(Env.perc(0.02,0.85) ,t_trig)*LFPulse.ar(nota.midicps,0.5,0.15),bfilt,0.4)*LFNoise1.ar(4,0.4)};
~bassy={|t_trig,nota|EnvGen.ar(Env.perc(0.01,0.85),t_trig) *LFTri.ar(nota.midicps,0,0.25)*Saw.ar(nota.midicps,0.35,0.75)};
(
Tdef(\bassec,{
var bassfilt=Pseq([120,240,480,960,1920],inf).asStream;
var bassnote=Pwrand([60,67,63,72]-24,[0.3,0.3,0.3,0.1],inf).asStream;
inf.do{
~bassy.set(\t_trig,1);
~bassy.set(\nota,bassnote.next);
~dirtbassy.set(\t_trig,1);
~dirtbassy.set(\nota,bassnote.next);
~dirtbassy.set(\bfilt,bassfilt.next);
0.25.wait;
}
})
);
//////hihats
~contras={|t_trig|EnvGen.ar(Env.perc(0.01,0.1),t_trig) *HPF.ar(WhiteNoise.ar(0.25),5600,0.25)};
(
Tdef(\contrasec,{
var contrasTime=Pwrand([0.125,0.25,0.5,1],[0.45,0.35,0.15,0.05],inf).asStream;
inf.do{
~contras.set(\t_trig,1);
contrasTime.next.wait;
}
})
);
/////snare
~tarola={|t_trig,amp|EnvGen.ar(Env.perc(0.01,0.2),t_trig) *LPF.ar(GrayNoise.ar(amp),6600,0.45)};
(
Tdef(\tarolasec,{
var tarolAmp=Pseq([Pseq([0,0.5]),Pseq([0,0.5]),Pseq([0,0.5]) ,Pseq([0,0.35,0.45,0.5])],inf).asStream;
var taroltime=Pseq([0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5 ,Pseq([0.5,0.125,0.125,0.125,0.125])],inf).asStream;
inf.do{
~tarola.set(\t_trig,1);
~tarola.set(\amp,tarolAmp.next);
taroltime.next.wait;
}
})
);
//////synths
~sinte={|t_trig,nota,sfilt|RLPF.ar(EnvGen.ar(Env.perc(0.02,0.85),t_trig) *Pulse.ar(nota.midicps+LFNoise2.kr(nota.midicps,0.25,60,120),0.5,0.15) *Pulse.ar(12-nota.midicps,0.5,0.5),sfilt,0.05)};
(
Tdef(\synthsec,{
var synthfilt=Pxrand([120,240,480,960,1920],inf).asStream;
var synthnote=Pwrand([60,67,63,72]-12,[0.3,0.3,0.3,0.1],inf).asStream;
inf.do{
~sinte.set(\t_trig,1);
~sinte.set(\nota,synthnote.next);
~sinte.set(\sfilt,synthfilt.next);
0.125.wait;
}
})
);
(//secs play primero...
Tdef(\bassec).play;
Tdef(\kicksec).play;
Tdef(\contrasec).play;
Tdef(\tarolasec).play;
Tdef(\synthsec).play;
);
////orden de la grabacion...
~o=~kick;
~o=~kick+~dirtbassy;
~o=~kick+~dirtbassy+~contras;
~o=~kick+~bassy+~contras;
~o=~kick+~dirtbassy+~bassy+~contras+~tarola;
~o=~kick+~sinte;
~o=~kick+~sinte+~bassy+~contras+~tarola;
~o=~kick+~dirtbassy+~bassy+~contras+~tarola+~sinte;
~o=~kick+~bassy+~contras+~tarola+~sinte;
~o=~kick+~bassy+~contras+~sinte;
~o=~kick+~contras+~sinte;
~o=~kick+~sinte;
~o=~sinte;
~o=0;
///////
s.record;
s.stopRecording;

reproducir muestra

descargar código

hp-7jul11-JCHasbun

6 Julio 2011

//código SuperCollider

///////////hackPact mx #06jul11
///////////////////////////****elCyberlofono
s.boot;
s.quit;
s.meter;
(///////
TempoClock.default.tempo=75/60;
(
SynthDef(\cyberlofono,{|gate=1,out,rel,nota,nota1,rtime,rdamp,amp|
var tec,env;
tec=SinOsc.ar(nota.midicps,0,amp)*LFTri.ar(nota1.midicps,0,amp);
tec=GVerb.ar(tec,6,rtime,rdamp);
env=EnvGen.ar(Env.perc(0.075,rel),gate,doneAction:2);
Out.ar(out,Pan2.ar(tec*env,[-0.25,0.75]))
}).add;
);
);
(//secs...
(
a=Pdef(\secs,(
Pbind(\instrument, \cyberlofono,///bajos
\dur, Pwrand([0.25,1,0.5,2],[0.26,0.38,0.16,0.16],inf),
\nota, Pwrand([51,56,59,62,63]-12,[0.2,0.2,0.2,0.2,0.2],inf),//[eb,ab,cb,d,eb]
\rel, 0.5,
\amp, 0.5,
\out, 0
)
))
);
(
b=Pdef(\secsuno,(
Pbind(\instrument, \cyberlofono,///tenor
\dur, Pshuf([0.25,0.75,1,4],inf),
\nota1, Pwrand([51,53,56,58,62,63],[0.16,0.16,0.16,0.16,0.16,0.16],inf),//[eb,f#,ab,bb,d,eb]
\rel, Pxrand([0.75,1,2],inf),
\rtime, 3,
\rdamp, 0.7,
\amp, Pseq([0.35,0.25,0.3,0.2],inf),
\out, 0
)
))
);
(
c=Pdef(\secsdos,(
Pbind(\instrument, \cyberlofono,///mezzo
\dur, Pshuf([0.5,0.25,0.75,2],inf),
\nota1, Pwrand([51,53,56,58,62,63]+7,[0.16,0.16,0.16,0.16,0.16,0.16],inf), //[eb,f#,Ab,Bb,cb,d,Eb]
\rel, Pxrand([0.5,1],inf),
\rtime, 4,
\rdamp, 0.1,
\amp, Pseq([0.25,0.15,0.2,0.12],inf),
\out, 0
)
))
);
(
d=Pdef(\secstres,(
Pbind(\instrument, \cyberlofono,///soprano
\dur, Pshuf([0.5,0.25,1],inf),
\nota1, Pwrand([51,56,58,62,63]+24,[0.2,0.2,0.2,0.2,0.2],inf), //[eb,ab,bb,d,eb]
\rel, Pxrand([0.25,1.2,2],inf),
\rtime, 8,
\rdamp, 0.1,
\amp, Pseq(0.05-[0.2,0.15,0.15,0.1],inf),
\out, 0
)
))
);
Pdef(\secs).play;
Pdef(\secsuno).play;
Pdef(\secsdos).play;
Pdef(\secstres).play;
);
////////
Pdef(\secs).stop;
Pdef(\secsuno).stop;
Pdef(\secsdos).stop;
Pdef(\secstres).stop;
s.record;
s.stopRecording;

reproducir muestra

descargar código

hp-06jul11-JCHasbun

5 Julio 2011

//código SuperCollider

//////////hackpact mx 05jul11
///////un array determinando las notas de los osciladores o churchOrgan
s.boot;
s.quit;
s.meter;
s.scope;
s.record;
s.stopRecording;
////////
(///<---evalua todo***
//array
~arr=Array.newClear(4);
(
SynthDef(\ambient,{|gate=1,nota=65,nota2=71,nota3=77,nota1=68,rel=0.8|
var osc,env;
osc=Mix(LFTri.ar(nota.midicps,0.2,0.095)+Saw.ar(nota1.midicps,0.4,0.071),
SinOsc.ar(nota2.midicps,-0.2,0.08)+Pulse.ar(nota3.midicps,0.5,0.061));
env=EnvGen.ar(Env.perc(0.25,rel),gate,doneAction:2);
Out.ar(30,Normalizer.ar(Pan2.ar(osc,env,[-0.92,1]),0.25));
}).add;
);
(
SynthDef(\reverb,{|gate=1,amp=0.5|
var fx,env;
fx=In.ar(30);
fx=FreeVerb.ar(fx,0.75,1,0.051);
env=EnvGen.ar(Env.asr(0.01,0.98,0.01),gate,doneAction:2);
Out.ar(0,Pan2.ar(fx*env,[-0.9,0.85])*amp);
}).add
);
/////secuencias para q las variables cambien de valor
(
z=Prand([0.2,0.8],inf).asStream;
h=Pxrand([1,2,3],inf).asStream;
k=Prand([1,3],inf).asStream;
u=Pwrand([0.25,0.5,1],[0.13,0.33,0.53],inf).asStream;
~b=Tdef(\arrbient,{
inf.do{
var x,y;
x=1;
y=[0.5,1,0.25].choose+z.next.value.postln;
if(y<=x,
{~arr.put(0,[65,72,54,58].choose)},//f#,c//siempre al primer slot[0]
{~arr.put(k.next.value,[68,76].choose-24)});//3m y 7m
if(y>=x,
{~arr.put(h.next.value,[68,72,76,78].choose-12)},
{~arr.put(k.next.value,[70,70,63].choose-24)});
~arr.postln;
u.next.wait;
}
});
);
//////secuencia de los argumentos del sinte
(
t=Pwrand([0.25,0.5,1],[0.13,0.53,0.33],inf).asStream;
r=Pwrand([0.35,0.5,0.75],[0.2,0.25,0.55],inf).asStream;
~c=Tdef(\secbient,{
inf.do{
Synth(\ambient,[\nota,~arr[0],\nota1,~arr[1],\nota2,~arr[2],\nota3,~arr[3],\rel,r.next]);
~b.play;//llena el array
t.next.wait;
}
})
);
);
(//tocaTodo
Synth(\reverb);
~c.play
)
~c.stop
//~arr.free
////////////

reproducir muestra

descargar código

hp-05jul11-JCHasbun

4 Julio 2011

//código SuperCollider

/////hackpact mx #04jul11;
//////ambienteDeMetalCromatico///
s.boot;
s.quit;
s.scope;
FreqScope.new;
/////////////
p=ProxySpace.push(s);
p.fadeTime=0.5;
//p.pop
(//<---todo***
(
~metal={|nota=61,t_trig=0,left=1,right=0.85,cutf=1600|
Limiter.ar(
Pan2.ar(
FreeVerb.ar(
EnvGen.ar(Env.perc(0.01,0.5),t_trig)*
GVerb.ar(
BPF.ar((LFTri.ar(nota.midicps,0,0.005)*
Pulse.ar(12-nota.midicps,0.4,0.075)+
VarSaw.ar(12+nota.midicps,0,0.5,0.1)+
LFPulse.ar(Pulse.ar(24-nota.midicps
,0.5,nota.midicps,
nota.midicps+
60),0.5,0.05)
),
cutf,0.35),
2,3,0.075,mul:0.75),
0.35,0.95,0.05,0.9),
[left,right]),
0.9)
};
);
(
n=Pseq([
Pseq([61,62,63,64,65,66,67,68,69,70,71,72,73],2),
Prand([61,62,63,64,65,66,67,68,69,70,71,72,73],2),
Prand([61,62,63,64,65,66,67,68,69,70,71,72,73]- 12,2)
],inf).asStream;
l=Pseq([-1,-0.8,-0.6,-0.4,-0.2,-0,-0.2,-0.4,-0.6,-0.8,-1],inf).asStream;
r=Pseq([0,0.2,0.4,0.6,0.8,1,1,0.8,0.6,0.4,0.2],inf).asStream;
v=Prand([900,1200,1600,2200,6000,10200],inf).asStream;
t=Pxrand([
Pseq([4,2],1),
Pseq([1,2],2),
Pseq([0.5,0.5],2),
Pseq([0.25,0.25],4),
Pseq([0.125,0.125],4),
Pseq([0.0625,0.0625],2),
Pseq([0.03125,0.03125],4)
],inf).asStream;
Tdef(\arpa,{
inf.do{
~metal.play;
~metal.set(\t_trig,1);
~metal.set(\nota,n.next);
~metal.set(\left,l.next.value.postln);
~metal.set(\right,r.next.value.postln);
~metal.set(\cutf,v.next);
t.next.wait;
}
})
).play;
);
////////para parar:
Tdef(\arpa).stop;
///////////
s.record;
s.stopRecording;

reproducir muestra

descargar código

hp-4jul11-JCHasbun

3 Julio 2011

//código SuperCollider

////hackpact mx #03jul11
///.....................una basesita cagada
s.boot;
s.scope;
s.meter;
/////
(//<------evalua todo de una vez*****
TempoClock.default.tempo=58/60;
(///timbres
(
SynthDef(\bass,{|out,gate=1,amp,nota|
var vas,env;
vas=GVerb.ar(RLPF.ar((SinOsc.ar(nota.midicps,mul:0.75)+
Pulse.ar(2+nota.cpsmidi,mul:0.45))*
SinOsc.ar(nota.midicps)*
Pulse.ar(2+nota.cpsmidi),
Line.kr(12000,40,0.4),0.25),
7,1,0.01);
env=EnvGen.ar(Env.asr(0.05,1,0.1),gate,doneAction:2);
Out.ar(out,Pan2.ar(vas*env,[1,-1])*amp);
}).add
);
(
SynthDef(\bombo,{|out,gate=1,amp|
var kick,env;
kick=SinOsc.ar(60)+Saw.ar(Pulse.ar(2,0.3,60,75));
env=EnvGen.ar(Env.perc(0.01,0.3),gate,doneAction:2);
Out.ar(out,Pan2.ar(kick*env,[0.95,-1])*amp);
}).add
);
(
SynthDef(\tarola,{|out,gate=1,amp,deltime|
var tar,env;
tar=BPF.ar(Saw.ar([440,880,1600,3200],mul:0.5)+WhiteNoise.ar(0.85),2040,0.75);
tar=CombC.ar(tar,0.5,deltime,0.5);
env=EnvGen.ar(Env.perc(0.01,0.25),gate,doneAction:2);
Out.ar(out,Pan2.ar(tar*env,[0.75,-0.75])*amp);
}).add
);
(
SynthDef(\hhts,{|out,gate=1,amp|
var hats,env;
hats=RHPF.ar(WhiteNoise.ar(0.25),2000,0.25);
hats=CombC.ar(hats,0.5,0.02,4);
env=EnvGen.ar(Env.perc(0.025,0.05),gate,doneAction:2);
Out.ar(out,Pan2.ar(hats*env,[1,-1])*amp);
}).add
);
);
(////////secuencias
(
Pdef(\bassec,(
Pbind(\instrument, \bass,
\dur, Pxrand([Pseq([0.25,0.25,0.5,0.75,0.25],1),
Pseq([0.5,0.5,0.25,0.75],1),
Pseq([0.75,0.25,1],1),
Pseq([0.75,0.5,0.25,0.5],1)],inf),
\nota, Prand([61,66,70,73,78]-24,inf),
\amp, Pseq([0.25,0],inf),
\out, 0
)
))
);
(
Pdef(\bombsec,(
Pbind(\instrument, \bombo,
\dur, Pxrand([Pseq([0.25,0.25,0.5,0.75,0.25],1),
Pseq([0.5,0.5,0.25,0.75],1),
Pseq([0.75,0.25,1],1),
Pseq([0.75,0.5,0.25,0.5],1)],inf),
\amp, Pseq([0.65,0],inf),
\out, 0
)
))
);
(
Pdef(\tarsec,(
Pbind(\instrument, \tarola,
\dur, Pseq([Pseq([0.5,0.5,0.75,0.25],2),
Pseq([0.5,0.5,0.5,0.125,0.125,0.25],2),
Pseq([0.5,0.5,0.5,0.5],2),
Pseq([0.5,0.5,0.5,0.125,0.125,0.125,0.125],2)],inf),
\amp, Pseq([0,0.75],inf),
\deltime, Pwrand([0,0.02,0.04,0.05,0.075,0.08,0.01],[0.3,0.17,0.19,0.05,0.03,0.01,0.15],inf),
\out, 0
)
))
);
(
Pdef(\hatsec,(
Pbind(\instrument, \hhts,
\dur, Pseq([Pseq([0.125,0.125,0.25,0.25,0.25],4),
Pseq([0.5,0.25,0.25,0.125,0.125,0.25,0.5],4),
Pseq([0.5,0.125,0.5,0.125,0.25,0.25],4),
Pseq([0.125,0.125,0.125,0.125,0.125,0.125,0.125,0.125],1)],inf),
\amp, 0.25,
\out, 0
)
))
);
);
);
/////controles
(//todos a la vez
Pdef(\bassec).play;
Pdef(\bombsec).play;
Pdef(\tarsec).play;
Pdef(\hatsec).play;
);
Pdef(\bassec).stop;
Pdef(\bombsec).stop;
Pdef(\tarsec).stop;
Pdef(\hatsec).stop;
///
s.record
s.stopRecording

reproducir muestra

descargar código

hp-3jul11-JCHasbun

2 Julio 2011

//código SuperCollider

////////hackpact mx 02jul11
s.boot
s.quit
s.scope
FreqScope.new
/////
p=ProxySpace.push(s)
p.fadeTime=5//1
/////
~o.play

~melodia={|t_trig=0,frec=60|EnvGen.ar(Env.perc(0.05,0.25),t_trig) *SinOsc.ar(frec.midicps,0,0.7)*Saw.ar(frec.midicps,add:0.5)};
~rev={FreeVerb.ar(~melodia.ar,0.65,0.9,0.01)};
~frev={|ffrq=2000|RLPF.ar(~rev.ar,ffrq,0.1)};
~vverb={|vtime=3|Limiter.ar(GVerb.ar(~frev.ar,8,vtime,0.8),0.75)};

~melodia2={|t_trig=0,frec=60|EnvGen.ar(Env.perc(0.01,0.49),t_trig) *Pulse.ar(frec.midicps,0.4,0.5)*Saw.ar(frec.midicps,add:0.5)};
~del={|delt=0.25|CombL.ar(~melodia2.ar,1,delt,4)};
//////
(
g=Pxrand([2,4,7,7.5,8],inf).asStream;
f=Prand([520,730,160,3200,6400],inf).asStream;
t=Pseq([0.5,0.25,0.75,0.5,0.5,0.75,0.25],inf).asStream;
Tdef(\melsec,{
inf.do{
~melodia.set(\t_trig,1);
~melodia.set(\frec,[3,7].choose+[60,63,65,69,71,72,74].choose);
~frev.set(\ffrq,f.next);
~vverb.set(\vtime,g.next);
t.next.wait;
}}
)
);
(
d=Prand([0.0625,0.125,0.25,0.5],inf).asStream;
Tdef(\melsec2,{
inf.do{
~melodia2.set(\t_trig,1);
~melodia2.set(\frec,[60,63,65,69,71,72].choose/[1.25,1.5,2].choose);
~del.set(\delt,d.next);
[1,0.5].choose.wait;
}}
)
)
Tdef(\melsec).play;
Tdef(\melsec2).play;
//////
~o=~frev;
~o=~vverb+~frev;
~o=~rev;
~o=~rev+~vverb
~o=~del+~rev
~o=~del+~rev+~vverb
~o=~vverb
~o=0;
////////////
s.record;
s.stopRecording;

reproducir muestra

descargar código

hp-2jul11-JCHasbun

1 Julio 2011

//código SuperCollider

s.boot;

s.quit;

s.scope;

s.makeWindow;

/////////////////

Tdef(\secuencia).play;

Tdef(\secuencia).stop;

//////////////////////////////cuatro osciladores[sin,saw,tri,pulse]

~a=Array.newClear(4);//se llena de sintes aleatorios

(//selecciona todos los sintes

(//master

~x = SynthDef(\fx,{|gate=1,time=5,damp=0.01,amp=0.5|

var efx,env;

efx=In.ar(30);

efx=GVerb.ar(efx,20,time,[0.01,0.05,0.1,0.25].choose.postln);

env=EnvGen.ar(Env.asr(0.01,0.98,0.01),gate,doneAction:2);

Out.ar(0,Pan2.ar(efx*env,[0.75,-0.8])*amp)

}).add;

);

~uno=(SynthDef(\sin,{|gate=1|Out.ar(30,EnvGen.ar( Env.perc(0.01,0.98),gate,doneAction:2)*SinOsc.ar([80,120],0,0.5))}).add);

~dos=(SynthDef(\saw,{|gate=1|Out.ar(30,EnvGen.ar( Env.perc(0.01,0.98),gate,doneAction:2)*Saw.ar([160,240],0.4,0.25))}).add);

~tres=(SynthDef(\tri,{|gate=1|Out.ar(30,EnvGen.ar( Env.perc(0.01,0.98),gate,doneAction:2)*LFTri.ar([320,480],0,0.25))}).add);

~cuatro=(SynthDef(\pul,{|gate=1|Out.ar(30,EnvGen.ar( Env.perc(0.01,0.98),gate,doneAction:2)*Pulse.ar([640,960],0.3,0.15))}).add);

Synth(\fx);

);

(//secs

v=Pxrand([~uno,~dos,~tres,~cuatro],inf).asStream;

n=Pseq( [60,64,67,71,72].midicps-12,inf).asStream;

t=Pwrand([0.2,0.4,0.8,1.6],[0.55,0.35,0.15,0.05],inf).asStream;

Tdef(\secuencia,{

inf.do{

~a.put([0,1,2,3].choose,v.next.value);

~a[3].play.postln;

t.next.wait;

}

})

);

Tdef(\secuencia).play;

Tdef(\secuencia).stop;

///////////////notas

~a.play

///////////////

reproducir muestra