Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve beat (onset) detection #225

Open
softhack007 opened this issue Aug 12, 2022 · 4 comments
Open

improve beat (onset) detection #225

softhack007 opened this issue Aug 12, 2022 · 4 comments
Assignees
Labels
backburner keeping this on the backburner; we might consider it in future discussion ongoing discussion or new concept to be developed enhancement New feature or request

Comments

@softhack007
Copy link
Collaborator

softhack007 commented Aug 12, 2022

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:

  • use a Short-time FFT as starting point (we already have that)
  • Sum the increases in magnitude over all frequencies (ignore the decreases). This gives you a function called the "spectral flux".
  • Find the peaks of this spectral flux. These so-called "onsets" correspond to the start of sounds in the music (notes, drum hits, voice onsets, etc).

Screenshot_20220813-014757_Firefox Beta


Another idea, as @atuline wrote in #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.

@softhack007 softhack007 added enhancement New feature or request discussion ongoing discussion or new concept to be developed labels Aug 12, 2022
@softhack007 softhack007 added the backburner keeping this on the backburner; we might consider it in future label Oct 13, 2022
@softhack007 softhack007 self-assigned this Oct 13, 2022
@Drizzt321
Copy link

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
Copy link
Collaborator Author

softhack007 commented Dec 7, 2022

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
Copy link

@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
Copy link

flckv commented Mar 19, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backburner keeping this on the backburner; we might consider it in future discussion ongoing discussion or new concept to be developed enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants