Posts: 1
Joined: Wed Jun 13, 2018 7:06 pm

Beat Detection, BPM Averaging, LED Trigger

Wed Jun 13, 2018 7:11 pm

This should be a remarkably simple program, however I've been having some difficulty doing it myself, and even more difficulty finding previously constructed versions of this program online.

Step 1
Listen to a microphone, detect bass notes

Step 2
Average out, say, 60 samples of beats, determine BPM

Step 3
Using the "current BPM" variable, output a trigger. (in this case, turning on an LED)

I feel like this shouldn't be too hard, but I've been having some troubles. Perhaps someone out there who has gone through the trouble already can save me some trouble and help me out. Any links, ideas, or suggestions would be immensely helpful - thank you!

User avatar
Z80 Refugee
Posts: 358
Joined: Sun Feb 09, 2014 1:53 pm

Re: Beat Detection, BPM Averaging, LED Trigger

Thu Jun 14, 2018 9:42 pm

Beat detection is trickier than you seem to think. I recommend you read up about it. ... _detection

Implementing it in an RPi will require DSP (digital signal processing) operations, and (in the first place) a means to get the audio in (the RPi has no analogue input and requires an external ADC). I don't know whether there is enough processing power to perform the necessary FFT in real time (perhaps somebody can advise).

I'm not saying you shouldn't do it (in the spirit of experiment), just that you need to be prepared for some effort and potentially disappointing results.
Military and Automotive Electronics Design Engineer (retired)

For the best service: make your thread title properly descriptive, and put all relevant details in the first post (including links - don't make us search)!

Posts: 3
Joined: Sat Aug 18, 2018 2:38 pm

Re: Beat Detection, BPM Averaging, LED Trigger

Sat Aug 18, 2018 2:54 pm


GBD is framework for generic and realtime music beat detection and is
designed IoT setups (music-to-light control) based on the RPi.

The GBD library delivers beat counts in Linux posix shared memory. The
IoT maker then uses this information to control lights/leds (or a simulation).


Demo video:

Return to “Graphics, sound and multimedia”

Who is online

Users browsing this forum: No registered users and 6 guests