foobar2000:Components/BPM Analyser (foo_bpm)
|Developer(s)|| , Michael Balzer|
Holger Stenger (foosion)
|Stable release||0.2.4.6 (October 6, 2023)|
|Architecture||x86 64-bit, x86 32-bit|
|View all components|
The BPM Analyser component can be used for calculating the BPM (beats per minute) of any tracks in foobar2000. This is recompile of foo_bpm by Michael Balzer/Holger Stenger. Added support for dark mode and 64-bit foobar2000.
The component can be used to automatically or manually detect a song's BPM.
To automatically calculate the BPM:
- Highlight one or more files in your playlist. Right-click on them and select "BPM Analysis -> Automatically analyse BPMs". Note: Songs already containing a BPM tag will not be scanned.
- After the analysis has completed, a results dialog will be displayed.
- If a BPM result is obviously double or half of its true BPM, select it in the list of results, then click the Double BPM or Halve BPM buttons. Multiple results can be selected using +click.
- Click the button when done.
To manually calculate the BPM:
- Right-click a song in the playlist and select "BPM Analysis -> Manually tap BPM for current track"
- A small window will be displayed with a large Tap Here button.
- Begin playback of a song.
- Click on the button or hit the to the beat of the music. The current calculated BPM will be displayed.
- Continue tapping until the BPM is fairly stable.
- Click the button to save the BPM to the currently playing file.
The BPM analysis algorithm is based loosely on the work presented in the paper Tempo and Beat Estimation of Musical Signals.
Here's a brief overview of how it works:
- Grab an n second sample from the song
- Transform the sample from the time domain into the frequency domain using windowed, overlapping FFTs, also know as Short Time Fourier Transforms (STFTs).
- Onset (or beat) detection is performed on the resulting STFT. The onset detection function takes the spectral flux of the STFT to generate a list of candidate beats.
- The candidate beats are run through an auto-correlation function to determine the dominant beat frequency, and hence the BPM.
- These steps are repeated at different points throughout the song, resulting in a list of candidate BPMs.
- The BPM list is sorted and the average mode value is chosen as the BPM.
The open source FFTW library is used for calculating the FFT.
- The calculated BPMs are not always accurate, especially for songs without obvious beats or large changes in tempo. You can compare the accuracy of the calculated BPM with the included manual BPM tapping function.
- In a number of cases a song's BPM may be calculated as double or half of its 'true' BPM.
- Songs shorter than the configured sample length will automatically have their BPM set to 0. This is by design as it isn't possible to accurately determine the BPM of such a short track.
- There can be large discrepancies between BPMs calculated to the nearest BPM and BPMs calculated to 1 or 2 decimal places.
- Tapping the spacebar on the manual tapping window when the large Tap Here button loses focus will stop working. The button must be clicked again to regain focus so the spacebar will work.
- Improve the current BPM algorithm (wrong BPMs, double/halved BPMs, overall speed)
- Implement other BPM algorithms
- Add option to double/halve BPMs to context menu.
- Specialise the algorithm parameters for different genres, then automatically scan using those parameters based on the GENRE tag.
- Component Home page
- on foobar2000.org
- hydrogenaudio (actual discussion) on
- hydrogenaudio (uploads of the component itself) on