Difference between revisions of "Foobar2000:Components/BPM Analyser (foo bpm)"

From Hydrogenaudio Knowledgebase
Jump to: navigation, search
(Adding initial version of foo_bpm component page)
 
m (Now 64-bit compiled)
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{fb2k}}
+
{{infobox foobar2000 component
=Description=
+
| name                    = BPM Analyser
 
+
| module_name            = foo_bpm
A component for calculating the BPMs (beats per minute) of any tracks in foobar2000.
+
| developer              = {{ha user|u=322|name=Case}}, Michael Balzer<br/>Holger Stenger (foosion)
 
+
| repository              = [https://github.com/stengerh/foo_bpm GitHub]
=Installation=
+
| released                =  
 
+
| released_ref            =
# Unzip foo_bpm.dll to the foobar2000 components directory
+
| stable_release          = 0.2.4.6
# Unzip libfftw.dll to the foobar2000 directory
+
| stable_release_date    = 2023-10-06
 
+
| preview_release        =
=Usage=
+
| preview_release_date    =
 
+
| foobar2000_architecture = x86 64-bit, x86 32-bit
 +
| foobar2000_minimum      = 1.6
 +
| foobar2000_maximum      =
 +
| foobar2000_ui_module    =
 +
| use                    = Tagging
 +
| license                = [https://foobar.hyv.fi/foo_bpm_custom_license.txt Unknown]
 +
}}
 +
==Description==
 +
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.
 +
==Usage==
 
The component can be used to automatically or manually detect a song's BPM.
 
The component can be used to automatically or manually detect a song's BPM.
  
Line 16: Line 26:
 
# 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.
 
# 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.  
 
# 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 ctrl+click.
+
# 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 {{key press|Ctrl}}+click.
# Click the Update File Tags button when done.
+
# Click the {{button|Update files}} button when done.
 
+
  
 
To manually calculate the BPM:
 
To manually calculate the BPM:
Line 24: Line 33:
 
# A small window will be displayed with a large Tap Here button.
 
# A small window will be displayed with a large Tap Here button.
 
# Begin playback of a song.
 
# Begin playback of a song.
# Click on the Tap Here button or hit the spacebar to the beat of the music. The current calculated BPM will be displayed.
+
# Click on the {{button|Tap Here}} button or hit the {{key press|spacebar}} to the beat of the music. The current calculated BPM will be displayed.
 
# Continue tapping until the BPM is fairly stable.
 
# Continue tapping until the BPM is fairly stable.
# Click the Update Tag button to save the BPM to the currently ''playing'' file.
+
# Click the {{button|Update files}} button to save the BPM to the currently ''playing'' file.
 
+
=Algorithms=
+
  
 +
==Algorithms==
 
The BPM analysis algorithm is based loosely on the work presented in the paper [http://perso.telecom-paristech.fr/~grichard/Publications/ismir04b.pdf Tempo and Beat Estimation of Musical Signals].
 
The BPM analysis algorithm is based loosely on the work presented in the paper [http://perso.telecom-paristech.fr/~grichard/Publications/ismir04b.pdf Tempo and Beat Estimation of Musical Signals].
  
Line 42: Line 50:
 
The open source [http://www.fftw.org/ FFTW library] is used for calculating the FFT.
 
The open source [http://www.fftw.org/ FFTW library] is used for calculating the FFT.
  
=Limitations=
+
==Limitations==
 
+
 
* 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.
 
* 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.
 
* In a number of cases a song's BPM may be calculated as double or half of its 'true' BPM.
Line 50: Line 57:
 
* 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.
 
* 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.
  
=Future Work=
+
==Future work==
 
+
 
* Improve the current BPM algorithm (wrong BPMs, double/halved BPMs, overall speed)
 
* Improve the current BPM algorithm (wrong BPMs, double/halved BPMs, overall speed)
 
* Implement other BPM algorithms
 
* Implement other BPM algorithms
Line 57: Line 63:
 
* Specialise the algorithm parameters for different genres, then automatically scan using those parameters based on the GENRE tag.
 
* Specialise the algorithm parameters for different genres, then automatically scan using those parameters based on the GENRE tag.
  
=Link=
+
==External links==
* [http://www.hydrogenaudio.org/forums/index.php?showtopic=77143 Homepage]
+
* [https://foobar.hyv.fi/?view=foo_bpm Component Home page]
* [http://www.hydrogenaudio.org/forums/index.php?showtopic=77142 Discussion Thread]
+
* {{foobar2000|http://www.foobar2000.org/components/view/foo_bpm|Legacy BPM Analyser}}
 +
* {{ha|https://hydrogenaud.io/index.php/topic,77142.0.html}} (actual discussion)
 +
* {{ha|https://hydrogenaud.io/index.php/topic,77143.0.html}} (uploads of the component itself)

Latest revision as of 08:06, 29 October 2023

BPM Analyser

foo_bpm
Developer(s) Case, Michael Balzer
Holger Stenger (foosion)
Repository GitHub
Release information
Initial release
Stable release 0.2.4.6 (October 6, 2023)
Preview release
foobar2000 compatibility
Architecture x86 64-bit, x86 32-bit
Minimum version 1.6
Maximum version
UI module(s) N/A
Additional information
Use Tagging
License Unknown
Discussion thread {{{discussion_thread}}}
View all components

Description

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.

Usage

The component can be used to automatically or manually detect a song's BPM.

To automatically calculate the BPM:

  1. 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.
  2. After the analysis has completed, a results dialog will be displayed.
  3. 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 Ctrl+click.
  4. Click the Update files button when done.

To manually calculate the BPM:

  1. Right-click a song in the playlist and select "BPM Analysis -> Manually tap BPM for current track"
  2. A small window will be displayed with a large Tap Here button.
  3. Begin playback of a song.
  4. Click on the Tap Here button or hit the spacebar to the beat of the music. The current calculated BPM will be displayed.
  5. Continue tapping until the BPM is fairly stable.
  6. Click the Update files button to save the BPM to the currently playing file.

Algorithms

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:

  1. Grab an n second sample from the song
  2. Transform the sample from the time domain into the frequency domain using windowed, overlapping FFTs, also know as Short Time Fourier Transforms (STFTs).
  3. 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.
  4. The candidate beats are run through an auto-correlation function to determine the dominant beat frequency, and hence the BPM.
  5. These steps are repeated at different points throughout the song, resulting in a list of candidate BPMs.
  6. 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.

Limitations

  • 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.

Future 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.

External links