I want my Arduino project to listen to the ambient music and sync its light show output to the beat.
It seems that doing BPM detection properly is fiendishly difficult in software, but if your music is sufficiently doofy in nature and you use a little bit of hardware you can cheat and get away with it.
So my plan is to hook a mic/opamp breakout board to a simple 1st order passive low-pass filter and sample the input on an interrupt every 5ms or so. Audacity tells me a bass beat is around 15ms long, so every 5ms should be plenty to make sure I don't, er, "miss a beat".
If my low-pass'd sample is over a volume threshold, I'll record the time since the last beat, do some kind of weighted average calculation over the past few samples and that will allow me to predict how many ms until the next beat (some other software trickery might be necessary to account for bass drops and breakbeats.)
Firstly, do I have roughly the right idea?
Secondly, can anyone tell me what order-of-magnitude values I'll need for the resistor and capacitor? I figure I want my cutoff frequency to be something like 500-1000Hz. I also gather the resistance of the rest of my circuit counts but I'm not sure where to measure that resistance across. A little fiddling with this tool gives me answers that look reasonable (500Hz = 330Ω/1uF) but I don't know enough to really know.
An example schematic showing where I measure the resistance of the existing circuit and where the low pass filter goes in the context of the rest would be exceedingly helpful.