I've scoured this website and google but yet to have a clear answer as to how to detect notes with processing. Here's what I would like to do:
Listen for notes coming from the microphone and detect weather a certain note has been played. (perhaps display it on the screen) Please keep in mind that I am a beginner and I am new to processing and audio. Below is what I have so far. I am logging frequencies but I have no idea what the heck I am doing! Please help?
/* sketch to measure frequencies */
import ddf.minim.analysis.*;
import ddf.minim.*;
Minim minim;
AudioInput in;
PFont f;
FFT fft;
void setup()
{
size(512, 200, P3D);
minim = new Minim(this);
in = minim.getLineIn(Minim.MONO, 2048);
fft = new FFT(in.bufferSize(), 44100);
f = createFont("Arial",16,true);
textFont(f, 16);
}
void draw()
{
background(0);
stroke(255);
fft.forward(in.mix);
for(int i = 0; i < fft.specSize(); i++)
{
// draw the line for frequency band i, scaling it by 4 so we can see it a bit better
line(i, height, i, height - fft.getBand(i)*2);
String freq = str(fft.getFreq(i));
println(freq);
}
fill(255);
}
void stop()
{
// always close Minim audio classes when you finish with them