Created
March 7, 2012 20:19
-
-
Save resophonic/1995755 to your computer and use it in GitHub Desktop.
circlevisualizerv1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import krister.Ess.*; | |
FFT myfft; | |
AudioInput myinput; | |
int bufferSize=512; | |
void setup() { | |
size(500, 500); | |
frameRate(30); | |
smooth(); | |
Ess.start(this); | |
myinput=new AudioInput(bufferSize); | |
myfft=new FFT(bufferSize*2); | |
myinput.start(); | |
myfft.damp(.023); | |
myfft.equalizer(false); | |
myfft.limits(.000111,.00006); | |
} | |
void draw() { | |
background(156,198,203); | |
circ(50,20); | |
circ(40,20); | |
circ(30,30); | |
circ(10,20); | |
} | |
public void audioInputData(AudioInput theInput) { | |
myfft.getSpectrum(myinput); | |
} | |
void circ(int s, int r) { | |
for (int i=88; i<bufferSize;i++) { | |
noFill(); | |
stroke(255,255,255,myfft.spectrum[i]*300); | |
ellipseMode(CENTER); | |
pushMatrix(); | |
translate(width/2,height/2); | |
rotate(frameCount*radians(s)/r); | |
translate(mouseX,mouseY); | |
ellipse(40,40,myfft.spectrum[i]*100,myfft.spectrum[i]*100); | |
popMatrix(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment