atuline / WLED

Control WS2812B and many more types of digital RGB LEDs with an ESP32 over WiFi.
GNU General Public License v3.0
871 stars 131 forks source link

improve beat (onset) detection #225

Open softhack007 opened 2 years ago

softhack007 commented 2 years ago

As part of the discussion in other problem reports, users have asked for beat detection. This issue ticket is meant to collect availeable information that could be useful for a future implementation.

Actually I already have a working prototype for beat detection based on the "beatroot" algorithm. However there might be other ways to achieve the desired function and I'm open to discussions.

The basic idea is:

Screenshot_20220813-014757_Firefox Beta


Another idea, as @atuline wrote in https://github.com/atuline/WLED/issues/209

Damian peckett had a nice beat detection article on his web site a while back, but unfortunately, that site is no longer available. Beat detection, however, is not an easy thing to implement, as is the automatic gain control. I shlurped most of the information from that article, including the code if @softhack007 is interested.


some links:

Please add any ideas, expectations or anything that might be related.

Drizzt321 commented 1 year ago

Hmm...I presume you're talking about the URL mentioned here on Adafruit, which is http://dpeckett.com/beat-detection-on-the-arduino. Through some Wayback Machine sleuthing, I think https://web.archive.org/web/20181202114804/http://damian.pecke.tt/beat-detection-on-the-arduino might be the post you're looking for?

softhack007 commented 1 year ago

Hi, i was actually thinking about something FFT based. However your links are also interesting 👍Let's see what the result will be. I have a prototype already that is based on recommendations from the "beatroot" science papers. It is an approach without filtering - its computing the "spectral flux" over time from FFT results, and then applying some heuristics to find major peaks in the flux. Maybe your references will add something special to my final implementation, so really thanks sharing 😃

Drizzt321 commented 1 year ago

@softhack007 You're welcome! Did nothing but use archive.org to help find a copy of a post mentioned above which sounded like it'd help.

flckv commented 8 months ago

hi @softhack007 thank you for sharing, do you think same could work for speech onset detection?