Hello guys,
I am doing an project where I am displaying information on a snare drum only (not a all drum kit!). My goal is to give simple feedbacks to the user using a microphone as detection tool. My projection look like a clock and when the main hand reach a point, the player should hit the drum. I would like to detect if he hits the drum on time or not and if he hits the drum or not. My projection is in yellow on a black background, it will highlight in blue if he didn't hit on time and in red if he didn't hit the drum (or if he hits anything which is not the drum).
I tried with minim and beatdetect but unfortunatelly the "isSnare" doesn't work as it should be ... It returns true even if I am whistling or hitting my desk...
Should I go in an FFT analysis ? I am up for any advices .. I don't really know where to start.. Should I record the drum sound and then test in real-time if the hit is equal to the recorded sound?
Here is my code for now:
import ddf.minim.*;
import ddf.minim.analysis.*;
Minim minim;
BeatDetect beat;
AudioInput in;
float eRadius;
void setup()
{
size(200, 200, P3D);
minim = new Minim(this);
in = minim.getLineIn(Minim.STEREO, 512);
// a beat detection object SOUND_FREQUENCY based on my mic
beat = new BeatDetect(in.bufferSize(), in.sampleRate());
}
void draw()
{
background(0);
beat.detect(in.mix);
println("isSnare: "+ beat.isSnare());
//println("isHat: "+ beat.isHat());
//println("isKick: " + beat.isKick());
//println("isOnset: "+ beat.isOnset());
}