Hackpact.Mx

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

Eduardo H Obieta

 
   
16 Julio 2011

//código SuperCollider

p=ProxySpace.push(s.boot)
p.fadeTime=8
~sal.play

~un={SinOsc.ar(Demand.ar(Impulse.ar(1),1, Drand([60,62],[64,66],[66,68]),inf),0,0.75) *LFPulse.ar(Demand.ar(Impulse.ar(1),1, Drand([1,2,3,1.5,2.5,3.5,4,5,10],inf))) *Saw.ar(MouseX.kr(20,400))*0.9};
~do={BPF.ar(WhiteNoise.ar(),500,500/1000,1) *LFPulse.ar(Demand.ar(LFPulse.ar(1),1,Dseq([2,1,4,1,2],inf)))};
~tr={LFTri.ar(SinOsc.ar(1,0,10,35),0.5,SinOsc.ar(1,0,0.25,0.75))};
~cua={SinOsc.ar(Demand.ar(Pulse.ar(1),1, Drand([60,62,64,66,68,70,72,74,76,78,80].midicps,inf)),0,0.15) *Pulse.ar(Demand.ar(Saw.ar(1),1,Drand([24,36,48],inf)),0.5,0.5) *LFSaw.ar(Demand.ar(Impulse.ar(1),1,Drand([[1.8,3],[2,5]],inf),0.5))};
~amb={BPF.ar(WhiteNoise.ar(),8000,10/8000,0.9) *LFPulse.ar(Demand.ar(LFPulse.ar(1),1,Dseq([4,3,2,1],inf)),0.5,0.5)};
~pul={Pulse.ar(Demand.ar(Impulse.ar(1),1, Drand([1,4,6],inf)),0.5,0.5) *LFSaw.ar(Demand.ar(Impulse.ar(1),1, Drand([2,4,6],inf)),0.5,0.5)*0.4};
~au={SinOsc.ar(SinOsc.ar(0.025,0,600,1240),0,0.075) *LFTri.ar(SinOsc.kr(0.25,0,4,8),0.5,0.5)};
~si={Saw.ar(SinOsc.kr(0.002,0,20,80),0.35) *Saw.ar(80) *LFPulse.ar(SinOsc.kr(0.001,0,20,22),0.5,0.5)};
~ira={Gendy2.ar(1,0.2,0.4,180,1600,0.5,0.2,40,8) *LFPulse.ar(Demand.ar(Impulse.ar(1),1, Dseq([8,4,8,16,8,4,8],inf)),0.5,0.35)*0.4};
~no={WhiteNoise.ar() *LFPulse.ar(Demand.ar(Impulse.ar(1),1, Drand([6,8,12,16,32,440],inf)))*0.05};

~sal=~ira

~sal=~amb+~cua+~pul+~au+~si
~sal=~amb+~cua+~pul+~au+~si+~ira+~no
~sal=~un+~do+~tr+~cua+~amb

p.fadeTime=10
~sal=0

reproducir muestra

descargar código

HackpactDay16

   
15 Julio 2011

This browser does not have a Java Plug-in.
Get the latest Java Plug-in here.

//código Processing

RelojRec rel;
RelojCir rel2;

void setup() {
smooth();
size(900, 900);
rel=new RelojRec();
rel2=new RelojCir();
}

void draw() {
fill(0, 100);
noStroke();
rect(0, 0, width, height);
rel.draw();
rel2.draw();
}

//class

class RelojCir {
SegMill segm;

RelojCir() {
segm = new SegMill();
}

void draw() {
strokeCap(SQUARE);
int s = second();
int m = minute();
int h = hour();

pushMatrix();
translate(width/2, height/2);
rotate(-PI/2);
// minutos/segundos
stroke(30,map(mouseX,0,width,0,255));
for (float i=0;i<12;i=i+1) {
rotate(PI/6);
line(230, 0, 270, 0);
}
//minutos/segundos
stroke(150,map(mouseX,0,width,0,255));
strokeWeight(0.75);
for (float i=0;i<60;i=i+1) {
rotate(PI/30);
line(260, 0, 270, 0);
}

segm.draw();

//segundo
pushMatrix();
strokeWeight(2);
rotate(map(millis(), 0, 59000, 0, (TWO_PI-(TWO_PI* -60))));
for (int i=0;i<45;i++) {
rotate(0.015);
stroke(255,map(mouseX,0,width,0,1+i*1.05));
line(0, 0, 260, 0);
}
popMatrix();

//minuitos
pushMatrix();
stroke(50,0,0,map(mouseX,0,width,0,255));
strokeWeight(6);
rotate(map(m, 0, 59, 0, TWO_PI-(TWO_PI/60)));
line(0, 0, 130, 0);
popMatrix();

//horas
pushMatrix();
stroke(50,0,0,map(mouseX,0,width,0,255));
strokeWeight(6);
rotate(map(h, 0, 11, 0, TWO_PI+(TWO_PI/12)));
line(0, 0, 100, 0);
popMatrix();

popMatrix();

println(s);
}
}

descargar código

hackpactDay15

14 Julio 2011

//código SuperCollider

ServerOptions.outDevices;
s.options.outDevice_(3)

p=ProxySpace.push(s.boot)
p.fadeTime=8

~sal.play

~tempo=128/60;
~tem1={Demand.ar(Impulse.ar(~tempo),1, Drand([1,2,3,4,6,8,12,16,32],inf))};

~un={SinOsc.ar(Demand.ar(Impulse.ar(~tem1), 1,Drand([[36,38],[38,40],[40,42]].midicps,inf))) *LFPulse.ar((Demand.ar(Impulse.ar(~tem1*0.5),1, Drand([2,4,8,16,32],inf))))*0.35};
~do={LFSaw.ar(Demand.ar(Saw.ar(~tempo*2), 1,Dseq([[100,120],[120,140],[140,160],[160,100]],inf))) *Pulse.ar(Demand.ar(Saw.ar(1),1, Drand([2,4,8,3],inf)))!2*0.025};
~tre={(Impulse.ar([150,160],0.5,0.35) *Pulse.ar(Demand.ar(Impulse.ar(~tempo), 1,Drand([2,4,6,8],inf)),0.5)) +BPF.ar(WhiteNoise.ar,1900,800/1000,0.05) *LFPulse.ar(~tempo*16)*0.5!2};

~cua={BPF.ar(WhiteNoise.ar,Demand.ar(Impulse.ar(1), 1,Drand([12000,10000,11000,8000],inf)),100/10000) *Pulse.ar(Demand.ar(Pulse.ar(1),1, Drand([1,2,3,4,5,6,7,8],inf)))*0.25};
~dest={(Gendy2.ar(3,1,0.5,0.2,440, 12000,0.6,0.4,12,2,1,1)) *LFPulse.ar(~tem1)*0.75!2}

~sal=~un
~sal=~do
~sal=~tre
~sal=~cua
~sal=~dest
~sal=~un+~do
~sal=~un+~do+~tre
~sal=~un+~do+~tre+~cua
~sal=~un+~do+~tre+~cua+~dest
~sal=~un+~dest+~tre
~sal=0

reproducir muestra

descargar código

HackpactDay14

13 Julio 2011

//código Fluxus

(self-test 1)

 
12 Julio 2011

//Ejercicio de mapping con Fluxus

Foto. @swablab

Foto. @swablab

//código Fluxus

(clear)
(blur 1)
;camara 01
(with-state
(viewport 0.44 0 0.27 0.17)
)
;camara 02
(define cam2 (build-camera))
(current-camera cam2)
(set-camera (mmul
(mtranslate (vector 0 0 -5))
(mrotate (vector 15 145 0))))
(viewport 0.01 0 0.06 1)

;otra cam
(define cam3 (build-camera))
(current-camera cam3)
(set-camera (mmul
(mtranslate (vector 0 0 -5))
(mrotate (vector 15 145 0))))
(viewport 0.47 0.8 0.043 0.2)

;otra cam
(define cam4 (build-camera))
(current-camera cam4)
(set-camera (mmul
(mtranslate (vector 0 0 -5))
(mrotate (vector 15 145 0))))
(viewport 0.37 0.02 0.043 0.82)

;otra cam
(define cam5 (build-camera))
(current-camera cam5)
(set-camera (mmul
(mtranslate (vector 0 0 -5))
(mrotate (vector 15 145 0))))
(viewport 0.43 0.2 0.57 0.82)

(define cam6 (build-camera))
(current-camera cam6)
(set-camera (mmul
(mtranslate (vector 0 0 -5))
(mrotate (vector 15 145 0))))
(viewport 0.03 0 0.35 1)

(scale 5)
(define (anima)
(hint-none)
(hint-wire)
(backfacecull 0)
(push)
(colour (flxrnd))
(for ((n (in-range 10)))
(scale 0.9)
(rotate (vector 0 (* 45 (time)) (* 45 (time))))
(draw-cube)
)
(pop)

(with-state
; (hint-none)
(wire-opacity (* 0.05 (gh 12)))
(wire-colour (rndvec))
(hint-solid)
(translate (vector 0 -1 0))
(scale (vector 10 1 0.1))
(for ((n (in-range 40)))
(opacity (* 0.05 (gh 10)))
(colour (* 0.08 (gh 0)))
(translate (vector 0 0.05 0))
(draw-cube)
)
)
)

(every-frame (anima))

descargar código

HackpactDay12

11 Julio 2011

//código fluxus

(start-audio "" 1024 44100)

(clear)

(define pos 0)
(gain 0.0001)
(hint-none)(hint-wire)(backfacecull 0)
(define cara (build-nurbs-plane 10 10))

(define (lc8)
(scale (+ 2 (* 0.25 (sin (time)))))
(rotate (vector 0 (* 20 (time)) 0))

(push)
(hint-solid)
(colour (rndvec))
(opacity (* 1500 (gh 10)))
(draw-cube)
(pop)
(with-primitive cara
(pdata-index-map!
(lambda (index position)
(set! pos (gh index))
(vadd position (vector 0 0 pos))
)
"p")
)

(push)
(translate (vector 0 0 0.5))
(draw-instance cara)
(pop)


(push)
(translate (vector 0 -0.5 0))
(rotate (vector 90 0 0))
(draw-instance cara)
(pop)

(push)
(translate (vector 0 0 -0.5))
(rotate (vector 180 0 0))
(draw-instance cara)
(pop)

(push)
(translate (vector 0 0.5 0))
(rotate (vector 270 0 0))
(draw-instance cara)
(pop)

(push)
(translate (vector 0.5 0 0))
(rotate (vector 0 90 0))
(draw-instance cara)
(pop)


(push)
(translate (vector -0.5 0 0))
(rotate (vector 0 270 0))
(draw-instance cara)
(pop)

)

(every-frame (lc8))

descargar código

HackpactDay11

10 Julio 2011

//código FLUXUS

;hackpact10
;acerca de MIDI y fluxus
;nano control

(clear)
;lo primero es ver los puertos

(midi-init 0) ;indicado el puerto sera "0"

(define mi 0)
(define valor 0)

(define (anima)
(display (midi-note))(newline)
;de donde tomo los valores siguientes
;8 (note off) 9 47 64
;los ultimos dos son la nota y la velocidad
;pero si no recibe envia #f

(if (equal? (midi-note) #f) ;si recibe #f
(draw-cube) ;dibuja cubo
(draw-sphere) ; si recibe algo diferente dibuja esfera
)

;para usar los valores de velocidad por ejemplo

(set! mi (midi-note))
(if (equal? mi #f)
0
(set! valor (vector-ref mi 3)))
;usando el valor de velocidad mi en el vector 3

(translate (vector 3 0 0))

(rotate (vector valor (* valor (sin(time))) 0))
(draw-torus)

)

(every-frame (anima))

descargar código

hackpactDay10

9 Julio 2011

//código FLUXUS

;audio de Sebastian Velasco Sodi


(clear)
(start-audio "" 1024 44100)
(gain 0.0002)
(scale 5)
(define pos 0)
(define plano (build-nurbs-plane 10 10))

(define (hp9)
(with-primitive plano
(rotate (vector
;(* 0.0005 (time))
;(* 0.0005 (cos(time)))
0 0 (+ (* 0.0005 (time)) (* 5 (gh 10))) ))
(hint-wire-stippled)
(backfacecull 1)
(opacity 0)
(wire-colour 5)
(hint-points)
(point-width 10)
(pdata-index-map!
(lambda (index position)
(set! pos (gh index))
(vadd position (vector 0 0 pos))
)
"p")
))

(every-frame (hp9))

descargar código

hackpactDay09

8 Julio 2011

//código FLUXUS

(clear)
;(hint-none)
(hint-wire-stippled)
(wire-colour 0.8)
(clear-colour 10)
(define (hp8)
(rotate (vector 0 0 (+ (* 45 (time)) (flxrnd))))
(colour (vector 0 0 0))
(scale (vector 1 1 0.5))
(for ((n (in-range 3)))
(rotate (vector 0 0 (* 105 (time))))
(translate (vector 0 0 1))
(push)
(translate (vector 0 1.1 (* 1.5 (sin (* 10 (time))))))
(scale 1)
(draw-sphere)
(pop)
(with-state
(translate (vector 0 0 (* 1.4 (sin (* 10 (time)))) ))
(for ((n (in-range 6)))
(translate (vector 0.95 0.55 0))
(rotate (vector 0 0 60))
(draw-cube)))

(with-state
(translate (vector 0 -1.2
(* 1.35 (sin (* 10 (time))))
))
(for ((n (in-range 12)))
(translate (vector 1.2 0.35 0))
(rotate (vector 0 0 30))
(draw-cube)
)
)

(with-state
(translate (vector 0 -2.4 (* 1.3 (sin (* 10 (time))))
))
(for ((n (in-range 18)))
(translate (vector 1.25 0.26 0))
(rotate (vector 0 0 20))
(draw-cube)
)
)

(with-state
(translate (vector 0 -3.6 (* 1 (sin (* 10 (time))))
))
(for ((n (in-range 24)))
(translate (vector 1.25 0.19 0))
(rotate (vector 0 0 15))
(draw-cube)
)
)

(with-state
(translate (vector 0 -4.8 (* 0.6 (sin (* 10 (time))))
))
(for ((n (in-range 30)))
(translate (vector 1.25 0.15 0))
(rotate (vector 0 0 12))
(draw-cube)
)
)
)
)

(every-frame (hp8))

descargar código

hackpactDay08

7 Julio 2011

//código FLUXUS

(clear)

(scale 5)
(define blob
(build-blobby 5
(vector 30 30 30)
(vector 1 1 1)
)
)

(blur 0.2)
(define (hp7)

(push)
(hint-none)
(hint-wire)
(backfacecull 0)
(translate (vector 0.5 0.5 0.5))
(draw-cube)
(pop)
(with-primitive blob
(hint-wire)
(wire-opacity (+ 0.05 (* 0.5 (sin(time)))))
(pdata-set "p" 0 (vector 0.5 0.5 0.5))
(pdata-set "p" 1 (rndvec))
(pdata-set "p" 2 (rndvec))
(pdata-set "p" 3 (rndvec))
(pdata-set "p" 4 (rndvec))

(pdata-set "s" 0 0.05)
(pdata-set "s" 1 0.01)
(pdata-set "s" 2 0.01)
(pdata-set "s" 3 0.01)
(pdata-set "s" 4 0.01)

(hint-vertcols)
(pdata-set "c" 0 (vector 0.04 0.04 0.04))
(pdata-set "c" 1 (vector (* 0.01 (flxrnd)) (* 0.01 (flxrnd)) (* 0.01 (flxrnd))))
(pdata-set "c" 2 (vector (* 0.01 (flxrnd)) (* 0.01 (flxrnd)) (* 0.01 (flxrnd))))
(pdata-set "c" 3 (vector (* 0.01 (flxrnd)) (* 0.01 (flxrnd)) (* 0.01 (flxrnd))))
(pdata-set "c" 4 (vector (* 0.01 (flxrnd)) (* 0.01 (flxrnd)) (* 0.01 (flxrnd))))


)
)

(every-frame (hp7))

descargar código

hackpactDay07

6 Julio 2011

 

//código FLUXUS

(clear)
(blur 0.2)
(define blob
(build-blobby 3
(vector 30 30 30) (vector 2 2 2)))

(define (animar)
(with-primitive blob
(hint-none)
(hint-wire)
(backfacecull 0)
(pdata-set! "p" 0 (vector
(+ 1.2 (* 0.2 (sin(time))))
(+ 0.5 (* 0.2 (cos(time))))
0.5))
(pdata-set! "s" 0 0.1)

(pdata-set! "p" 1 (vector 0.35 0.3 0.9))
(pdata-set! "s" 1 0.1)

(pdata-set! "p" 2 (vector
0.2
(+ 0.65 (* 0.3 (sin (time))))
(+ 0.75 (* 0.25 (cos(time))))
))
(pdata-set! "s" 2 0.1)

)
)

(every-frame (animar))

descargar código

hackpactDay06

5 Julio 2011

//código FLUXUS

(start-audio "" 1024 44100)
(clear)
(blur 0.2)
(scale 5)

(define (late)
(clear-colour (* 0.3 (flxrnd)))
(wire-opacity (* 0.1 (gh 10)))
(line-width (* 0.5 (sin (time))))
(push)
(hint-none)
(hint-wire-stippled)
(for ((n (in-range 30)))
(translate (vector
(* 0.02 (sin (time)))
(* 0.01 (cos (time)))
(* 0.02 (sin (time)))))
(rotate (vector
(* 5 (sin (* (time) 0.25)))
(* 5 (cos (* (time) 0.25)))
(* 5 (sin (* (time) 0.25)))))
(draw-cube))
(pop)
)

(every-frame (late))

descargar código

hackpact_day5

4 Julio 2011

//estudiando un poco mas acerca de la comunicación OSC de SuperCollider y FLUXUS

//código SuperCollider

s.boot;
f=Server("fluxus", NetAddr("127.0.0.1", 4444));
(
(SynthDef(\synth0,{|wmul=0.5, wsfreq=0.1, wsmul=2000, wsadd=2600, lmul=0.035, pan=0|
var son, son1, son2, paneo, freq1, mul1;
son=HPF.ar(WhiteNoise.ar(wmul,0),SinOsc.kr(wsfreq,0,wsmul,wsadd),lmul,0);
son=son+Dust.ar(15);
paneo=Pan2.ar(son,pan);
Out.ar(0,paneo);
}).send(s)
);
(SynthDef(\synth1, {|freq=120, mul=0.5, pan=0|
var env, paneo, son1, dem;
son1=SinOsc.ar(freq,0,mul)+SinOsc.ar(freq*2,0,0.1);
paneo=Pan2.ar(son1,pan);
env=EnvGen.kr(Env.perc(0.005, 0.2, 1, -4),doneAction:2);
Out.ar(0,paneo);
}).send(s)
);
(SynthDef(\synth2, {|freq=40, dur=0.2, mul=0.55, amp=1|
var sig, env;
sig=SinOsc.ar(freq,pi/2,mul)+Saw.ar(freq,0.121)!2;
env=EnvGen.kr(Env.perc(0.05,dur,1,-8),doneAction:2);
Out.ar(0,sig*env*1*amp);
}).send(s)
);
(SynthDef(\synth3, {|freq=80, dur=0.4, amp=1, factor=1.2, ampB=0.3, durB=0.05|
var sig, env;
sig=Pan2.ar(Mix(SinOsc.ar(XLine.kr(freq*factor,freq,dur)*[1,1.1,1.25],pi/2,amp/3)),0);
sig=sig+EnvGen.ar(Env([1,0],[0.05]));
sig=sig+(BrownNoise.ar(ampB)*EnvGen.kr(Env.perc(0.01,durB)));
env=EnvGen.kr(Env.perc(0.01,dur),doneAction:2);
Out.ar(0,sig*env)
}).send(s)
);
(SynthDef(\synth4, {|freq=12000, mul=0.5, pan=0, rel=0.2|
var sig, env;
sig=HPF.ar(WhiteNoise.ar,freq,mul,0);
sig=Pan2.ar(sig,pan);
env=EnvGen.kr(Env.perc(0.01,rel,0.7,-8),doneAction:2);
Out.ar(0,sig*env);
}).send(s);
);
(SynthDef(\synth5, {|freq=120, mul=0.5, pan=0|
var env, paneo, son1;
son1=Saw.ar(freq*0.25, mul, 0)*SinOsc.ar(60.midicps);
paneo=Pan2.ar(son1,pan);
env=EnvGen.kr(Env.perc(0.01, 1, 0.75, -10),doneAction:2);
Out.ar(0,paneo*env);
}).send(s)
);
)
//TDEF
(
(j=Pseq([Pseq([60,64,67,69],8),Pseq([63,68,72,75],8)],inf).asStream;
k=Pseq([0.2,0.2,0.4,0.2,0.4,0.2,0.2,0.2],inf).asStream;
a=Tdef(\fluxus, {
inf.do {
k.next.wait;
Synth(\synth1,[\freq, j.next]);
f.sendMsg("/uno", j.next);
}}));
(l=Pseq([60,65,69,72,60,65,69,75,60,65,69,72],inf).asStream;
m=Prand([0.4,0.2],inf).asStream;
b=Tdef(\fluxus2, {
inf.do {
m.next.wait;
Synth(\synth2, [\freq, l.next]);
f.sendMsg("/dos", l.next);
}}));
(n=Pseq([15,30,45,60],inf).asStream;
o=Pseq([0.1,0.2,0.1,0.4,0.2,0.2,0.2,0.1,0.2,0.4],inf).asStream;
c=Tdef(\fluxus3, {
inf.do {
o.next.wait;
Synth(\synth3,[\freq, 1.5*n.next]);
f.sendMsg("/tre", n.next);
}}));
(p=Pseq([12000,14000,17000],inf).asStream;
q=Pseq([0.1,0.1,0.1,0.1,0.05,0.05,0.1,0.1,0.05],inf).asStream;
d=Tdef(\fluxus4, {
inf.do {
q.next.wait;
Synth(\synth4,[\freq, p.next]);
f.sendMsg("/cua", p.next);
}}));
(
u=Pseq([0.1,0.1,0.2,0.2,0.1,0.1,0.2,0.1,0.5],inf).asStream;
e=Tdef(\fluxus5, {
inf.do {
u.next.wait;
t=([84,89,93,96,101,103,105]).choose;
Synth(\synth5,[\freq, t.midicps]);
f.sendMsg("/cin", t.next);
}}));

)

z=Synth(\synth0).play;
a.play
b.play
c.play
d.play
e.play

a.stop
b.stop
c.stop
d.stop
e.stop
z.free

s.quit;

//código fluxus

(clear)
(osc-source "4444")
(define rotx 0)
(define roty 0)
(define rotz 0)
(define esc1 0)
(define esc2 0)
(define (hackpact)
(clear-colour (* 0.25 (flxrnd)))
(with-state
(rotate (vector (+ (* 5 (time)) (* 0.2 esc1)) (* 45 (time)) 0))
(cond ((osc-msg "/tre")
(set! esc1 (osc 0))))
(scale (vector 1 (* 0.5 esc1) 0.01))
(push)
(translate (vector -21 0 -180))
(for ((n (in-range 20)))
(translate (vector 2 0 0))
(draw-cube))
(pop)
)
(with-state
(cond ((osc-msg "/cin")
(set! esc2 (* 0.5 (osc 0)))))
(scale (vector 1 0.2 0.2))
(push)
(hint-none)
(hint-wire)
(rotate (vector -70 0 0))
(translate (vector 0 -40 0))
(for ((n (in-range 60)))
(scale (vector (* 0.025 esc2) 1 0.2))
(translate (vector 0 2 0))
(draw-cube))
(pop))
(with-state
(push)
(hint-wire)
(cond ((osc-msg "/uno")
(set! rotx (osc 0))))
(cond ((osc-msg "/dos")
(set! roty (osc 0))))
(cond ((osc-msg "/tre")
(set! rotz (osc 0))))
(scale (vector 4 (* 0.03 rotx) 5))
(colour (vector (* (* 0.02 rotx) (sin (time)))
(* (* 0.02 roty) (cos (time)))
(* (* 0.02 rotz) (sin (time)))))
(rotate (vector (* 0.2 (* (sin (time)) rotx)) (* roty (* 0.5 (cos (time)))) rotz))
(draw-cube)
(pop)))

(every-frame (hackpact))

descargar código

hackpact_04_sc

hackpact_04_fluxus

 

3 Julio 2011

(audio bajo, subir un poco el volumen)

hp01_03

audio de hackpact dia 2 que hice en supercollider

//codigo. Processing

float px;
float py;
float cont = 0;
float inc = 1;
void setup() {
size(800,600);
background(0);
smooth();
}

float vel1=5;
float vel2=3.5;

void draw() {
fill(cont,60);
// noStroke();
stroke(0,20);
ellipse(px,py,30+random(20),30+random(20));

px=px+vel1;
py=py+vel2;
cont = cont+inc;
if ((cont>254)||(cont<1))
{
inc=inc*-1;
}

if((px>width)||(px<0))
{
vel1=vel1*-1;
}

if ((py>height)||(py<0))
{
vel2=vel2*-1;
}
}

descargar código

HP01_03

Ver aplicación

2 Julio 2011

//código. SuperCollider

s.boot
p=ProxySpace.push(s)
p.fadeTime=3
~out.play

~out=~uno
~uno={Dust.ar(10,0.5,0)!2}

~dos={BPF.ar(WhiteNoise.ar(1,0),SinOsc.kr(0.01,0,200,520),100/1200,0.3,0) *LFPulse.kr(Demand.ar(Impulse.ar(2),0,Dseq([6,4,6,8],inf)))}
~out=~uno+ ~dos

~tre={Saw.ar(40,SinOsc.kr(0.2,0,0.1,0.05))!2}
~out=~uno+ ~dos+~tre

~cua={(BrownNoise.ar(0.3,0)*Demand.ar(Impulse.ar(4),0,Drand([0.1,0.06,0.08],inf)))}
~out=~uno+ ~dos+~tre+~cua

~cin={LFCub.ar(140,0,0.4)*Saw.ar(20)}
~out=~uno+ ~dos+~tre+~cua+~cin
~out=~dos+~tre+~cin

p.fadeTime=8
~out=~dos

p.free
p.pop

reproducir muestra

descargar código

hackpact_02

1 Julio 2011

//código. SuperCollider

s.boot
p=ProxySpace.push(s)
p.fadeTime=4
~out.play

~uno={SinOsc.ar(Demand.ar(Impulse.ar(2),0, Dseq([Dseq([60,65,69].midicps,2), Dseq([60,65,70].midicps,3),Dseq([60,65,69].midicps,2), Dseq([60,65,72].midicps,3)], inf)),0,0.9)*Pulse.ar(Demand.ar(Impulse.ar(1),0, Dseq([Dseq([2],2),Dseq([2],2)],inf)))!2}

~dos={BPF.ar(WhiteNoise.ar,14000,200/1000,0.6)* Pulse.ar(Demand.ar(Impulse.ar(1),0,Dseq([0.5],inf)),0.5,0.5)!2}

~tre={SinOsc.ar(Demand.ar(Impulse.ar(6),0, Dseq([Dseq([60,65,69].midicps,4), Dseq([60,65,70].midicps,4),Dseq([60,65,69].midicps,4), Dseq([60,65,72].midicps,4)],inf)),0,0.9)}
~cua={LFTri.ar(Demand.ar(Impulse.ar(1),0, Dseq([24,29,33].midicps,inf)),0.5,1)}
~cin={Pulse.ar(Demand.ar(Impulse.ar(1),0, Dseq([1,2,4],inf)))*SinOsc.ar(80,0,0.7)}

~out=~uno
~out=~uno+~dos
~out=~uno+~dos+~tre
~out=~uno+~dos+~tre+~cua
~out=~uno+~dos+~tre+~cua+~cin
~out=~cua
~out.play

p.free
p.pop

reproducir muestra

descargar código

hackpact_01