Cheap'n'dirty beat detection?

Tom Swirly's icon

I need a mediocre beat detector that isn't so heavy on the CPU.

The requirements are quite light - it's for a DJ environment with kickdrum sounds on each beat. The beats are likely all between 90bpm and 150bpm, perhaps narrower - and since I'm controlling a laser setup which also has feedback and other dynamic elements, the occasional error or glitch really won't be noticed.

(Plus, I'll have a switch to trigger by hand if it really doesn't work...)

My thought was to pass an input to lores~ and then thresh~ and perhaps some sort of logic to prevent retriggering too soon, but I'm wondering if anyone else has such a "quick and dirty" beat detector already written or knows an approach that is "known to work".

Thanks in advance, and happy new year!

metamax's icon

A 64-bit version of [bonk~] was just posted today..
https://cycling74.com/forums/bonk-64-bit-version/

Joseph Hyde's icon
Peter McCulloch's icon

Are you trying to detect onsets or to do tempo estimation?

If it's the first one, then this thread might be of help:
https://cycling74.com/forums/fastest-onset-detection-native-or-external

You could take the smoothed envelope and do an auto-correlation on it via pfft~. Since you're looking for subaudio frequencies you should be able to downsample it quite a bit inside a poly~.