Hackpact.Mx

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

Jaime Lobato

20 Julio 2011
   
19 Julio 2011
   
18 Julio 2011
   
17 Julio 2011
   
16 Julio 2011
   
15 Julio 2011
   
14 Julio 2011
   
13 Julio 2011
   
12 Julio 2011

//código Processing

/*
CHORI PIPILOTTI RIST
I'M NOT THE BOY WHO LIVE CODE MUCH
*/

import processing.video.*;

Capture myCapture;
int ancho = screen.width;
int largo = screen.height-100;
float x;
float y;
int ultimoseg = 0;
float velX = 1.5;
int dirX = 1;
float velY = 1.0;
int dirY = 1;
color entintado;

void setup() {
size(ancho, largo);
myCapture = new Capture(this, 640, 480, 30);
smooth();
}

 

void captureEvent(Capture myCapture) {
myCapture.read();
}

void draw() {
noStroke();
fill(0, 0);
rect(0, 0, width, height);

x = x + (velX * dirX);
if (x > ancho - 640) {
dirX = -1;
} else if(x <= 0){
dirX = 1;
}

y = y + (velY * dirY);
if (y > largo - 480) {
dirY = -1;
} else if(y <= 0){
dirY = 1;
}

int s = second();
if(s != ultimoseg) {
entintado = color(random(255), random(255), random(255));
velX = random(3.0);
velY = random(2.7);
ultimoseg = s;
}



float alfalfa = map(mouseY, 0, largo, 255, 0);
tint(entintado, alfalfa);
image(myCapture, x, y);
}

 
11 Julio 2011

//código Processing

/*
ANTIECLIPSE LUNAR PLATONICO
*/

void setup(){
size(150, 100, P3D);
background(0);
noStroke();
}

void draw() {
pointLight(random(255), random(255), random(255), mouseY, 40, mouseX);
translate(80, 50, 0);
sphere(30);
}

 
10 Julio 2011

//código SuperCollider

//LO ESTAMOS PERDIENDO DOC

p=ProxySpace.push(s.boot)

//PASO 1

~al={Dust.ar(1)}
~miocardio={Pulse.ar(0.4)}
~infarto={Pan2.ar(SinOsc.ar(Peak.ar(~al.ar, ~miocardio.ar)*500 + 200, 0, 0.2), 0)}

//PASO 2

~al={Dust.ar(MouseX.kr(0.5, 60))}
~miocardio={Pulse.ar(10)}
~infarto={Pan2.ar(SinOsc.ar(Peak.ar(~al.ar, ~miocardio.ar)*500 + 200, 0, 0.2), 0)}

//PASO 3

~al={Dust.ar(MouseX.kr(0.5, 60))}
~miocardio={Pulse.ar(0.4)}
~corazon={LFNoise2.kr(1).range(-0.3, -0.17)}
~abierto={LFNoise2.kr(1).range(0.17, 0.3)}
~infarto={Pan2.ar(Wrap.ar(SinOsc.ar(Peak.ar(~al.ar, ~miocardio.ar)*500 + 200, 0, 0.2), ~corazon.kr, ~abierto.kr), 0)}

//PASO 4

~al={Dust.ar(MouseX.kr(0.5, 60))}
~miocardio={Pulse.ar(1000)}
~corazon={LFNoise2.kr(1).range(-0.3, -0.17)}
~abierto={LFNoise2.kr(1).range(0.17, 0.3)}
~soplo={SinOsc.kr(MouseY.kr(0.01, 60), 0, 1)}
~infarto={Pan2.ar(Wrap.ar(SinOsc.ar(Peak.ar(~al.ar, ~miocardio.ar)*500 + 200, 0, 0.2), ~corazon.kr, ~abierto.kr), ~soplo.kr)}

~infarto.play
p.clear(2)

s.meter

 
9 Julio 2011

//código SuperCollider

//(C/M)AJITA DE BUSICA

//PASO 1

(
a=Pdef(\uno,
Pbind(
\midinote, Pseq([60, 64, 67, 81, 84, 72], inf),
\dur, Pseq([1], inf)
)
).play
)

//PASO 2

(
a=Pdef(\uno,
Pbind(
\midinote, Prand(Pseq([60, 64, 67, 81, 84, 72], inf).asStream.nextN(6), inf),
\dur, Pseq([1], inf)
)
).play
)

//PASO 3

(
a=Pdef(\uno,
Pbind(
\midinote, Prand(Pseq([60, 64, 67, 81, 84, 72], inf).asStream.nextN(6), inf),
\dur, Pseq([0.5, 0.25, 0.25, 0.5], inf)
)
).play
)

//PASO 4

(
a=Pdef(\uno,
Pbind(
\midinote, Prand(Pseq([60, 64, 67, 81, 84, 72], inf).asStream.nextN(6), inf),
\dur, Pxrand(Pseq([0.5, 0.25, 0.25, 0.5], inf).asStream.nextN(4), inf)
)
).play
)

//PASO 5

(
a=Pdef(\uno,
Pbind(
\midinote, Pxrand(Pseq([60, 64, 67, 81, 84, 72], inf).asStream.nextN(6), inf),
\dur, Pxrand(Pseq([0.5, 0.25, 0.125, 0.0625], inf).asStream.nextN(4), inf),
\amp, Pbeta(0.15, 0.05, 0.1, 0.1, inf)
)
).play
)

descargar código

09jaime

8 Julio 2011

//código SuperCollider

//TONALIDADES FIUSHAS

(
~un=Pdef(\triada1,
Pbind(
\octave, 5,
\degree, Pseq([0, 3, 5, 3, 0], inf),
\dur, Pseq([0.5, 0.1], inf)
)
).play
)

(
~do=Pdef(\triada2,
Pbind(
\octave, 4,
\degree, Pseq([0, 3, 5, 3, 0], inf),
\amp, Pseq([0.05], inf),
\dur, Pseq([0.1], inf)
)
).play
)

(
~tr=Pdef(\triada3,
Pbind(
\octave, 3,
\degree, Pseq([0, 4, 7, 4, 0], inf),
\amp, Pseq([0.25], inf),
\dur, Pseq([1, 1, 2, 3, 4, 5], inf)
)
).play
)

(
~un.stop;
~do.stop;
~tr.stop
)

descargar código

08jaime

7 Julio 2011

//código SuperCollider

//DODE-CACA-AFONICUS

(
a=Pdef(\uno,
Pbind(
\degree, Pxrand([0,1,2,3,4,5,6,7,8,9,10,11,12], inf),
\octave, 5,
\dur, Pseq([1, 0.1, 0.1, 1], inf)
)
).play
)

(
b=Pdef(\dos,
Pbind(
\degree, Pxrand([0,1,2,3,4,5,6,7,8,9,10,11,12], inf),
\octave, Pseq([4], inf),
\dur, Pseq([1, 0.5, 0.5], inf)
)
).play
)

(
a.stop;
b.stop
)

descargar código

07jaime

6 Julio 2011

//código Processing

*
SE NECESITA TENER INSTALADA LA LIBRERIA DE VISION COMPUTARIZADA
MOUSE Y CONTROLA LA PERMANENCIA DE LA IMAGEN

*/

import hypermedia.video.*;

OpenCV opencv;

void setup() {
size(screen.width, screen.height);
opencv = new OpenCV( this );
opencv.capture( screen.width, screen.height);
//noCursor();
}

void draw() {
noStroke();
fill(0, map(mouseY, 0, screen.height, 0, 255));
rect(0, 0, screen.width, screen.height);
opencv.read();
opencv.flip(OpenCV.FLIP_HORIZONTAL);
opencv.threshold(200);
opencv.absDiff();
Blob[] blobs = opencv.blobs( 10, width*height/2, 4, true );
for( int i=0; i<blobs.length; i++ ) {
stroke(60, 40);
fill(random(255),random(255),random(255),random(255));
beginShape();
for( int j=0; j<blobs[i].points.length; j++ ) {
vertex( blobs[i].points[j].x, blobs[i].points[j].y );
}
endShape();
}
}

 
5 Julio 2011

//código SuperCollider

//CAMPANARIO

p=ProxySpace.push(s.boot)

~krang={Pan2.ar(DynKlank.ar(`[[100, 600, 700, 4500, 5000], nil, [1, 1/2, 1/4, 1/6, 1/8]], Dust.ar(1, 0.005)), 0)}
~kran={CombL.ar(~krang.ar, 5, 0.01, 5)}
~kra={CombL.ar(~kran.ar, 1, 1, 1)}
~kr={Pan2.ar(DynKlank.ar(`[[300, 400, 3000, 4000, 6000], nil, [1, 1/2, 1/4, 1/6, 1/8]], ~kra.ar*0.01), 1)}
~k={Pan2.ar(CombL.ar(~kr.ar, 3,3,3), 1)}
~krang.play
~kran.play
~kra.play
~kr.play
~k.play

 
4 Julio 2011

//código SuperCollider

//PERPETUO-TUTO-MECANICA
(
SynthDef(\help_mdapiano, { |out=0, freq=440, gate=1,volume=0.1|
var son = MdaPiano.ar(freq, gate, release: 0.9, stereo: 0.3, sustain: 0);
DetectSilence.ar(son, 0.01, doneAction:2);
Out.ar(out, son * volume);
}).add;
)
Pbind(
\instrument,\help_mdapiano,
\dur,0.5,
\freq,Pseq(Array.fib(5,2,40),inf),
\octave,Pseq([2,2], inf)
).play

descargar código

04jaime

3 Julio 2011

//código SuperCollider

//GAUSITA

p=ProxySpace.push(s.boot)

~gauss={Pan2.ar(LFGauss.ar(1/MouseY.kr(5, 200), ~ancho.kr, MouseX.kr(0,2), Dust.kr(30)), ~pan.kr)}
~ancho={LFNoise0.kr(1).range(0.01, 0.0001)}
~pan={LFNoise2.kr(10)}
~gauss.play

descargar código

03jaime

2 Julio 2011

//código SuperCollider

//CHAN-EQUIS

p=ProxySpace.push(s.boot)

~chane={Pan2.ar(Gendy1.ar(2,3,minfreq:1, maxfreq:MouseX.kr(10,700), durscale:0.1, initCPs:10), 0)}
~chaneq={Resonz.ar(~chane.ar, MouseY.kr(50,1000), 0.1)}
~chanequ={CombN.ar(~chaneq.ar, 0.1, 0.1, 5, 0.6) * ~chanequis.kr}
~chanequis={EnvGen.kr(Env.linen(0.1*0.05, 0.1*0.9, 0.1*0.05), Dust.kr(MouseX.kr(0.01, 30)))}
~chanequ.play

descargar código

02jaime

1 Julio 2011

//código SuperCollider

//ATARI DE LAS DROGAS

p=ProxySpace.push(s.boot)

~atari={Pan2.ar(AY.ar(~ton1.kr, ~ton2.kr, ~ton3.kr, ~noise.kr, ~noiscon.kr, ~vol1.kr, ~vol2.kr, ~vol3.kr, chiptype:0), ~pan.kr) * ~granos.kr}
~pan={SinOsc.kr(20, 0, 1)}
~ton1={LFNoise0.kr(0.25).range(0, 1365)}
~ton2={LFNoise0.kr(0.5).range(1366, 2730)}
~ton3={LFNoise.kr(0.25).range(2731, 4095)}
~vol1={LFNoise0.kr(0.25).range(0, 15)}
~vol2={LFNoise0.kr(0.25).range(0, 15)}
~vol3={LFNoise0.kr(0.25).range(0, 15)}
~noise={LFNoise0.kr(1).range(0, 31)}
~noiscon={SinOsc.kr(Mix([0.001, 0.01, 0.1])).range(0, 32)}
~granos={EnvGen.kr(Env.linen(0.1*0.05, 0.1*0.9, 0.1*0.05), Dust.kr(MouseX.kr(0.01, 30)))}
~atari.play

descargar código

01jaime