justin lui created some visuals for his circuiot bend speak and spell.
its viewable here:
http://vimeo.com/4484850it works like this
an eye is simulated and the different layers of iris are made of strokes changing colors from the center towards the outer regions.
the movements of the strokes are actuated by sound i guess.
ive tried to do it with plain for loops and minims fft analysis, but i got stuck with my bad results.
anyone having ideas on how to and which functions i should use to recreate something like justins beautiful piece of art
here my code:
Code:import ddf.minim.analysis.*;
import ddf.minim.*;
Minim minim;
AudioInput in;
FFT fft;
int xx;
int yy;
PVector [] vectors = new PVector[360];
PVector [] vectors2 = new PVector[360];
float angle;
float cosine;
float jitter;
void setup(){
size(500,500);
smooth();
stroke(255);
minim = new Minim(this);
in = minim.getLineIn(Minim.STEREO, 512);
fft = new FFT(in.bufferSize(), in.sampleRate());
fft.linAverages(20);
textFont(createFont("SanSerif", 12));
}
void draw(){
background(0);
fft.forward(in.mix);
if(second()%2 == 0){
jitter = (random(-0.1, 0.1));
}
angle = angle + jitter;
cosine = cos(angle);
for(int i = 0; i < fft.avgSize(); i++){
for(xx=0;xx<360;xx=xx+20){
vectors[xx]=new PVector(sin(radians(xx+fft.getAvg(5)*2)),cos(radians(xx+fft.getAvg(5)*2)));
vectors2[xx]=new PVector(sin(radians(xx+fft.getAvg(5)*5)),cos(radians(xx+fft.getAvg(5)*5)));
pushMatrix();
translate(width/2,height/2);// bring zero point to the center
//point (sin(radians(x))*50,cos(radians(x))*50);
//line(vectors[xx].x,vectors[xx].y,sin(radians(xx))*100,cos(radians(xx))*100);
line(vectors[xx].x*100,vectors[xx].y*100,vectors2[xx].x*110,vectors2[xx].y*110);
line(vectors[xx].x*150,vectors[xx].y*150,vectors2[xx].x*160,vectors2[xx].y*160);
popMatrix();
}
}
}