Home › Evil Mad Scientist Forums › LED Matrix Kits › Peggy 2.0 Audio spectrum analyzer › Re: Peggy 2.0 Audio spectrum analyzer
February 27, 2014 at 10:30 am
#21499
jackluke23
Participant
Hi again Windell,
Iv made some progress on the issue, mirror Peggy works very well and am delighted with it. At the moment im trying to display the input from my laptops microphone on my Peggy. I found this code which works well and clearly shows the different levels. Im just not too sure on how to modify it to send or mirror it to the Peggy, this is the code….
import krister.Ess.*;
FFT myfft;
AudioInput myinput;
int bufferSize=512;
void setup() {
size(532,400);
frameRate(30);
background(255);
noStroke();
fill(0);
Ess.start(this);
myinput=new AudioInput(bufferSize);
myfft=new FFT(bufferSize*2);
myinput.start();
myfft.damp(.3);
myfft.equalizer(true);
myfft.limits(.005,.05);
}
void draw() {
background(255);
for (int i=0; i<bufferSize;i++) {
rect(i+10,390,1,myfft.spectrum*-400);
}
}
public void audioInputData(AudioInput theInput) {
myfft.getSpectrum(myinput);
}
Any help you could give me would be much appreciated as always,
Below is the link to where i found the code,