BPM detection from MIDI playing in real time

Carlos Martorell's icon

Hello everyone,

I've spent the last couple of days trying to set up a BPM detection from MIDI playing. It somehow works, based on the idea of checking time distances between last notes played. I'm searching ways to improve it, as well as share it for anyone who wants to test it :)

I'm not so good at maths, I've been reading about using autocorrelation here, but what I have is an array of discrete timed "occurences" and I could not figure out how to apply it.

Anyone has any idea on how to make it more stable or faster?

Carlos Martorell's icon

bpm detect 0.3.maxpat
Max Patch