Detecting BPM from a metronome sample

orange_glass's icon

Hi I have a need to detect BPM from a metronome sample, I've made. The reason being it's going into an app that has midi/OSC data out capabilities so I've come up with a work around.

Max Patch
Copy patch and select New From Clipboard in Max.

So I'm making it play a 1 bar metronome sample, with the beep on the 1 being significantly louder. So I'm hoping to detect this louder beep and calculate BPM from it, I'm using this patch. If I test it at 125 it's not always correct, it fluctuates roughly between 125.6 to 124.4. Is there anyway I can improve it's accuracy?

broc's icon

You could try collecting several values with [zl group] and calculate the average with [zl median].
However, the response to tempo changes would then be delayed.

Michael Sperone's icon

In the DSP status window, make sure "scheduler in overdrive" is checked. That gave me a steady 125. all the time.

(I used a Boss Dr. Beat metronome to test this)

orange_glass's icon

thanks for the tip

did you do this with my patch? I've not been able to obtain that accuracy even with said setting checked.