Description
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).
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:
- http://www.eecs.qmul.ac.uk/~simond/pub/2006/dafx.pdf
- https://www.researchgate.net/publication/228724188_Evaluation_Methods_for_Musical_Audio_Beat_Tracking_Algorithms
- https://code.soundsoftware.ac.uk/projects/beatroot
- https://www.researchgate.net/figure/The-curves-of-original-signal-and-spectral-flux-features-of-speech-sentence_fig4_281410015
Please add any ideas, expectations or anything that might be related.