miércoles, 23 de abril de 2008

Objeto Embebido

Aquí está embebido un objeto java generado por processing.

standby="Loading Processing software..." >












codebase="http://java.sun.com/update/1.4.2/jinstall-1_4_2_12-windows-i586.cab"
width="256" height="200"
standby="Loading Processing software..." >















This browser does not have a Java Plug-in.



Get the latest Java Plug-in here.





lunes, 21 de abril de 2008




// Example by Krister Olsson

import krister.Ess.*;

AudioChannel myChannel;
FFT myFFT;

void setup() {
size(256,200);
// start up Ess
Ess.start(this);
// load "cell.aif" into a new AudioChannel
myChannel=new AudioChannel("guitar.aif");
// we want 256 frequency bands, so we pass 512
myFFT=new FFT(512);
// start the sound looping forever
myChannel.play(Ess.FOREVER);
background(0,0,0);
}

void draw() {
//background(0,0,255);
fill(0,0,0,5);
noStroke();
rect(0,0,width, height);
// get our spectrum
myFFT.getSpectrum(myChannel);

// draw our frequency bars
for (int i=0; i < 32; i++) {
float val = (height/2) - myFFT.spectrum[i]*512;
float val2 = (height/2) + myFFT.spectrum[i]*512;
stroke(i*8, 255- val, val*2, 100);
strokeWeight(1);
noFill();
ellipse(i*8,val, myFFT.spectrum[i]*512*2, val/10);
ellipse(i*8,val2, myFFT.spectrum[i]*512*2, val2/10);
}
}

// we are done, clean up Ess

public void stop() {
Ess.stop();
super.stop();
}

miércoles, 16 de abril de 2008

Espiral



import ddf.minim.*;

AudioInput in;

float acumulador;

void setup ()
{
size(200,200);
background(255,255,255);
Minim.start(this);
in = Minim.getLineIn(Minim.MONO);
}

void draw ()
{
//background(255,255,255);
fill(255,255,255,10);
rect(0,0,width,height);
float radio;
strokeWeight(2);
for(int i = 0; i < 20; i++)
{
float muestra = in.left.get(i);
radio = 40 + (muestra*60);
stroke(200-(radio *2), i * 2,acumulador , abs(muestra)* 150);
float angulo = TWO_PI * i/20;
float x = radio * sin(angulo);
float y = radio * cos(angulo);
noFill();
ellipse(x + 100,y + 100, 120, 120);
}
acumulador = acumulador + 6;
if (acumulador > 255)
{
acumulador = 0;
}

}

miércoles, 9 de abril de 2008

Visor de Onda


Aquí un código en processing para ver la entrada como una onda:


import ddf.minim.*;
AudioPlayer song;
AudioInput in;
float opacidad;
float azul;
void setup()
{
size(400, 200);
Minim.start(this);
in = Minim.getLineIn(Minim.MONO);
opacidad = 40;
azul = 20;
background(0,0,0);
}

void draw()
{
strokeWeight(5);
for(int i = 0; i < width; i++)
{
stroke(abs(in.left.get(i)*600),100,azul);
line(i, 50 + in.left.get(i)*50, i+1, 50 + in.left.get(i+1)*50);
line(i, 150 + in.right.get(i)*50, i+1, 150 + in.right.get(i+1)*50);
}
opacidad = opacidad - 1.5;
azul = azul + 10;
noStroke();
fill(0,0,0,30);
rect(0,0,width, height);

}

void stop()
{
song.close();
super.stop();
}

lunes, 11 de febrero de 2008

Bienvenida

Hola,
por favor dejar un comentario con la direccion de sus blogs.