HydrogenAudio

Hosted Forums => foobar2000 => 3rd Party Plugins - (fb2k) => Topic started by: fraganator on 2009-12-21 15:33:40

Title: foo_bpm
Post by: fraganator on 2009-12-21 15:33:40
Updated to version 0.2.4.1. Download here: foo_bpm 0.2.4.1 (http://www.hydrogenaudio.org/forums/index.php?showtopic=77143)
From the changelist:

0.2.4.1  (20/04/2010)
- A few more bug fixes. Songs where the sample rate can not be queried will have the BPM set to zero.
- Context menu option to double/halve BPMs of selected tracks

0.2.4  (01/02/2010)
- Recompiled to include static link the Visual Studio 2008 Runtime. Download the static version if you're having runtime problems.

0.2.4  (12/01/2010)
- Crash report fix (component about info)

0.2.3  (11/01/2010)
- Updated to foobar2000 1.0 SDK
- Added double/halve buttons to results dialog
- Added option to auto write tags after analysis
- Limit preference range inputs
- Crash report fix (using info not yet cached)

Please note: foobar2000 1.0 is now the minimum supported version.

You can access the manual BPM calculation window through the context menu (right-click->BPM Analysis->Manually tap BPM for current track). Clicking the Update Tag button will write the BPM to the currently playing file.

No changes have been made to the algorithm itself, but the parameters are now available for tweaking. You will probably have the most luck experimenting with the "Samples Per Song" value, followed by "Seconds Per Sample". Try increasing one or both, though calculation speed will take a hit.

Here's a quick overview of some of the parameters:
"Seconds Per Sample" - The number of seconds of audio grabbed from the file at any one time. The result of this sample produces a single BPM value.
"Samples Per Song" - The number of times we grab an audio sample from the file. This determines the size of the final list of candidate BPMs.
"Sample Offset (Min/Max)" - When grabbing audio samples from a file, start from the minimum offset and move towards the max offset. These values are used to avoid slow fade in or fade outs of songs.
"Calculated BPM (Min/Max)" - Limits the range of the BPM calculation to these values. Change the min and max to suit particular styles of music (e.g. 70-110 for hip-hop, 150-200 for d'n'b, etc)

-----------------------------

Hi everyone,

I'd like to introduce my first foobar2000 component: foo_bpm

As the name suggests, it is designed to calculate the BPMs (beats per minute) of any tracks in foobar2000.

I like to DJ a bit in my spare time, and I also buy a fair number of CDs for DJing and general listening. The problem is when DJing, I'm not familiar enough with the tempo of my new tunes to drop them straight into mixes. So I wrote this component so I could use the foobar2000 to sort and manage new tracks by their BPM, helping me select new tracks to play with a minimum of fuss. The component could also presumably be used to come up with playlists of a certain tempo for exercise workouts, etc.

The BPM analysis algorithm is based loosely on the work presented in the paper Tempo and Beat Estimation of Musical Signals (http://perso.telecom-paristech.fr/~grichard/Publications/ismir04b.pdf) (pdf).

Here's a brief overview of how it works:
1. Grab a 10 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 (http://en.wikipedia.org/wiki/STFT) (STFTs).
3. Onset (or beat) detection is performed on the resulting STFT. The onset detection function takes the spectral flux (http://en.wikipedia.org/wiki/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 FFTW library (http://www.fftw.org/) is used for calculating the FFT. A dll for this library is included with foo_bpm.


Download:
foo_bpm 0.2.4.1 (http://www.hydrogenaudio.org/forums/index.php?showtopic=77143)

Installation:
- Download the above 7zip file.
- Unzip foo_bpm.dll to the foobar2000 components directory
- Unzip libfftw.dll to the foobar2000 directory (NOT the components directory)

Usage:
- Highlight one or more files in your playlist. Rightclick on them and select "BPM Analysis->Automatically analyse BPMs..."
- After the analysis has completed, the results are automatically written to the "BPM" field of the tag.
- If the BPM field already exists for a song, it will NOT be overwritten.

Known Problems:
- 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. So don't be alarmed if you see some obviously slow R'n'B songs with BPMs of 180 or more! They are actually half of that.
- Songs shorter than 10 seconds 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. I would recommend using either 1 or 2 decimal places as they seem to be closer to the real BPM.
- 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.
- BPMs calculated for the same song at different bitrates (eg mp3 V0 vs mp3 V5) can have significantly different results. This relates to the spectral flux calculation and will be improved.

Future changes:
- Improve the current BPM algorithm (wrong BPMs, double/halved BPMs, overall speed)
- Implement other BPM algorithms such as this (http://werner.yellowcouch.org/Papers/bpm04/) and this (http://finalscratch.sourceforge.net/BPM/index.html)
- Add a menu option and dialog window with a button to manually calculate the BPM by tapping/clicking along with the current playing song- DONE
- Add a confirmation dialog after a BPM scan has completed before writing the values to the files (similar to ReplayGain) - DONE
- Add option to double/halve individual calulated BPMs if need be. - DONE Will also add to context menu. - ALSO DONE
- Add a properties page with all of the algorithm parameters available for tweaking - DONE
- Specialise the algorithm parameters for different genres, then automatically scan using those parameters based on the GENRE tag
- Cleanup and release the source code - DONE
- Handle manual BPM calculation when button is pressed down, not released


Please download it and let me know what you think!
Title: foo_bpm
Post by: ExUser on 2009-12-21 15:51:31
Very nice! I need to test it out first, but I'm not sure I'd have been able to come up with a better algorithm. I'm excited for the source-code release of this.
Title: foo_bpm
Post by: blonde on 2009-12-21 16:23:27
Very cool!  Looking forward to trying this.  Thanks!
Title: foo_bpm
Post by: Keesface on 2009-12-21 16:25:51
I'm gonna try this, sounds very cool!

Will it also be possible to use the bpm value in title formatting? (something like %BPM%)
Title: foo_bpm
Post by: kode54 on 2009-12-21 16:30:01
Will it also be possible to use the bpm value in title formatting? (something like %BPM%)

Since the results are written to the file tags, it should be possible to use %bpm% for any file which has already been scanned.
Title: foo_bpm
Post by: fraganator on 2009-12-21 16:32:58
Yep, that's not a problem. I have a column in my playlist to display %BPM% and it works just fine, so it should be available anywhere in foobar2000 you can use % style formatting.

Edit: What kode54 said
Title: foo_bpm
Post by: Keesface on 2009-12-21 16:37:39
I just found out, it's awesome!


p.s. The command in my context menu is still under legacy commands, could you make a separate context group for it?
Title: foo_bpm
Post by: Jack Schmaltz on 2009-12-21 16:43:46
thanks for this, just having a play with it now by throwing it at various styles of music.

one suggestion so far, would it be possible to have a Results Window open displaying the results once the analysis is complete?

thanks again
Title: foo_bpm
Post by: fraganator on 2009-12-21 16:47:23
p.s. The command in my context menu is still under legacy commands, could you make a separate context group for it?

Are you using one of the fb2k 1.0 betas? The 1.0 SDK might need to be made available before I can change the context menu like that. Can anyone confirm this? I was thinking of just moving it under Utils or something anyways.

Quote from: Jack Schmaltz link=msg=0 date=
one suggestion so far, would it be possible to have a Results Window open displaying the results once the analysis is complete?

Yep, it's on my do to list
Title: foo_bpm
Post by: Keesface on 2009-12-21 16:52:21
p.s. The command in my context menu is still under legacy commands, could you make a separate context group for it?

Are you using one of the fb2k 1.0 betas? The 1.0 SDK might need to be made available before I can change the context menu like that. Can anyone confirm this? I was thinking of just moving it under Utils or something anyways.

Yes I'm using 1.0 beta 5. I forgot about the SDK, i think you're right there. Utils would be a good group i guess
Title: foo_bpm
Post by: Jack Schmaltz on 2009-12-21 16:53:17
Yep, it's on my do to list


ah, my apologies. i did read the to do list but obviously didn't sink in.

so far the results are very accurate with styles like Psy-Trance & Hardcore Techno, a bit off with some Breakcore/Hardcore Techno i have but the beats on the inaccurate results are fairly inconsistant anyway so isn't a fault of the component in my opinion.

looking forward to the development of this, thanks again
Title: foo_bpm
Post by: fraganator on 2009-12-21 17:01:42
Autechre, Aphex Twin and Squarepusher were the yard sticks for the more extreme BPM tests and the component doesn't do too badly. You're right though that the results can be fairly inaccurate when it comes to genres like that. Hopefully things will improve!
Title: foo_bpm
Post by: Jack Schmaltz on 2009-12-21 17:10:19
if i can help in anyway with regards to testing & sending results etc. please let me know as i'd be more than happy to help, as like yourself i like to know the bpm's for dj'ing purposes & currently do it manually with a bpm counter.

regarding testing again, some Drum & Bass i have doesn't appear to perform greatly, with it either being spot on or very off. the off results having pretty consistant beats also.

i can see this component being my new fave
Title: foo_bpm
Post by: fraganator on 2009-12-21 17:16:17
Alright, that'd be cool. I'll PM you if I need some more testing done. What are the artists/names of some of the songs where the component gives poor results? I may have them in my collection.
Title: foo_bpm
Post by: Jack Schmaltz on 2009-12-21 17:41:50
some of the inaccurate ones so far:

I:gor - Icebreaker (foo_bpm:157.3 / manual bpm:200)
I:gor - God Left This Place (foo_bpm:171.0 / manual bpm:185)
I:gor - A Man With A Gun (foo_bpm:167.3 / manual bpm:185)
Nanotek - Better Place (foo_bpm: 116.1 / manual bpm:174)
Current Value - The Edge Of The Cliff (foo_bpm:132.4 / manual bpm:174)
Throttler - Overbrewed (foo_bpm:122.8 / manual bpm:184)
DJ G-I-S - Savage (Technical Itch Remix) (foo_bpm:119.9 / manual bpm:179)

i'm startled by this plugin, half the tracks i scan to try & catch it out work brilliantly, great work.
some come through at half bpm, but as you have already pointed this out & i have noticed the same behaviour previously with other auto bpm counters i won't add them as inaccurate.
Title: foo_bpm
Post by: ExUser on 2009-12-21 17:54:40
If the BPMs were simply normalized to between 100 and 200 it would be fine, I think. Doubled/halved BPMs are basically identical anyhow.
Title: foo_bpm
Post by: odyssey on 2009-12-22 10:27:57
Thanks!

Any chance the written tag-field could be customized in the future?
Title: foo_bpm
Post by: fraganator on 2009-12-22 15:31:52
Thanks everyone for the encouraging comments. I'm just in the process of cleaning up the code, then will get stuck into the requests raised so far.

some of the inaccurate ones so far:

<tracklist>

Thanks for the feedback. I'll look into the results when I have a chance.


Any chance the written tag-field could be customized in the future?

I shall add it to my to do list
Title: foo_bpm
Post by: grimes on 2009-12-22 22:07:33
Analysing BPMs... get stuck. Next track (album) has bpm-tag already!
Title: foo_bpm
Post by: fraganator on 2009-12-23 14:04:05
The plugin should skip over any tracks that already have the BPM tag.. so perhaps it's getting stuck not because the track already has a BPM tag, but for some other reason.

If you analyse each track in the album individually, does it still get stuck?
Title: foo_bpm
Post by: grimes on 2009-12-23 14:30:21
analyzing smaller portions (per album) works, so it seems not to be a problem of the individual track. problem happens at track 668 of 11715. analyzing this amount was a little bit optimistic

EDIT: Happens again with smaller portions (about 1000 tracks). Here whole portion hangs but analyzing individual album works. It stops at last track of an album (a Jethro Tull bootleg) next album again already bpm-tagged. (Thick as a brick (studio))
Title: foo_bpm
Post by: fraganator on 2009-12-23 16:14:02
OK, thanks for the feedback. Sounds like a bug when analysing large lists. The biggest I tested with was ~500 tracks, so I'll try out some 1000+ file lists to try reproduce the problem.
Title: foo_bpm
Post by: Case on 2009-12-23 17:20:54
I scanned over 3000 tracks at once yesterday without trouble, so it's not about list size. Unrelated question: Is it intentional that you decode entire track and not just short snippet from it?
Title: foo_bpm
Post by: Sylph on 2009-12-23 17:31:05
Reason unknown, but by right-clicking on a track in playlist, it won't show up. In beta 5.
Title: foo_bpm
Post by: fraganator on 2009-12-23 17:35:16
I scanned over 3000 tracks at once yesterday without trouble, so it's not about list size. Unrelated question: Is it intentional that you decode entire track and not just short snippet from it?

That's interesting about the playlist size. What file formats are your songs in grimes and Case? Also what are the sample rates, bit depth, number of channels, etc?

Only a short audio snippet (10 seconds) is used for a single BPM estimate, but that BPM estimate may be inaccurate. So to help ensure the correct BPM estimate is made, multiple 10 second snippets are taken from the song at different points and the BPMs calculated. So it may seem like the whole file is being decoded, but in reality it is multiple 10 second chunks of the file that are being decoded. So yes, it is by design

Reason unknown, but by right-clicking on a track in playlist, it won't show up. In beta 5.

It's probably under Legacy Commands. I'll fix things up once the 1.0 SDK is out.
Title: foo_bpm
Post by: Case on 2009-12-23 17:38:44
All my files were 44.1 kHz 16 bit stereo FLACs.
Title: foo_bpm
Post by: grimes on 2009-12-23 17:42:29
44100/16/Stereo
In my opinion the mix of bpm-tagged and untagged tracks and big playlist size makes the problem.
I had also no problems yesterday with 1389 and 3531 bpm-untagged tracks
Title: foo_bpm
Post by: Sylph on 2009-12-23 19:46:46
It's probably under Legacy Commands. I'll fix things up once the 1.0 SDK is out.


Thanks!

I searched for it in the Legacy Commands, but it's not there. I can wait.
Title: foo_bpm
Post by: fraganator on 2009-12-24 01:41:13
Perhaps the component didn't load at all. Does it show up under the component list in the preferences window?
Title: foo_bpm
Post by: fraganator on 2009-12-24 13:18:39
44100/16/Stereo
In my opinion the mix of bpm-tagged and untagged tracks and big playlist size makes the problem.
I had also no problems yesterday with 1389 and 3531 bpm-untagged tracks

I've just finished testing a couple of playlists, both with a number of pre-BPM tagged files/albums. One list was about 1200 files and another with a bit under 2000. The BPM scan finished successfully in both cases without freezing, so I'm unsure of the cause of the problem you saw.

When you say the component hangs, is it the BPM analysis window progress bar that freezes? Or does foobar hang completely?

The code for the next release has been refactored a fair bit, including the logic for handling whether to skip a BPM tagged file. If you could try reproduce the problem with that release (should be out in the next day or two), that'd be very helpful. If the problem still persists, I may send you a build with some debugging info to help narrow down the cause.
Title: foo_bpm
Post by: fraganator on 2009-12-24 14:45:45
Version 0.1.1 has been released. See the first post of this thread for details.
Title: foo_bpm
Post by: Jack Schmaltz on 2009-12-24 15:44:03
thanks for the update
Title: foo_bpm
Post by: neothe0ne on 2009-12-25 01:25:19
Would it be possible to have this component behave similarly to ReplayGain in UI?  As in, you scan the file(s), then you get a dialog window where you can see the results and choose whether or not to save the BPM tags.

This also gets around the problem of scanning a read-only file and getting an error message at the end because the tags can't be changed.
Title: foo_bpm
Post by: fraganator on 2009-12-25 02:26:05
Future changes:
- Add a confirmation dialog after a BPM scan has completed before writing the values to the files (similar to ReplayGain). Here would be the option to double/halve individual calulated BPMs if need be

Title: foo_bpm
Post by: 2E7AH on 2009-12-30 06:42:18
I posted about bpm and some other tags here (http://www.hydrogenaudio.org/forums/index.php?showtopic=75753), and while I had the table with me I compared and added also foo_bpm to it:
(http://img259.imageshack.us/img259/9458/bpm.th.png) (http://img259.imageshack.us/img259/9458/bpm.png)

btw, beaTunes uses same Ray Shooting algorithm as in OP link (Werner)

Title: foo_bpm
Post by: fraganator on 2009-12-30 15:57:27
Thanks for the info 2E7AH, and doing up that nifty chart. It's nice to see how foo_bpm fits in with other bpm scanners. By the looks of things it can certainly be improved! Is there a list of correct (manually calculated) bpms for the songs in that list?

I'm close to releasing version 0.2.0 which will include confirmation dialogs (ala ReplayGain), and in the event that the calculated bpm is wrong, a dialog for manually tapping out the bpm. The configuration parameters for the bpm algorithm will also be included, so hopefully things can be tweaked to determine the best parameters for the widest range of music.
Title: foo_bpm
Post by: 2E7AH on 2009-12-30 16:33:52
Yeah, I should have tapped them before posting such lists.
But also tracks are known, except I guess two binaural beat artists which maybe should be there

Adding configurable parameters is great idea (thou I don't know the algorithm;)
Title: foo_bpm
Post by: Jack Schmaltz on 2009-12-30 17:23:39
looking forward to the features in the next update fraganator, finding this component very useful indeed
Title: foo_bpm
Post by: fraganator on 2009-12-30 18:55:44
Version 0.2.0 is out. Please let me know if you have any questions regarding the algorithm parameters, or if you find any bugs
Title: foo_bpm
Post by: 2E7AH on 2009-12-31 07:05:36
some major improvements, it really looks great now, and I haven't seen any BPM analyzer with such configurable options
BPM precision is just so obviously useful, and while I tweaked all parameters for one album BPM detection, it seems that default values are tuned best
about changing granularity of detected BPM, it can be achieved only by changing min/max range of calculated BPM, right?

and manual tapping is just cute (and best way to do BPM). makes we want to write mainBPM, subBPM or start/endBPM... 
what is "tap to average", which is reseted anyway if changed?

I guess that implementation of those two algorithms (rayshoot, finalscratch) from OP, means that we'll have option to choose which one we want to do BPM in the future?

[edit] can somewhere be added option for halving/doubling BPM result?
[edit2] eh, it's in OP future changes as point 1, just now I saw it
Title: foo_bpm
Post by: fraganator on 2009-12-31 17:54:06
about changing granularity of detected BPM, it can be achieved only by changing min/max range of calculated BPM, right?

When you say granularity, are you referring to the precision of the BPM result? ie. 125 vs 125.39?

Quote from: 2E7AH link=msg=0 date=
what is "tap to average", which is reseted anyway if changed?

The manual tapping calculation keeps a moving average of the last "Taps To Average" values. So in the default case, the BPM calculated from the manual tapping takes the average of up to the last 30 taps. This helps to smooth out any user errors with clicking in time, and any error arising from the precision of the system software timer (due to interrupts, events, etc)

I believe you've found a bug for the Taps To Average value always being reset. I shall release a fix for it in the next couple of days.

Quote from: 2E7AH link=msg=0 date=
I guess that implementation of those two algorithms (rayshoot, finalscratch) from OP, means that we'll have option to choose which one we want to do BPM in the future?

Yes, that's the plan  I was also thinking of implementing a voting scheme where each BPM algorithm is run on a file, and then the results are voted on and the most common BPM is selected.
Title: foo_bpm
Post by: 2E7AH on 2009-12-31 19:18:14
Nice

about granularity I was thinking about beat frequency that are considered in detection, i.e. main beat is generally reported as BPM value, but there are layer of beats that can be considered also
example: Plastikman - Plasticity, main beat is 125 sublayer is 190 and combined together go above 250
Title: foo_bpm
Post by: Steve Forte Rio on 2010-01-01 11:09:52
Big thank you for your plugin. Happy New Year! 


(http://audiophilesoft.ucoz.ua/misc/bpm.png)

But why does there is a double in the list of components?
Title: foo_bpm
Post by: fraganator on 2010-01-01 17:46:12
Version 0.2.1 is out. It contains a number of fixes for the reported bugs. Thanks for everyone's feedback!
Title: foo_bpm
Post by: q-stankovic on 2010-01-01 18:09:23
You forgot one bug fix! 

In the "Manually tap BPM ..." window you can tap either with mouse on big tap button or with spacebar. But once you have reseted BPM the spacebar activates the "Reset BPM" button: To get it working again you have firstly to click in tap button.

I played around with this component. How expected stuff like Psytrance is calculated accurately and many Hip-Hop tracks are calculated with double BPM. I then changed the "Calculated BPM (Min/Max)" settings to match the range of Hip-Hop and because of that the correct (means: halved) BPM is calculated. I am fascinated about that feature and am looking forward to the feature to set different presets based on genre tag.

However i have some questions to the other parameters: If i increase the number of "Seconds per Sample" and/or "Samples per Song" then the scanning will take more time. But does increasing these settings also mean that the result will automatically become more accurate?

Thanks for foo_bpm, i always looked for a bpm counter (http://www.hydrogenaudio.org/forums/index.php?showtopic=46216) that is able to handle all file types, not only mp3.

EDIT
Out of curiosity: How do you plan to integrate the "Manually tap BPM ..." window into scan result window. Right click a song and playback starts automatically?
Title: foo_bpm
Post by: fraganator on 2010-01-01 18:29:11
In the "Manually tap BPM ..." window you can tap either with mouse on big tap button or with spacebar. But once you have reseted BPM the spacebar activates the "Reset BPM" button: To get it working again you have firstly to click in tap button.

Oops, I didn't notice that. I'll fix it for the next release.

However i have some questions to the other parameters: If i increase the number of "Seconds per Sample" and/or "Samples per Song" then the scanning will take more time. But does increasing these settings also mean that the result will automatically become more accurate?

It doesn't guarantee that the results will be more accurate, but I've found increasing those values can make the difference between a correct and incorrect bpm result. I currently use 20 & 20 for those values and it does seem to improve results for a few tracks.

Out of curiosity: How do you plan to integrate the "Manually tap BPM ..." window into scan result window. Right click a song and playback starts automatically?

I haven't thought that far ahead yet. I'll have a think about the best way to do it and what makes sense. My next priority is improving the current bpm algorithm, and then implementing some of the other bpm algorithms.
Title: foo_bpm
Post by: q-stankovic on 2010-01-01 18:37:26
I haven't thought that far ahead yet. I'll have a think about the best way to do it and what makes sense.


Just a quick idea that is simple and clean: right click song -> "Play" -> Using just spacebar to avoid additional window -> result shown in extra column.
Title: foo_bpm
Post by: MedO on 2010-01-01 20:27:52
Changing the BPM precision changes the result for me (in big ways).  Here's a list of tracks i scanned in both "nearest 1" and "1 decimal" precisions:

151 - 150.3
159 - 119.6
126 - 189.3
175 - 175.2

The tracks are from the Machinarium Soundtrack Bonus EP, which can be downloaded for free. I didn't expect a very good rate of detection with that music, but I didn't expect these differences to appear from changing precision.
Title: foo_bpm
Post by: Nemphael on 2010-01-01 22:08:16
I tried converting some files to compare BPMs. Most of the files were originally either >192kbps or FLAC files. Original files at the top, then the corresponding converted file below. They're converted with Nero's AAC encoder at q0.19 Or ~45kbps). I also chose to compare FFT sizes of 2048 (standard, I believe?) and 8192.

Sometimes, the differences between a converted file and its original are huge. For this small set of tracks - 47 beats per minute max!


EDIT: Compared a set of FLAC files to AAC files at q0.40 and q0.20. Standard settings, using an FFT size of 2048.


(I believe spaces should be the same on all systems, compared to tabs?)
Code: [Select]
Artist                         || Title                          || BPM || Bitrate
===============================================================================
Elvis Presley                  || (Marie's the Name) His Latest  || 105 || 1007
Elvis Presley                  || (Marie's the Name) His Latest  || 105 ||  128
Elvis Presley                  || (Marie's the Name) His Latest  || 105 ||  55
Mark Knopfler & Emmylou Harris || All the Roadrunning            || 154 ||  908
Mark Knopfler & Emmylou Harris || All the Roadrunning            ||  98 ||  125
Mark Knopfler & Emmylou Harris || All the Roadrunning            || 105 ||  52
Yann Tiersen                  || Le Banquet                    || 156 ||  886
Yann Tiersen                  || Le Banquet                    || 156 ||  132
Yann Tiersen                  || Le Banquet                    || 159 ||  49
Travis                        || Closer                        || 107 ||  980
Travis                        || Closer                        || 108 ||  122
Travis                        || Closer                        || 108 ||  52
Matchbox Twenty                || Cold                          || 176 || 1130
Matchbox Twenty                || Cold                          || 176 ||  146
Matchbox Twenty                || Cold                          || 176 ||  60
Yann Tiersen                  || Comptine d'été n°17            || 173 || 1025
Yann Tiersen                  || Comptine d'été n°17            || 173 ||  134
Yann Tiersen                  || Comptine d'été n°17            || 173 ||  52
Nightwish                      || Dead Boy's Poem                || 133 ||  982
Nightwish                      || Dead Boy's Poem                || 133 ||  137
Nightwish                      || Dead Boy's Poem                || 133 ||  56
Yann Tiersen                  || La Dispute                    || 169 ||  637
Yann Tiersen                  || La Dispute                    || 166 ||  108
Yann Tiersen                  || La Dispute                    || 166 ||  40
Coheed and Cambria            || The End Complete IV: The Road  ||  93 || 1101
Coheed and Cambria            || The End Complete IV: The Road  || 139 ||  143
Coheed and Cambria            || The End Complete IV: The Road  || 139 ||  58
Nightwish                      || Ever Dream                    || 147 || 1107
Nightwish                      || Ever Dream                    || 147 ||  143
Nightwish                      || Ever Dream                    || 147 ||  59
Sigur Rós                      || Góðan daginn                  || 126 ||  965
Sigur Rós                      || Góðan daginn                  || 166 ||  138
Sigur Rós                      || Góðan daginn                  || 176 ||  53
Dire Straits                  || Going Home (Theme From Local H || 167 ||  862
Dire Straits                  || Going Home (Theme From Local H || 157 ||  127
Dire Straits                  || Going Home (Theme From Local H || 153 ||  50
Fall Out Boy                  || Grenade Jumper                || 174 || 1119
Fall Out Boy                  || Grenade Jumper                || 174 ||  146
Fall Out Boy                  || Grenade Jumper                || 174 ||  61
Fall Out Boy                  || I'm Like a Lawyer With the Way || 193 || 1143
Fall Out Boy                  || I'm Like a Lawyer With the Way || 193 ||  146
Fall Out Boy                  || I'm Like a Lawyer With the Way || 193 ||  60
Mark Knopfler                  || The Last Laugh                || 108 ||  829
Mark Knopfler                  || The Last Laugh                || 108 ||  117
Mark Knopfler                  || The Last Laugh                || 106 ||  47
Thomas Newman                  || Marine                        || 150 ||  641
Thomas Newman                  || Marine                        || 139 ||  129
Thomas Newman                  || Marine                        || 139 ||  47
Owl City                      || On the Wing                    || 115 || 1081
Owl City                      || On the Wing                    || 115 ||  142
Owl City                      || On the Wing                    || 115 ||  57
Mark Knopfler                  || One More Matinee              || 160 ||  816
Mark Knopfler                  || One More Matinee              || 162 ||  121
Mark Knopfler                  || One More Matinee              || 160 ||  47
Anberlin                      || Reclusion                      || 169 || 1112
Anberlin                      || Reclusion                      || 169 ||  141
Anberlin                      || Reclusion                      || 169 ||  58
Mark Knopfler                  || Secondary Waltz                || 152 ||  846
Mark Knopfler                  || Secondary Waltz                || 152 ||  111
Mark Knopfler                  || Secondary Waltz                || 152 ||  46
Elvis Presley                  || See See Rider                  || 144 || 1006
Elvis Presley                  || See See Rider                  || 144 ||  119
Elvis Presley                  || See See Rider                  || 144 ||  56
Coldplay                      || Strawberry Swing              || 172 ||  894
Coldplay                      || Strawberry Swing              || 172 ||  122
Coldplay                      || Strawberry Swing              || 172 ||  51
Dire Straits                  || Tunnel of Love                || 154 ||  978
Dire Straits                  || Tunnel of Love                || 156 ||  132
Dire Straits                  || Tunnel of Love                || 154 ||  52
Mew                            || Web                            || 104 ||  974
Mew                            || Web                            || 104 ||  130
Mew                            || Web                            || 104 ||  55
Title: foo_bpm
Post by: fraganator on 2010-01-02 15:52:03
Changing the BPM precision changes the result for me (in big ways).

Try unchecking "Interpolate Flux" in the preferences and see if that makes a difference.

Sometimes, the differences between a converted file and its original are huge. For this small set of tracks - 47 beats per minute max!

Thanks for the great job with testing. I think the inconsistent results for different bitrates are to do with the calculation of the 'spectral flux', or the difference between a set of frequencies at a given FFT with the set of frequencies of the previous FFT. As lossy codecs will discard certain indistinguishable frequencies, it's possible that the missing frequencies are having an effect on the spectral flux calculation, and hence the final BPM result. I'll have a look into how I can tweak this part of the algorithm to make it more robust.
Title: foo_bpm
Post by: MedO on 2010-01-02 17:29:40
Changing the BPM precision changes the result for me (in big ways).
Try unchecking "Interpolate Flux" in the preferences and see if that makes a difference.

Let me do a more complete test then:
Code: [Select]
                    | Precision=1 | Precision=0.1 | Precision=0.01  |        |
      Title        | IF=0 | IF=1 |  IF=0 |  IF=1 |  IF=0  |  IF=1  | Manual |
--------------------|------|------|-------|-------|--------|--------|--------|
The Robot Band Tune |  151 |  151 | 150.6 | 150.3 | 150.57 | 150.33 |  151  |
Pipe Wrench Dubstep |  194 |  194 | 172.8 | 172.7 | 172.58 | 172.70 |  130  |
Game In The Brain  |  160 |  159 | 119.5 | 119.6 | 119.69 | 119.56 |  120  |
Defusing The Bomb  |  189 |  126 |  95.0 | 189.3 | 188.95 |  94.89 |    95  |
By The Wall        |  175 |  175 | 175.5 | 175.2 | 175.49 | 158.66 |  120  |
------------------------------------------------------------------------------

The selected precision seems to have the same or a bigger impact on detection than the Interpolate Flux setting, which is not what I'd expect.
Title: foo_bpm
Post by: robin75 on 2010-01-03 17:51:41
... finally one of my christmas wishes came true....

thank you very much!

it works great for me after tweaking a bit the parameters.
make sure to set "Seconds Per Sample" on minimum 20 if you have slower tracks... under 80bpm.

again, thanks alot!

EDIT:
a small button which doubles or halved the automatically analysed values would be handsome.
Title: foo_bpm
Post by: soundberg on 2010-01-04 11:20:22
Just when I needed a BPM analyzer someone had just created it! 

Great plugin! Thank you for your work.

To get automatic BPM analyzing to work 100% is of course impossible, depending on what kind of music one analyzes etc. But the manual tap is there, and I'll probably just use that.

Request: a possibility to configure which key to use for manual tapping. The spacebar on my keyboard is rather "sloppy" and a bit difficult to tap with some degree of precision...

/SB
Title: foo_bpm
Post by: Yirkha on 2010-01-04 14:13:49
Request: a possibility to configure which key to use for manual tapping. The spacebar on my keyboard is rather "sloppy" and a bit difficult to tap with some degree of precision...
Or maybe simply use any key without other function there? Avoids the need of extra configuration and "just works" for everybody.
Title: foo_bpm
Post by: fraganator on 2010-01-07 07:22:51
foo_bpm 0.2.2 has been uploaded.

I've changed the selection of the final BPM from the BPM candidate list to be the mode value rather than the median. This should help in cases where the candidate list looks something like:
80.3
85.2
85.2
85.4
107.0
150.4
153.8
163.0
170.8
If the median value of the above were used, the result would be 107.0. Looking at the values though, it's more likely the BPM is around 85 which is what the mode value is. A selector for either the mode or median (or mean, though it's not recommended) has been added to the preferences.

There is also an option to output some extra debug info to the console so you can see the candidate BPMs for each song. This may help in tweaking parameters, etc.


As an aside I'm back at work this week after the Christmas break, so updates may take a little longer to get done. I'll get started on some of the bugs/requests raised thus far. Please be patient!
Title: foo_bpm
Post by: MedO on 2010-01-07 11:26:57
I did some testing with the new version and got very good results with the following parameters:

Precision: Nearest 1
Seconds per Sample: 8
Samples per Song: 50
FFT Window: Hamming
FFT Size: 128
Candidate Result: Mode

I figured it's useful to have a lot of samples if you're using the mode value, and using a small FFT value seems to improve the detection accuracy for my small test set a lot. I'm taking a shot in the dark here and guess that the detection is less influenced by small spectral differences either present in the original material or introduced by lossy encoders that way since the spectral resolution is lower.

This is only optimised for a very small set of tracks though, so it might be worse than the standard settings in general. Will continue testing
Title: foo_bpm
Post by: fraganator on 2010-01-07 14:49:12
Awesome work  Thanks for taking the time to play around and test different settings.

Great idea increasing time resolution and decreasing spectral resolution, it makes good sense to me. I just tried those values on a small playlist and they worked well. If further tests provide good results, I'll make those settings the defaults for future releases.
Title: foo_bpm
Post by: Spirit_of_the_ocean on 2010-01-09 20:22:18
I think the results are strange:
This song: Dragonforce - Through The Fire and Flames (http://www.youtube.com/watch?v=rc9_U-RBSuk) gets 99.7 (very fast song as far as i can say)
This song: Dragonforce - Trail Of Broken Hearts (http://www.youtube.com/watch?v=Gk77wRGnwZM) is a ballad and gets 144.4 
Title: foo_bpm
Post by: odyssey on 2010-01-09 20:33:32
This song: Dragonforce - Through The Fire and Flames (http://www.youtube.com/watch?v=rc9_U-RBSuk) gets 99.7 (very fast song as far as i can say)

Yeah, it's fast - 200BPM to be exact, and foo_bpm has a max of 195, hence it will detect it as 100.

This song: Dragonforce - Trail Of Broken Hearts (http://www.youtube.com/watch?v=Gk77wRGnwZM) is a ballad and gets 144.4 

Same problem. It's 72.2 BPM and the lower limit for foo_bpm is 75, so it will assume the nearest possible - 144.4.

Try to adjust the min/max values and you might get accurate results. Note that it MIGHT make other tracks wrong, since you expand the range the BPM can be in.

Edit: I couldn't make foo_bpm detech the ballad as 72.2 BPM. You might be able to tweak it otherwise to get correct results, but it might be easier to manually correct it by douling or dividing it accordingly.
Title: foo_bpm
Post by: Spirit_of_the_ocean on 2010-01-09 21:09:33
Thanks for your advice.    I will see what changes when the settings are edited.
Title: foo_bpm
Post by: Jose_Mancera on 2010-01-10 11:08:44
Has anybody been able to install this component under virtualizations such as VMWARE or WINE? I am running foobar under VMWARE FUSION without any problem, but after installing foo_bpm I get "Failed to load DLL: foo_bpm.dll" message.

P.S.: excuse my poor English.
Title: foo_bpm
Post by: fbuser on 2010-01-10 11:46:03
You probably didn't put libfftw.dll in your application folder. If you put it in the components folder move it up to the application folder.
Title: foo_bpm
Post by: Jose_Mancera on 2010-01-10 12:19:20
You probably didn't put libfftw.dll in your application folder. If you put it in the components folder move it up to the application folder.


No, that cannot be the problem. I had put it in my application folder. In fact, I have successfully installed this component in other computer running Windows XP.
Title: foo_bpm
Post by: fraganator on 2010-01-10 14:35:44
Has anybody been able to install this component under virtualizations such as VMWARE or WINE? I am running foobar under VMWARE FUSION without any problem, but after installing foo_bpm I get "Failed to load DLL: foo_bpm.dll" message.

P.S.: excuse my poor English.

You may need to install the Visual C++ 2008 runtime library (http://www.microsoft.com/downloads/details.aspx?familyid=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en).
Title: foo_bpm
Post by: Jose_Mancera on 2010-01-10 15:16:22
[/quote]
You may need to install the Visual C++ 2008 runtime library (http://www.microsoft.com/downloads/details.aspx?familyid=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en).
[/quote]

Ok, thanks for your support.
Title: foo_bpm
Post by: ledge on 2010-01-10 23:15:19
Awesome plugin! Nice work.

One thing though, can you make the confirmation dialog screen optional, i.e. allow users to set it to just go ahead and update without showing the confirmation screen (like replay-gain  )
Title: foo_bpm
Post by: fraganator on 2010-01-11 06:57:14
Version 0.2.3 has been released. It was built using the new 1.0 SDK, so requires foobar2000 1.0 to run.
Title: foo_bpm
Post by: fraganator on 2010-01-12 14:45:42
Version 0.2.4 is out. It contains only a minor bug fix to the about info in the components section of the preferences.
Title: foo_bpm
Post by: Dj kourampies on 2010-01-13 19:58:56
Trying to find the correct settings to make it accurate with no luck at all.

I ve tried every possible combination off settings, and its always off for at least 0.1BPM, usually +0.1BPM.
Title: foo_bpm
Post by: FunkyBrewster on 2010-01-16 17:57:57
Thank you for this awesome plugin!  It's a great help in organizing playlists.
Title: foo_bpm
Post by: fraganator on 2010-01-17 02:37:01
Thanks for the feedback  I'm glad people are benefiting from this component.

Trying to find the correct settings to make it accurate with no luck at all.

I ve tried every possible combination off settings, and its always off for at least 0.1BPM, usually +0.1BPM.

Try these settings:
[attachment=5654:foo_bpm_...ferences.png]

If they don't give you the desired accuracy, it's probably a result of the algorithm itself. When I find time to implement some of the other algorithms mentioned in the first post, it'll be interesting to see how they compare to one another in terms of correctness and accuracy.
Title: foo_bpm
Post by: tedgo on 2010-01-17 09:07:40
Thanks for this settings
It really works (as well as setting BPM Precision to "Nearest 1", at least for me).
Although there are still some double/halve results (tried it with music i made by myself, so i know the "real" BPMs very well ).

I haven't got that luck with the default values.
You should make your suggested settings to the default .
Title: foo_bpm
Post by: Squeller on 2010-01-17 10:49:41
Thanks for your plugin, well done AFAICS! As I became a "dancer" now in old age (I'm 37! OK, finished a first year of exercises now) it's very useful to sort my Foxtrott|Tango|Rhumba|Samba etc. stuff by speed.
BTW, you should preserve the directory structure in the zip file. I.e. the libfftw on top level and foo_bpm.dll in \components in order to make things clearer for newbies.
Can you also make your component write to file after every track? This way we can already use the tag while the component is still calculating the rest of the queue.
Another minor suggestion: The context menu entry should be "Automatically analyse BPMs" without the "...". "..." imo usually indicate, some kind of windows with user interaction will follow, but this is not the case here...
Title: foo_bpm
Post by: Nemphael on 2010-01-17 11:52:34
I agree with Squeller, it would be nice if the component could write tags while while scanning, or alternatively offer to write tags when clicking abort. There are a couple of times when I have to quit Foboar, and it would be really nice to get a "scan stopped, discard scanned BPM information? Y/N" box of some sort.
Title: foo_bpm
Post by: q-stankovic on 2010-01-17 13:40:54
Another minor suggestion: The context menu entry should be "Automatically analyse BPMs" without the "...". "..." imo usually indicate, some kind of windows with user interaction will follow, but this is not the case here...

Another point: the presence of "Manually tap BPM for current track" in context menu indicates that something will happen with selected track. I think it will be good idea either to add "BPM Tapper" (or something else) to main menu->view or to keep it in context menu but let selected track start playing.
Title: foo_bpm
Post by: Dj kourampies on 2010-01-17 20:24:23
Thanks for the feedback  I'm glad people are benefiting from this component.

Trying to find the correct settings to make it accurate with no luck at all.

I ve tried every possible combination off settings, and its always off for at least 0.1BPM, usually +0.1BPM.

Try these settings:
[attachment=5654:foo_bpm_...ferences.png]

If they don't give you the desired accuracy, it's probably a result of the algorithm itself. When I find time to implement some of the other algorithms mentioned in the first post, it'll be interesting to see how they compare to one another in terms of correctness and accuracy.


edit: its still not accurate with all tracks. it gets arounnd 50% of them right

Thanks for the tip! This settings seem to work, at least for house music.

And the debug info shows that its not having a hard time doing it. (I know this track is at 126.0 BPM)

Code: [Select]
foo_bpm: Estimated BPMs (sorted) for 01-daso_-_meine.mp3 are:
BPM 1 = 125.8000000
BPM 2 = 125.8000000
BPM 3 = 125.9000000
BPM 4 = 125.9000000
BPM 5 = 125.9000000
BPM 6 = 125.9000000
BPM 7 = 125.9000000
BPM 8 = 125.9000000
BPM 9 = 125.9000000
BPM 10 = 125.9000000
BPM 11 = 125.9000000
BPM 12 = 125.9000000
BPM 13 = 125.9000000
BPM 14 = 125.9000000
BPM 15 = 125.9000000
BPM 16 = 125.9000000
BPM 17 = 126.0000000
BPM 18 = 126.0000000
BPM 19 = 126.0000000
BPM 20 = 126.0000000
BPM 21 = 126.0000000
BPM 22 = 126.0000000
BPM 23 = 126.0000000
BPM 24 = 126.0000000
BPM 25 = 126.0000000
BPM 26 = 126.0000000
BPM 27 = 126.0000000
BPM 28 = 126.0000000
BPM 29 = 126.0000000
BPM 30 = 126.0000000
BPM 31 = 126.0000000
BPM 32 = 126.0000000
BPM 33 = 126.0000000
BPM 34 = 126.0000000
BPM 35 = 126.0000000
BPM 36 = 126.0000000
BPM 37 = 126.0000000
BPM 38 = 126.0000000
BPM 39 = 126.0000000
BPM 40 = 126.0000000
BPM 41 = 126.0000000
BPM 42 = 126.0000000
BPM 43 = 126.0000000
BPM 44 = 126.0000000
BPM 45 = 126.0000000
BPM 46 = 126.0000000
BPM 47 = 126.0000000
BPM 48 = 126.0000000
BPM 49 = 152.2000000
BPM 50 = 173.2000000
foo_bpm: Calculated BPM = 125.9625000
Title: foo_bpm
Post by: Hengest on 2010-01-18 01:45:35
Crash report: trying to analyse an mp3 that has the incorrect length reported will cause a crash.

Crash log:
Code: [Select]
Illegal operation:
Code: C0000094h, flags: 00000000h, address: 73EA22EAh

Call path:
threaded_process thread

Code bytes (73EA22EAh):
73EA22AAh:  CC CC CC CC CC CC 51 83 3D C4 5E EB 73 08 53 55
73EA22BAh:  56 57 8B F1 75 11 B8 1F 85 EB 51 F7 A6 98 00 00
73EA22CAh:  00 C1 EA 05 89 56 1C 8B 86 E0 00 00 00 2B 86 DC
73EA22DAh:  00 00 00 8B 4E 18 8B 7E 1C C1 F8 02 2B C1 33 D2
73EA22EAh:  F7 F7 40 89 86 EC 00 00 00 48 0F AF C7 03 C1 89
73EA22FAh:  44 24 10 8B 86 98 00 00 00 DB 44 24 10 DB 86 98
73EA230Ah:  00 00 00 85 C0 7D 06 DC 05 48 D4 EA 73 DE F9 8B
73EA231Ah:  C1 33 DB B9 08 00 00 00 F7 E1 DD 9E F8 00 00 00

Stack (1038F428h):
1038F408h:  00000007 FCD293F8 FFFFFD34 000002E4
1038F418h:  FFFFFD34 000002CC 00000018 00000000
1038F428h:  00000001 1038F51C 05918444 0000003C
1038F438h:  1038F51C 73EA4E23 73EE5D84 011C4BB0
1038F448h:  03C01F98 05918438 00000000 1038F4C4
1038F458h:  01078204 00000002 00000000 00000010
1038F468h:  0107833F 9999999A 3FC99999 03CF0000
1038F478h:  00000000 00000004 011C4BB0 00000000
1038F488h:  1038F5EC 1038F4A4 0870F0D8 0870F0D8
1038F498h:  00000009 00000000 0870F0D8 0870F0D8
1038F4A8h:  010E488A 011ED79C 0870F0D8 1038F51C
1038F4B8h:  011ED79C 1038F4E4 0119BF08 00000000
1038F4C8h:  73EA4777 73EE5D10 011C4BB0 03C01F98
1038F4D8h:  05918438 00000000 1038F864 73EA93BF
1038F4E8h:  FFFFFFFF 73EA5491 05918438 05918444
1038F4F8h:  73EE5D3C 05918444 05918418 1038F8B4
1038F508h:  00000000 00000000 00000001 1038F4F4
1038F518h:  1038F504 0000000A 0000000A 9999999A
1038F528h:  3FC99999 9999999A 3FE99999 00001000
1038F538h:  00000000 00000000 753C0000 00000000

Registers:
EAX: FFFFF000, EBX: 0000003C, ECX: 00001000, EDX: 00000000
ESI: 1038F51C, EDI: 00000000, EBP: 05918444, ESP: 1038F428

Crash location:
Module: foo_bpm
Offset: 122EAh
Symbol: "foobar2000_get_interface" (+110FAh)

Loaded modules:
foobar2000                      loaded at 01070000h - 01229000h
ntdll                            loaded at 77A70000h - 77BAC000h
kernel32                        loaded at 76180000h - 76254000h
KERNELBASE                      loaded at 75C40000h - 75C8A000h
COMCTL32                        loaded at 74AB0000h - 74C4E000h
msvcrt                          loaded at 75EC0000h - 75F6C000h
GDI32                            loaded at 77C50000h - 77C9E000h
USER32                          loaded at 76780000h - 76849000h
LPK                              loaded at 76620000h - 7662A000h
USP10                            loaded at 76630000h - 766CD000h
SHLWAPI                          loaded at 76B80000h - 76BD7000h
DSOUND                          loaded at 6B940000h - 6B9B2000h
ADVAPI32                        loaded at 77BB0000h - 77C50000h
sechost                          loaded at 765A0000h - 765B9000h
RPCRT4                          loaded at 766D0000h - 76771000h
ole32                            loaded at 77910000h - 77A6C000h
WINMM                            loaded at 701C0000h - 701F2000h
POWRPROF                        loaded at 744A0000h - 744C5000h
SETUPAPI                        loaded at 76950000h - 76AED000h
CFGMGR32                        loaded at 75C90000h - 75CB7000h
OLEAUT32                        loaded at 76AF0000h - 76B7F000h
DEVOBJ                          loaded at 75EA0000h - 75EB2000h
UxTheme                          loaded at 74930000h - 74970000h
SHELL32                          loaded at 76CC0000h - 77909000h
shared                          loaded at 10000000h - 1002B000h
imagehlp                        loaded at 764D0000h - 764FA000h
dbghelp                          loaded at 6C8D0000h - 6C9BB000h
COMDLG32                        loaded at 76500000h - 7657B000h
IMM32                            loaded at 76580000h - 7659F000h
MSCTF                            loaded at 76BE0000h - 76CAC000h
CRYPTBASE                        loaded at 75B10000h - 75B1C000h
CLBCatQ                          loaded at 75FB0000h - 76033000h
MMDevApi                        loaded at 74620000h - 74659000h
PROPSYS                          loaded at 74970000h - 74A65000h
dwmapi                          loaded at 74600000h - 74613000h
foo_playcount                    loaded at 00440000h - 00470000h
foo_input_std                    loaded at 02650000h - 0279D000h
foo_fileops                      loaded at 00C50000h - 00C98000h
foo_jesus                        loaded at 73B60000h - 73B87000h
foo_run                          loaded at 00CA0000h - 00CCD000h
foo_lyricsdb                    loaded at 00E20000h - 00E50000h
WININET                          loaded at 76850000h - 76944000h
Normaliz                        loaded at 765C0000h - 765C3000h
urlmon                          loaded at 76040000h - 76175000h
CRYPT32                          loaded at 75D80000h - 75E9C000h
MSASN1                          loaded at 75C30000h - 75C3C000h
iertutil                        loaded at 762D0000h - 764C9000h
foo_discogs                      loaded at 00EC0000h - 00F26000h
gdiplus                          loaded at 747A0000h - 74930000h
foo_dsp_vlevel20080302.0        loaded at 00E50000h - 00E5B000h
MSVCR80                          loaded at 6F0E0000h - 6F17B000h
foo_input_alac                  loaded at 00E70000h - 00E90000h
foo_rgscan                      loaded at 027A0000h - 027EF000h
foo_albumlist                    loaded at 02910000h - 0296C000h
foo_unpack                      loaded at 02600000h - 0262F000h
foo_cdda                        loaded at 03050000h - 0309D000h
foo_texttools                    loaded at 6D850000h - 6D884000h
foo_masstag                      loaded at 030A0000h - 030F4000h
foo_dsp_loudspeakereq            loaded at 02970000h - 0299C000h
foo_textdisplay                  loaded at 6D810000h - 6D84F000h
foo_scheduler                    loaded at 03400000h - 0349F000h
foo_facets                      loaded at 031B0000h - 03231000h
MSIMG32                          loaded at 72BF0000h - 72BF5000h
foo_musicbrainz                  loaded at 6D7B0000h - 6D80C000h
WINHTTP                          loaded at 71460000h - 714B8000h
webio                            loaded at 71410000h - 7145F000h
foo_ui_std                      loaded at 037D0000h - 038DE000h
foo_softplaylists                loaded at 6C4F0000h - 6C541000h
foo_dsp_std                      loaded at 034B0000h - 034F9000h
foo_vis_shpeck                  loaded at 6C140000h - 6C181000h
foo_audioscrobbler              loaded at 03350000h - 03381000h
foo_out_asio                    loaded at 03500000h - 03536000h
foo_freedb2                      loaded at 038E0000h - 03922000h
foo_dsp_resampler                loaded at 03950000h - 0398A000h
foo_dsp_bs2b                    loaded at 03990000h - 039B7000h
foo_bpm                          loaded at 73E90000h - 73EBD000h
libfftw                          loaded at 6BE10000h - 6BF96000h
MSVCP90                          loaded at 6E700000h - 6E78E000h
MSVCR90                          loaded at 71C30000h - 71CD3000h
foo_wave_seekbar                loaded at 6BC90000h - 6BE08000h
WS2_32                          loaded at 75F70000h - 75FA5000h
NSI                              loaded at 76CB0000h - 76CB6000h
foo_converter                    loaded at 03B70000h - 03BE0000h
foo_dop                          loaded at 040E0000h - 0427C000h
QUARTZ                          loaded at 690A0000h - 69217000h
IconCodecService                loaded at 74330000h - 74336000h
WindowsCodecs                    loaded at 744D0000h - 745CB000h
sud                              loaded at 6B760000h - 6B81B000h
ADVPACK                          loaded at 719F0000h - 71A1E000h
VERSION                          loaded at 74F40000h - 74F49000h
DUI70                            loaded at 74220000h - 742D2000h
WINTRUST                        loaded at 75CC0000h - 75CED000h
SspiCli                          loaded at 75990000h - 759AA000h
profapi                          loaded at 75BC0000h - 75BCB000h
dnsapi                          loaded at 754A0000h - 754E4000h
iphlpapi                        loaded at 74000000h - 7401C000h
WINNSI                          loaded at 73FF0000h - 73FF7000h
RASAPI32                        loaded at 74190000h - 741E2000h
rasman                          loaded at 74170000h - 74185000h
rtutils                          loaded at 74160000h - 7416D000h
sensapi                          loaded at 70BF0000h - 70BF6000h
NLAapi                          loaded at 73F90000h - 73FA0000h
rasadhlp                        loaded at 6FDC0000h - 6FDC6000h
mswsock                          loaded at 755E0000h - 7561C000h
wshtcpip                        loaded at 75110000h - 75115000h
wship6                          loaded at 755D0000h - 755D6000h
mdnsNSP                          loaded at 16080000h - 160A5000h
WLIDNSP                          loaded at 6FDD0000h - 6FDF4000h
PSAPI                            loaded at 762C0000h - 762C5000h
fwpuclnt                        loaded at 730A0000h - 730D8000h
d3d9                            loaded at 67B10000h - 67CD3000h
d3d8thk                          loaded at 715E0000h - 715E6000h
atiumdag                        loaded at 69230000h - 6952D000h
atiumdva                        loaded at 60DE0000h - 610B4000h
d3dx9_42                        loaded at 6B570000h - 6B755000h
d3dx10_42                        loaded at 6BC20000h - 6BC90000h
apphelp                          loaded at 75AC0000h - 75B0B000h
ieframe                          loaded at 669C0000h - 6743C000h
OLEACC                          loaded at 72AD0000h - 72B0C000h
ntmarta                          loaded at 74F10000h - 74F31000h
WLDAP32                          loaded at 765D0000h - 76615000h
CRYPTSP                          loaded at 75620000h - 75636000h
rsaenh                          loaded at 753C0000h - 753FB000h
RpcRtRemote                      loaded at 75BB0000h - 75BBE000h
AUDIOSES                        loaded at 73FB0000h - 73FE6000h

Stack dump analysis:
Address: 73EA4E23h (foo_bpm+14E23h), symbol: "foobar2000_get_interface" (+13C33h)
Address: 011C4BB0h (foobar2000+154BB0h)
Address: 01078204h (foobar2000+8204h)
Address: 0107833Fh (foobar2000+833Fh)
Address: 011C4BB0h (foobar2000+154BB0h)
Address: 010E488Ah (foobar2000+7488Ah)
Address: 011ED79Ch (foobar2000+17D79Ch)
Address: 011ED79Ch (foobar2000+17D79Ch)
Address: 0119BF08h (foobar2000+12BF08h)
Address: 73EA4777h (foo_bpm+14777h), symbol: "foobar2000_get_interface" (+13587h)
Address: 011C4BB0h (foobar2000+154BB0h)
Address: 73EA93BFh (foo_bpm+193BFh), symbol: "foobar2000_get_interface" (+181CFh)
Address: 73EA5491h (foo_bpm+15491h), symbol: "foobar2000_get_interface" (+142A1h)
Address: 753C0000h (rsaenh+0h)
Address: 77B47340h (ntdll+D7340h), symbol: "NlsAnsiCodePage" (+1F0h)
Address: 77ACB4AAh (ntdll+5B4AAh), symbol: "RtlInitializeExceptionChain" (+118h)
Address: 73EAC4A8h (foo_bpm+1C4A8h), symbol: "foobar2000_get_interface" (+1B2B8h)
Address: 73EAC550h (foo_bpm+1C550h), symbol: "foobar2000_get_interface" (+1B360h)
Address: 73EAC4C8h (foo_bpm+1C4C8h), symbol: "foobar2000_get_interface" (+1B2D8h)
Address: 77A70000h (ntdll+0h)
Address: 01130A00h (foobar2000+C0A00h)
Address: 77AB64D8h (ntdll+464D8h), symbol: "RtlUserThreadStart" (+0h)
Address: 73EA93EBh (foo_bpm+193EBh), symbol: "foobar2000_get_interface" (+181FBh)
Address: 01130AA6h (foobar2000+C0AA6h)
Address: 10002778h (shared+2778h), symbol: "uPrintCrashInfo_OnEvent" (+B0h)
Address: 011C4A7Ch (foobar2000+154A7Ch)
Address: 0119D490h (foobar2000+12D490h)
Address: 01130A37h (foobar2000+C0A37h)
Address: 0119B0F9h (foobar2000+12B0F9h)
Address: 761D1174h (kernel32+51174h), symbol: "BaseThreadInitThunk" (+12h)
Address: 77ACB3F5h (ntdll+5B3F5h), symbol: "RtlInitializeExceptionChain" (+63h)
Address: 761E2B35h (kernel32+62B35h), symbol: "UnhandledExceptionFilter" (+0h)
Address: 761E2B35h (kernel32+62B35h), symbol: "UnhandledExceptionFilter" (+0h)
Address: 77A8D74Dh (ntdll+1D74Dh), symbol: "RtlAddMandatoryAce" (+5B1h)
Address: 77ACB3C8h (ntdll+5B3C8h), symbol: "RtlInitializeExceptionChain" (+36h)
Address: 01130A00h (foobar2000+C0A00h)
Address: 01130A00h (foobar2000+C0A00h)

Environment:
App: foobar2000 v1.0
OS: Windows 6.1.7600 x86
CPU: Intel® Core™2 Duo CPU    T7700  @ 2.40GHz, features: MMX SSE SSE2 SSE3
Audio: Headphones (Realtek High Definition Audio); Speakers (9- M-Audio Transit)
UI: Default User Interface 0.9.5

Components:
Core (2010-01-09 19:47:00)
    foobar2000 core 1.0
foo_albumlist.dll (2010-01-09 19:44:46)
    Album List 4.4
foo_audioscrobbler.dll (2009-08-20 22:15:56)
    Audioscrobbler 1.4.2
foo_bpm.dll (2010-01-12 22:36:55)
    BPM Analyser 0.2.4
foo_cdda.dll (2010-01-09 19:44:42)
    CD Audio Decoder 3.0
foo_converter.dll (2010-01-09 19:44:32)
    Converter 1.4
foo_discogs.dll (2009-08-22 20:04:56)
    Discogs Tagger 1.20
foo_dop.dll (2009-12-27 23:06:53)
    iPod manager 0.6.6.4
foo_dsp_bs2b.dll (2009-06-08 12:30:06)
    bs2b 3.1.0
foo_dsp_loudspeakereq.dll (2009-07-02 08:52:58)
    Loudspeaker Equalizer 1.0.1
foo_dsp_resampler.dll (2009-07-29 03:01:58)
    SoX Resampler 0.5.4.1
foo_dsp_std.dll (2010-01-09 19:44:48)
    Standard DSP Array 1.0
foo_dsp_vlevel20080302.0.dll (2008-03-03 00:42:06)
    VLevel 20080302.0
foo_facets.dll (2008-05-09 17:56:28)
    Facets 2008-02-25
foo_fileops.dll (2010-01-09 19:43:32)
    File Operations 2.1.2
foo_freedb2.dll (2010-01-09 19:43:34)
    freedb Tagger 0.6.2
foo_input_alac.dll (2009-03-22 15:15:46)
    ALAC Decoder 1.0.3
foo_input_std.dll (2010-01-09 19:44:24)
    Standard Input Array 1.0
foo_jesus.dll (2010-01-03 13:41:18)
    Autosave & Autobackup 8
foo_lyricsdb.dll (2009-10-05 12:35:38)
    foo_lyricsdb 0.0.8 beta 0
foo_masstag.dll (2009-09-18 10:01:36)
    Masstagger 1.8.4
foo_musicbrainz.dll (2009-04-11 04:27:28)
    MusicBrainz Tagger 0.2
foo_out_asio.dll (2009-03-22 15:15:46)
    ASIO support 1.2.7
foo_playcount.dll (2009-04-29 20:09:32)
    Playback Statistics 2.1.9
foo_rgscan.dll (2010-01-09 19:44:24)
    ReplayGain Scanner 2.0.9
foo_run.dll (2009-03-27 22:49:54)
    Run services 0.3.6
foo_scheduler.dll (2009-08-17 22:32:40)
    Scheduler 3.54
foo_softplaylists.dll (2009-12-31 08:34:51)
    Soft Playlists 2009-12-30.2
foo_textdisplay.dll (2008-07-08 19:45:26)
    Text Display UI Element 1.0 RC 3
foo_texttools.dll (2009-12-23 21:00:22)
    Text Tools 1.0.4
foo_ui_std.dll (2010-01-09 19:44:52)
    Default User Interface 0.9.5
foo_unpack.dll (2010-01-09 19:43:20)
    RAR reader 1.3
    ZIP/GZIP reader 1.0
foo_vis_shpeck.dll (2009-09-28 17:32:16)
    Shpeck - Winamp vis plugins wrapper 0.3.7
foo_wave_seekbar.dll (2010-01-17 07:11:28)
    Waveform seekbar 0.1.10

Recent events:
Autoplaylists initialized in: 0:00.020274
"All Music" : 0:00.020183
Startup time : 0:02.852441
Seekbar: taking Direct3D9 path.
Seekbar: Frontend initialized.
Autobackup: Backed up 89 items to autobackup.20100118-093121.zip
Opening track for playback: "C:\Users\David\Desktop\Wish You Well.mp3"
Wave cache: finished analysis of "C:\Users\David\Desktop\Wish You Well.mp3"
Audioscrobbler: Handshake successful.
foo_bpm: End of file found! Chunk sample rate is 0.
Title: foo_bpm
Post by: MedO on 2010-01-18 20:45:30
Attempting to detect BPM on a stream also causes foobar to crash (tried e.g. on http://demovibes.de:8000/necta192.mp3 (http://demovibes.de:8000/necta192.mp3)). I don't expect it to actually work of course
Title: foo_bpm
Post by: gpglang on 2010-01-18 21:05:51
THIS IS GREAT!
I Have looked for this (and as I can recall also suggested some time ago here) for Foobar for so long.
I love Foobar as it does everything I basically need to listen to music and prepare myself for DJ-ing. 
But I needed something like MusicInKey (http://www.mixedinkey.com) for BPM and Key information for harmonic mixing.  No, I am not that experienced!
Downside to M.i.K it only supports WAV and MP3 format where in my situation I prefer FLAC most: best quality/compression and supported by Ableton. 
I have not found it yet, but I do hope foo_bpm will support all formats Foobar supports...  That would really be AWESOME!!!!
At least BPM is now fixed.  I will try your tool asap when I am at home and compare it to (in DJ-ing world the professional) mixedinkey results

Guido

PS. To make it "easy" for you, most BPM calculaters have some issues in half/double results on the lower and higher BPM counts.

PS2... anybody for a treat to do the Key information in Foobar?
Title: foo_bpm
Post by: robin75 on 2010-01-19 08:08:18
thanks for the double/halve button, love it!
Title: foo_bpm
Post by: sti3 on 2010-01-24 19:52:50
Love this plugin.  Thanks for your work!

Noob question--how would I make a hotkey to autmatically analyze the bpm of the currently playing track?

Also, for manual tapping, IMO it would be nicer to have the "update tag" button automatically close the dialog after updating.
Title: foo_bpm
Post by: MedO on 2010-01-24 20:18:30
Also, for manual tapping, IMO it would be nicer to have the "update tag" button automatically close the dialog after updating.


If you want to manually check the BPM of several tracks in one go it's nice to have the dialog stay open. Maybe an additional "Update & Close" button would work.
Title: foo_bpm
Post by: sti3 on 2010-01-24 20:26:40
Also, for manual tapping, IMO it would be nicer to have the "update tag" button automatically close the dialog after updating.


If you want to manually check the BPM of several tracks in one go it's nice to have the dialog stay open. Maybe an additional "Update & Close" button would work.


Good point.  I just started using it so my MO has been play track, autocalc bpm, and if number seems way off, manually tap, so I've been doing it one by one.

How about automatically calculate on new track and no %bpm% found!
Title: foo_bpm
Post by: robin75 on 2010-02-01 10:58:43
hi there,
i have some problem with my portable version of foobar and foo_bpm.
after copying the complete folder to my other notebook, there is a error coming: "side-by-side configuration..." foo_bpm could not be loaded.

any help on this?

thank you very much!

Title: foo_bpm
Post by: fraganator on 2010-02-01 13:10:34
I suspect the other notebook has a different visual studio runtime than the one you copied it from, or some other similar dependency. I'll recompile foo_bpm to statically link to the necessary components and see if that fixes things.

In the mean time, you could try deleting the foo_bpm config from the configuration folder under foobar2000, though I don't know if that would make a difference.
Title: foo_bpm
Post by: robin75 on 2010-02-01 13:25:03
I suspect the other notebook has a different visual studio runtime than the one you copied it from, or some other similar dependency. I'll recompile foo_bpm to statically link to the necessary components and see if that fixes things.


great! i tried several things: my original OS is xp professional, the "clone" works on a other xp home and on windows 2009 server, but not on vista. next days i can try windows 7.


In the mean time, you could try deleting the foo_bpm config from the configuration folder under foobar2000, though I don't know if that would make a difference.


if i just delete the two dll and install new, the problem still exist. "deleting the foo_bpm config from the configuration folder" how?

thank you very much!!!
Title: foo_bpm
Post by: fraganator on 2010-02-01 13:30:12
OK, I've recompiled it as a statically linked dll. Please download it and let me know how it goes - download here (http://www.hydrogenaudio.org/forums/index.php?act=attach&type=post&id=5701)

If you're using foobar2000 1.0, you can go into the foobar2000/configuration folder and delete foo_bpm.dll.cfg
Title: foo_bpm
Post by: robin75 on 2010-02-01 16:06:47
OK, I've recompiled it as a statically linked dll. Please download it and let me know how it goes - download here (http://www.hydrogenaudio.org/forums/index.php?act=attach&type=post&id=5701)

it goes super well!
thank you very much for this quick help. absolutely perfect!


Quote
If you're using foobar2000 1.0, you can go into the foobar2000/configuration folder and delete foo_bpm.dll.cfg

ahhh.. of course.
Title: foo_bpm
Post by: fraganator on 2010-02-02 05:23:24
it goes super well!
thank you very much for this quick help. absolutely perfect!

Cool, good to know it works now  I'll be sure to statically link any future updates so no-one else runs into the problem down the track.
Title: foo_bpm
Post by: Keesface on 2010-02-02 15:57:14
It would be nice to be able to load presets, so configurations for different types of music can be shared easily. Is this possible?
Title: foo_bpm
Post by: fraganator on 2010-02-02 16:01:04
It's definitely planned for a future version. The presets will also be (optionally) automatically applied to a song based on the GENRE tag.

I haven't touched foo_bpm for a while as I've been busy on a new component, but will continue work on it soon.
Title: foo_bpm
Post by: odyssey on 2010-02-17 15:17:11
Have you considered making a component to scan for key? That would be truly awesome together with this!
Title: foo_bpm
Post by: fraganator on 2010-02-17 15:23:12
Estimating the key wouldn't be too much of a stretch from how foo_bpm already works, so I'll certainly consider it. Once the major kinks have been worked out of foo_component_manager, I want to return to foo_bpm and continue improving and adding to it, so I'll look into key estimation then.
Title: foo_bpm
Post by: odyssey on 2010-02-17 15:29:49
 I'm speechless! Thanks for your work, it's highly appreciated!
Title: foo_bpm
Post by: megapeng09 on 2010-02-22 17:59:42
I have a suggestion regarding the layout of the confirmation dialog.

[span style='color:#000000;background:#000000']

PS. I registered here about 10 mins ago just so I could make this post. That's how awesome foo_bpm is

PPS. Paint ftw
Title: foo_bpm
Post by: --pv-- on 2010-02-22 21:11:49
I do also love this component.
Please consider these requests:
1) Ability to store results into the library or along with the file statistics. Imagine I don't want to get my files overwritten.
2) Ability to use the tab key to navigate in the results and manual scan dialogs.
Title: foo_bpm
Post by: fraganator on 2010-02-23 02:16:24
Thanks for the feedback guys  It's great to know you enjoy the component. I'll make a note of your requests for future updates.
Title: foo_bpm
Post by: blargblarg on 2010-03-27 16:31:16
Thank you!!! Very nice!!!!

Now all that's needed is a foo_key to mimic what Mixed In Key does.
Title: foo_bpm
Post by: blargblarg on 2010-03-27 17:45:34
Here's my small suggestion:
Option to auto-write tags as you go, say after every 10 or something... Why? Because I tried to run it on about 2000 tracks and it had an error somewhere, and all was lost.
Title: foo_bpm
Post by: blargblarg on 2010-03-28 00:09:40
Could you explain what these settings do a bit?

One result was too low (95 rather than 144):
Setting FTT Size to the lowest value got the right result.

Other was too high (160 rather than 120):
Setting FTT Size to the highest value got it right (but takes a long time!).
BUT, changing the rounding to nearest .1 gave 119.8... seems a problem with the rounding or algorithm somewhere. It should round at the very end no?

Maybe the surest way is to calculate it with lowest and highest for all tracks, then check discrepancies for which one is right?

I'm curious what the other FFT Modes are, or if changing Slide will have some noticeable effect.

>> All tracks you selected already have BPM... this is a useless warning, better to ask if SOME tracks have BPM whether to overwrite or not (or make it/warning a setting).
Title: foo_bpm
Post by: MedO on 2010-03-28 09:02:19
fraganator isn't working on these components any more, at least for a while. See this post for details:

http://www.hydrogenaudio.org/forums/index....mp;#entry694581 (http://www.hydrogenaudio.org/forums/index.php?showtopic=78708&st=150&p=694581&#entry694581)
Title: foo_bpm
Post by: fraganator on 2010-03-28 13:38:56
I hope to return to foo_bpm in a month or so, but for now I'm on a break as per doctor's orders
Title: foo_bpm
Post by: Stuart60611 on 2010-03-29 16:22:59
Now to make this component real useful, what we need is a crossfading plugin for foobar that uses the BPM data to determine how to most smoothly crossfade between tracks.  This combination would be great.
Title: foo_bpm
Post by: odyssey on 2010-03-29 19:16:34
Now to make this component real useful, what we need is a crossfading plugin for foobar that uses the BPM data to determine how to most smoothly crossfade between tracks.  This combination would be great.

YESSSSS!!!!!!!!!!!!!!! That would be so cool. I know iTunes has it.

Well... and a key-detector and a good implementation of moodbar or something similar  Maybe even something Moodagent-like.

And finally a rule-based playlist generator that can put tracks in proper order to ensure key/bpm/mood to be consistent all way through.
Title: foo_bpm
Post by: q-stankovic on 2010-03-29 19:30:30
Well, i would like to see such a crossfader that could persuade me that a origin human accomplishment like mixing could be replaced by a automatical procedure - but i am sure that won't happen. I can imagine that synchronicity between the ending of a track and the beginning of another could be achieved. But wouldn't it then be just a boring gimmick? For mixing rock songs the usual crossfader is good enough and mixing electronic music with a bpm-determined crossfader will surely make us to laugh.
Title: foo_bpm
Post by: odyssey on 2010-03-29 20:11:58
Well, i would like to see such a crossfader that could persuade me that a origin human accomplishment like mixing could be replaced by a automatical procedure - but i am sure that won't happen. I can imagine that synchronicity between the ending of a track and the beginning of another could be achieved. But wouldn't it then be just a boring gimmick? For mixing rock songs the usual crossfader is good enough and mixing electronic music with a bpm-determined crossfader will surely make us to laugh.

It will never be nearly as good as a human mixer, but for casual electronic music listening it could be pretty cool in addition to a generic crossfader. However, with radio edits, rock, pop or other unmixable content, a bpm-aware crossfader could still come in handy, to ensure that the first beat of the mixing track wits with the last beat of the fading track. Sometimes, when using Continuator, a new track laps in too quickly.

Also my proposal for a way to make automatic playlists could simply be a helper for DJ's to find good mixable songs for their manual sets.
Title: foo_bpm
Post by: blargblarg on 2010-03-29 22:59:55
I hope to return to foo_bpm in a month or so, but for now I'm on a break as per doctor's orders

When u do, first thing should be fixing this crash... if the flac file is corrupt it crashes foobar. 
Title: foo_bpm
Post by: Stuart60611 on 2010-03-30 16:29:10
It will never be nearly as good as a human mixer, but for casual electronic music listening it could be pretty cool in addition to a generic crossfader. However, with radio edits, rock, pop or other unmixable content, a bpm-aware crossfader could still come in handy, to ensure that the first beat of the mixing track wits with the last beat of the fading track. Sometimes, when using Continuator, a new track laps in too quickly.

Also my proposal for a way to make automatic playlists could simply be a helper for DJ's to find good mixable songs for their manual sets.



Speaking of continuator, I noticed that the newest version is 0.6.1.  Is that compatiable with fooobar 1.0?  Also, where can you download this version.  I can only find very old 4.0 versions.  Thanks.
Title: foo_bpm
Post by: Mark7 on 2010-04-18 15:57:08
I've never used a bpm meter before but i installed this one just for fun. And it is fun . Here are my findings while playing with it:

- the manual tap works on button release. I think it would be better it works right away on button press.
- maybe create an option for seperate automatical tags and manual tags
- it gets confused by almost all Katie Melua songs (some are too slow and all are lacking good reference beats, i guess)
Title: foo_bpm
Post by: fraganator on 2010-04-20 13:54:41
To celebrate my almost complete recovery, I'm back in the programming saddle and have released version 0.2.4.1. It fixes a few bugs, and adds a context menu for halving/doubling BPMs. Hopefully some more exciting features will be added in the coming weeks!

Quote from: Mark7 link=msg=0 date=
- the manual tap works on button release. I think it would be better it works right away on button press.

Great suggestion, I wouldn't have picked up on it otherwise.
Title: foo_bpm
Post by: Jack Schmaltz on 2010-04-20 14:25:23
thanks for the update fraganator, glad to hear your on the right side of well again now
Title: foo_bpm
Post by: dtronvig on 2010-04-25 23:30:43
Hey fraganator,

First off, this is brilliant software, and it almost always agrees with the tempo I hear on a track. Sometimes, of course, it'll report a BPM twice what I think is the BPM for dancing purposes, but for a lot of tracks the tempo is subject to interpretation anyway. What you hear as 200 BPM I may hear as 100 BPM. Kinda depends how you want to dance to it. If you're looking at disco or house, say, there isn't much ambiguity about the tempo in the boob-boom-boom rhythm line. When you get into more complex rhythms, you can have rhythmic stuff going on at, say, 100 BPM and within that at 200 BPM, and as a dancer you could focus on either one or the other, or mix it up. If you're always dancing within a range of 80-120 BPM it's an easy call, and you've provided for that.

I'm DJ'ing for blues dancing, which is a very inclusive scene, musically and dancewise. We play music with tempos ranging from about 50 to 200 BPM, though of course you're doing much different stuff at 200 than at 50. With that kind of range, reasonable people might sometimes differ on whether the dominant rhythm for some track is at 100 or 200. I'll sometimes resort to assigning a BPM of "100+" to a song that feels to me mostly like 100 BPM, but that's busy enough that you could find a 200 BPM tempo in it, if that's where you want to go. Or correspondingly "200-". When things are ambiguous, I generally listen for a recognizable backbeat and figure that it counts as the second of two beats. There can still be sort of secondary backbeats between those beats, but at least it's a start.

Now, it isn't a whole lot of trouble for us to decide if our notion of the tempo is half, same or twice the BPM reported by foo_bpm, and it's great that you include the option to easily adjust BPM's accordingly. But if you really want foo_bpm to guess right more often, I'd suggest trying to distinguish backbeats from downbeats, to come up with the BPM that'll mostly match what people hear as the tempo.

I'm not going to attempt to understand your algorithm for identifying beat patterns, but I think it may be fairly straightforward to distinguish backbeats from downbeats. When you hear a boom-chk-boom-chk rhythm in popular music, the downbeat "boom" is generally laid down by the kick drum and/or bass, while the backbeat "chk" will generally be a sharper sound from, say, a snare or small tom-tom. Or comparable electronic instruments. I've been messing around with some parametric filters, and in most of the music I've tried those on you can generally capture the downbeats using a bandpass filter centered around 50-60 Hz, or a low pass filter that's down about 10dB at 200 Hz. You can typically isolate backbeats with a bandpass filter centered at about 500 Hz, dropping out the deeper downbeats as well as any cymbal beats, which can be very regular but which don't necessarily correspond to either downbeats or backbeats. So if you really want to invest the effort, you could try applying those filters and look for alternating downbeats and backbeats. Then see if a revised version of foo_bpm reports the tempo you hear more often than the current one.

Thanks very much for this component, and have fun widdit,
Drew
Title: foo_bpm
Post by: fraganator on 2010-04-26 02:15:53
Hi Drew,

Thanks for the great post. I know exactly what you're talking about with dominant/backbeats in music. I've been listening and DJing with a lot of dubstep recently and the tempo is either 70 or 140 bpm depending on how busy things sound, but there's always a snare or clap on every second beat if you 'listen at' 70 bpm. Same goes for drum'n'bass which can either be 85 or 170 bpm depending on how you want to hear or dance to it.

I like you idea of filtering the input to try and capture the backbeat. Currently the algorithm tries to weight the sound similarly to how we perceive it, with higher frequencies receiving a higher weight (up to the frequency that is half of the FFT window size). A second or alternative filter like you've suggested could be added in there. I'll have a look into it
Title: foo_bpm
Post by: Stuart60611 on 2010-04-28 20:50:43
This is a great component, but I am trying to understand its utility with foobar.  Without a crossfading plugin that uses the BPM data to crossfade between tracks, what value is there to assigning a BPM tag to a track.  I guess you can attempt to play songs consecutively which have similar BPM tags in an attempt to make smooth transitions between songs.  Otherwise, I do not understand the value of this tag.  Am I missing something?
Title: foo_bpm
Post by: tai on 2010-09-25 01:27:18
I think I found another bug--this forum seems really quiet though so i don't know if there are any further updates on this.

I set my foobar to detect the BPMs of two albums, and as the process was running I went through and cleaned up all of the tags. When the BPM analysis finished, I wrote the BPM data to the tags, but it also reset all my tags to what they were when I started cleaning the files! and now I have to go through and clean up all the tags again.
Title: foo_bpm
Post by: Marschant on 2010-11-04 11:51:05
Also my proposal for a way to make automatic playlists could simply be a helper for DJ's to find good mixable songs for their manual sets.


This !!! I'm holy about tagging genre as well as new field subgenre, helps me string together potential sets using autoplaylists, random pools and playlist tree mod based on genre/subgenre/rating then dropping the tweaked playlist into traktor, in about 25% of the cases the bpm is detected correctly however I have to redetect within traktor (to 3 decimals!) to get the beat grids lined up for my 4/4 deep house sets.

It's starting to pay-off, foobar is the shit!
Title: foo_bpm
Post by: q-stankovic on 2010-11-04 20:21:42
marschant, it was odyssey who wrote that!
Title: foo_bpm
Post by: jmccrohan on 2011-01-06 22:27:29
Thanks for a great plugin.

Would it be possible to rewrite it to scan multiple items at one, similar to ReplayGain?

This would take advantage of multicore processors.
Title: foo_bpm
Post by: Mad Ad on 2011-02-02 14:55:12
Impressive plugin, seems to work fine except for one thing, I cant read the BPM tag it makes in Windows 7.  I can see it in the player, but not in windows.

Ive tried changing the tag it writes to Beats-per-minute as thats what it says in windows, but that didnt work and there isnt a tag simply called BPM to choose.  Thing is, some of my tunes already have Beats-per-minute tags that do show up in the field in windows, but the only way I can make it appear there is by right clicking the mp3, going properties and manually putting it in.

Am I doing something wrong? Thanks a lot.
Title: foo_bpm
Post by: curiouser on 2011-03-13 04:33:42
First, thank you very much fraganator for filling this important niche with a very nice implementation!  I noticed that tempo influences me a lot on certain gym equipment, so I installed it to build playlists with consistent tempos - not as glamorous as DJing, but personally very gratifying.

When tagging hundred songs, you're faced with a large BPM Analysis Results list to verify whether to double/halve before writing the tags to file.  I wonder if this results window could be a little more flexible?  My first impulse is to sort by BPM, so that I can visually skim the track names to find any outliers compared to their neighbors.  This way I wouldn't have to read the BPM and track name of every row, only for tracks that stand out.  Also, if it's easy to add window resizing/maximizing, that might be useful. 

As it is, I'm updating the file tags as-is, then verifying them in the main GUI.  I've added the BPM column into the main GUI and sorted by it.  Along with a quick visual check (What is  and I'm now playing from fastest to slowest, using the builtin crossfader DSP with a large (4+sec) overlap and checking songs one by one. 

Again, thanks!
Title: foo_bpm
Post by: Twitch29 on 2011-05-30 03:56:24
Hi guys, I'm new to all thing foo and am currently clambering up that learning curve to get things set up as I want them. Loving it so far. Wish I had made the switch a long time ago!

Anyway, first off, let me thank fraganator for all his hard work. And secondly, give you all some results from a little playing around I've done.

I used the two Lily Allen albums to test. No reflection on my musical tastes, they were just the first thing I thought of that had varied BPM and some possible troublesome tracks.  FLAC files with f00_bpm, and ALAC with beaTunes.

Code: [Select]
Track                           Manual | beaTunes     | foo_bpm                          | foo_bpm
                                1      | 2      3     | 4     5      6      7      8     | 9
---------------------------------------|--------------|----------------------------------|--------
Smile                           95.6   | 95.3   95.3  | 190   190.3  95.1   95.4   95.5  | 95.5
Knock 'Em Out                   130.5  | 64     128   | 159   159.6  159.6  159.9  64    | 64
LDN                             100.5  | 50.1   100.1 | 100   99.6   99.6   100    100   | 100
Everything's Just Wonderful     157.7  | 79     79    | 79    78.7   78.7   78.9   79    | 79
Not Big                         102.6  | 51     102   | 102   101.7  101.7  101.9  101.9 | 101.9
Friday Night                    128.9  | 63.8   127.6 | 127   127.1  127.1  127.5  63.8  | 63.8
Shame for You                   74.3   | 74     74    | 147   147.5  73.8   147.9  74    | 74
Littlest Things                 82.7   | 82     82    | 82    81.7   81.7   81.9   82    | 82
Take What You Take              100.4  | 100    100   | 100   99.7   99.7   99.9   100   | 100
Friend of Mine                  82.6   | 164    82    | 163   81.7   81.7   81.9   82    | 82
Alfie                           120.3  | 120    120   | 120   119.5  119.5  119.9  120   | 120
                                       |              |                                  |
Everyone's At It                117.1  | 117    117   | 78    116.6  116.6  116.9  116.9 | 116.9
The Fear                        134.2  | 67     134   | 89    133.5  133.5  133.9  133.9 | 133.9
Not Fair                        121.7  | 121.5  121.5 | 121   121.1  121.1  121.4  121.4 | 121.5
22                              131.2  | 131    131   | 75    130.5  70.8   130.9  65.5  | 65.5
I Could Say                     124.8  | 124    124   | 124   123.6  123.6  123.9  62    | 62
Back To The Start               140.3  | 70     140   | 140   78.6   70.0   70.1   70    | 70
Never Gonna Happen              71.9   | 71.5   71.5  | 142   142.5  142.5  142.9  142.9 | 142.9
Fuck You                        130    | 130    130   | 129   129.5  129.5  129.9  65    | 65
Who'd Have Known                85.2   | 84     84    | 84    83.7   83.7   83.9   84    | 84
Chinese                         72.3   | 143    71.5  | 95    95.1   71.3   142.9  142.9 | 142.9
Him                             96.3   | 96     96    | 191   95.7   95.7   95.9   96    | 96
He Wasn't There                 70.8   | 70.7   70.7  | 76    76.1   75.9   141.3  141.6 | 141.3    
---------------------------------------|--------------|----------------------------------|--------



1. Manual Tap. I use the underlying tempo. What I consider to be the head nod, foot tap, shake that arse beat that people would use. This defo gives better results when used in smart playlists. As has already been pointed out, you often need to double up, or halve the suggested BPM.

2. beaTunes, Rayshoot, auto range, highest quality, don't use online resources. This is spot on apart from the need to double/halve some tracks.

3. beaTunes. As above but with a range of 70-140 bpm. Even better results. Only "Everything's Just Wonderful" needs changing, and that's down to personal preference.

4. foo_bpm with default setting, 6 tracks are way off.

5. As above but with precision set to 1 decimal place. This is better, only 4 are off.

6. As above, with a range of 70-160 bpm. Only 3 off now

7. Next I doubled the seconds per sample and samples per song up too 20 each, and halved the FFT size to 1024. Only 1 wrong now, the troublesome "Knock 'Em Out"...

8. Fiddled around with lots and lots of small changes. Many of them fixed the problem track, but broke others. The above config, with Seconds per Sample up to 30, Min Sample Offset down to 10%, Max Sample Offset up to 90%, and Min BPM down to 60 finally gave a result I can live with.

And finally, I decided to check out performance with lossy files. beaTunes with AAC .75 VBR and LAME -V0 worked well. Identical results as test 2, so no point adding them to the chart.

9. foo_bpm, same config as test 8, AAC .75 VBR. Virtually identical results. I'll forgive one or two tenths of a beat in a couple of files

10. As above, with LAME -V0 files. Same results as test 9, so won't bother adding them to the chart.


Conclusion: It's looking very promising but is a bit too much like hard work at the mo. Whatever beaTunes are doing works for me. Just wish I didn't have to transcode to ALAC and back.

Title: foo_bpm
Post by: addawd on 2011-06-22 07:52:45
anyone know a foo_run command that would scan the bpm of every track that is played, because it crashes if i try t oscan large batches
Title: foo_bpm
Post by: deucalion on 2011-08-23 22:51:57
Twitch29, thank you very much for your insightful post!

The information you provide makes me wish Foobar2000 and/or foo_bpm could use both cores of my CPU... ;-)

Hi guys, I'm new to all thing foo and am currently clambering up that learning curve to get things set up as I want them. Loving it so far. Wish I had made the switch a long time ago!
[...]
Conclusion: It's looking very promising but is a bit too much like hard work at the mo. Whatever beaTunes are doing works for me. Just wish I didn't have to transcode to ALAC and back.

Title: foo_bpm
Post by: Neutron Pong on 2011-09-02 15:13:53
Hey Twitch29 (and anyone else interested):
As of the latest version of beaTunes, they've added partial OGG and FLAC support. It's only partial because their miniplayer is a little dodgy, but the analysis tools (to include BPM analysis) work just fine. To wit: http://help.beatunes.com/discussions/quest...ac-support-mean (http://help.beatunes.com/discussions/questions/156-what-does-partial-flac-support-mean)
Title: foo_bpm
Post by: Foobarphile on 2011-10-07 13:16:52
I did many tests. I got the best results with the following parameters :

Seconds per sample : 30
Samples per track : 6
Sample offset min : 33%
Sample offset max : 67%
BPM min : 75
BPM max : 180
FFT Window : gaussian
FFT size : 256

I compared the results with the EXACT bpm of multiple tracks. I used the graphic vizualisation of FL Studio and checked if peaks stayed on the grid.
Title: foo_bpm
Post by: radianter on 2011-12-04 21:46:45
GREAT WORK! I registed this ID for support you!

suggest:
It will be better if the BPMs can be normolized between 60~180.(I prefer if the min and max value can be set by user)

Question:
1.Is this component still in development?
2.the default tag name is "BPM", it's wonderful that can be modified by user. I noticed that BPM tags written by iTunes is "TEMPO" and the value is "XXXXX BPM". Which format is most standard?
Title: foo_bpm
Post by: Twiggeh on 2012-03-11 18:29:55
So, im using this plugin to add a BPM-tag to my musicfiles : http://wiki.hydrogenaudio.org/index.php?ti...lyser_(foo_bpm) (http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Components/Automatic_BPM_Analyser_(foo_bpm))
And i have a BPM-column to show the BPM in my playlist (to the left in the image) - http://s17.postimage.org/r0dfgqu1p/ololol.png (http://s17.postimage.org/r0dfgqu1p/ololol.png)

Tho, right now i have to rightclick and select scan for all my files - which is just an OUTRAGE!
I need this to be automated, so how can i tell fb2k to automatically run the file through the BPM-plugin when it gets added to the playlist? (the process should preferably happen in the background, i dont want to be aware of the process).
Title: foo_bpm
Post by: c_j_bolt on 2012-05-17 18:02:38
Can I ask a question of anyone who has successfully compiled the source for this project?

I have set myself up with the current release of the foobar SDK, an install of WTL80 and the source code for foo_bpm version 0.2.4.1.

I can compile the SDK projects just fine, but I'm finding that foo_bpm gives errors in the ATL_Helper includes - specifically surrounding an ATL macro MSG_WM_THEMECHANGED defined in atlcrack.h

I'm new to component development and ATL, but am experienced in SW development. Is this problem because there is some disparity between the 'version' of ATL required for the current SDK ATL Helpers and the foo_bpm source?

Anyone? I'm tearing my hair out on this...

EDIT: FIXED - needed to define for _WINNT to the correct version - my bad...
Title: foo_bpm
Post by: c_j_bolt on 2012-05-17 22:07:26
Ok, I just cannot get foo_bpm to link as a DLL from the source code. Has anyone else managed to do this?
Title: foo_bpm
Post by: Lee James on 2012-11-27 14:01:17
Hi there,

I really love this plugin. I just have two problems. First, I have tried to set up a button to activate this plugin (the button is assigned based on the context menu command), but when I press the button nothing happens!

My second problem is not going to be a big surprise: simply that it doesn’t work for many tracks. Sometimes when I increase the sample size to 15 seconds, or increase the number of samples to 15, it will then work. But many times it doesn’t work even when I increase both fields to 20. Often the tempo will be bafflingly way off (and I'm not just talking about half or double).

Does this plugin detect rhythms at different frequencies? If not, I would suggest that it should. It should scan different frequency ranges for rhythms and compare all of these with each other, rather than just detecting one bpm per sample.

I would also like to suggest that 75 is a bit high for the default minimum BMP. Loads and loads of songs are in the 60BPM range.

One other little suggestion: if you're manually tapping and you miss a beat, this affects the overall BMP for a while. I think the plugin should recognise that if a tap occurs more than 150% later than the currently established interval then this is likely a missed beat and analysis should resume when the next tap is pressed.

Oh, one final thing: this is probably way too advanced for the scope of this plugin, but when you "correct" the plugin and manually set a value by tapping or otherwise, might it somehow be possible for the plugin to then analyse the track, knowing the true bmp, in order to "learn" how to detect BMPs better? Sorry, this is getting a bit too ambitious, probably. Just a thought, anyway!
Title: foo_bpm
Post by: Lee James on 2012-11-27 16:50:23
One more thing to add to my above post…

I would love to select whole albums and let this plugin work out the BPMs for every track… but I’d be worried that this information might not be accurate. Let’s face it, many of the songs would have the wrong BPM.

One solution (perhaps) is this… when the plugin finds the BPM of a track, is it possible for it to also return a value for how “certain” it is of the BPM? So 95% means it is almost certain the BPM is correct, whereas 20% means the plugin struggled to find a clear BPM and it may be wrong. If this value is (optionally) written to another tag, then the user could review these afterwards and may decide to check over the ones with low scores. Or, the option could be to simply add a tag “BPMuncertain = 1” when this certainty is below a specified percentage. Or, optionally, it simply does not write BPM tag data for any results when the certainty is below a specified percentage?

Just a few ideas. Thanks for the plugin!
Title: foo_bpm
Post by: MedO on 2012-11-27 18:59:06
One more thing to add to my above post…

I would love to select whole albums and let this plugin work out the BPMs for every track… but I’d be worried that this information might not be accurate. Let’s face it, many of the songs would have the wrong BPM.

One solution (perhaps) is this… when the plugin finds the BPM of a track, is it possible for it to also return a value for how “certain” it is of the BPM? So 95% means it is almost certain the BPM is correct, whereas 20% means the plugin struggled to find a clear BPM and it may be wrong. If this value is (optionally) written to another tag, then the user could review these afterwards and may decide to check over the ones with low scores. Or, the option could be to simply add a tag “BPMuncertain = 1” when this certainty is below a specified percentage. Or, optionally, it simply does not write BPM tag data for any results when the certainty is below a specified percentage?

Just a few ideas. Thanks for the plugin!


Wouldn't that be like... Metametadata?
Title: foo_bpm
Post by: gaikokujinkyofusho on 2012-12-17 18:06:31
Hi, At the risk of seeming a bit clueless i wanted to ask about foo_BPM's compatibility with foobar v1.1.13 or v1.1.18. I tried installing it, then tried just putting it in the component director etc and every time when i start up foobar it gives me this:

Failed to load DLL: foo_bpm.dll
Reason: This component is missing a required dependency, or was made for different version of foobar2000.

soooo, i see people are still posting in 2012 so still using it (perhaps on older versions of foobar? hopefully not); is this a known issue? (with a known fix?).

Any thoughts on this would really be appreciated as I love foobar (and there don't appear to be any other options for analyzing the bpm for OGG or FLAC).

Cheers,

-Gaiko
Title: foo_bpm
Post by: raysar on 2013-02-04 10:55:49
Thank you to the developper
Title: foo_bpm
Post by: EpicForever on 2013-02-04 20:18:13
Hi, At the risk of seeming a bit clueless i wanted to ask about foo_BPM's compatibility with foobar v1.1.13 or v1.1.18. I tried installing it, then tried just putting it in the component director etc and every time when i start up foobar it gives me this:

Failed to load DLL: foo_bpm.dll
Reason: This component is missing a required dependency, or was made for different version of foobar2000.

soooo, i see people are still posting in 2012 so still using it (perhaps on older versions of foobar? hopefully not); is this a known issue? (with a known fix?).

Any thoughts on this would really be appreciated as I love foobar (and there don't appear to be any other options for analyzing the bpm for OGG or FLAC).

Cheers,

-Gaiko


You need this file: "libfftw.dll" inside your foobar2000 directory. Not inside "components" folder but inside main program directory - alongside with foobar2000.exe, uninstall.exe and few other DLLs.  This file should be bundled in zip file with foo_bpm.dll.
Title: foo_bpm
Post by: tigerchen on 2013-06-13 09:22:52
Hello,
great tool, but please let file modification timestamp unchanged?
what i mean is.
1. save then "file modified timestamp". Info MSDN (http://msdn.microsoft.com/en-us/library/ms724926%28v=vs.85%29.aspx)
2. change and save the tag "bpm" in the audio file.
3. restore the saved "file modified timestamp".Info MSDN (http://msdn.microsoft.com/en-us/library/ms724205%28v=vs.85%29.aspx)
Thanks in advance
Title: foo_bpm
Post by: marc2003 on 2013-06-13 09:53:05
the component most likely uses the foobar core to tag files. and i'm almost certain that will never do what you're asking.

Leaving the file modification date untouched when updating a file does not make any sense. Doing so would violate Windows conventions. It is intended to keep track of the last time a file has been changed, and nothing else.


you may cite other programs that do it but the likely response will be to go and use those instead.
Title: foo_bpm
Post by: EpicForever on 2013-09-01 15:31:00
Is there a light of hope that this plugin will be still developed? It crashes way to often and it doesn't benefit from multithreading... it is so slow nowadays...
Especially crashes occur when for example FLAC stream is corrupted even if audio MD5 is OK.
Title: foo_bpm
Post by: marc2003 on 2013-09-01 15:37:53
from the developer's profile page...

Quote
Last Seen: 18th May 2012 - 01:52


Title: foo_bpm
Post by: EpicForever on 2013-09-01 15:50:11
Well, he has left the sources, maybe someone else with programming skills would be able to help... Ah, again I can only ask question "why I am not a programmer but sound engineer instead" - more work, better salary, possibility to handle own computer problems using own plugins/apps... Eh...
Title: foo_bpm
Post by: mudlord on 2014-02-10 22:20:12
Quote
Is there a light of hope that this plugin will be still developed? It crashes way to often and it doesn't benefit from multithreading... it is so slow nowadays...
Especially crashes occur when for example FLAC stream is corrupted even if audio MD5 is OK.


Elaborate.
Title: foo_bpm
Post by: foosion on 2014-02-11 03:06:22
The crashes probably come from the complete lack of exception handling in the worker thread. I couldn't sleep so I gave this a little overhaul. You can get foo_bpm 0.2.4.2 (https://github.com/stengerh/foo_bpm/releases/tag/v0.2.4.2) on GitHub.

It shouldn't crash anymore for those damaged FLAK files. There should be an error message in the console instead.
Title: foo_bpm
Post by: tedgo on 2014-02-11 08:24:20
Thanks for this update
Are you planning to offer it on the official components page at foobar2000.org so it could be easily updated through Preferences/Components in foobar2000?
(I ask because i maintain the component links at the german foobar-users forum and possible further updates can be more easily found at the components page )
Title: foo_bpm
Post by: EpicForever on 2014-02-11 17:34:03
Thanks foosion a lot !!
And thanks mudlord for bumping

In addition: I tried old trick with running 2 separate BPM analysis for 2 diffferent ranges of files. Result is as it was in most cases in the past... Crash.
Title: foo_bpm
Post by: foosion on 2014-02-11 19:30:44
I cannot reproduce that, EpicForever. Which settings do you use? Does it happen only with specific file formats?
Title: foo_bpm
Post by: lvqcl on 2014-02-11 19:43:45
AFAIK fftw_plan_r2r_1d() and fftw_destroy_plan() are not guaranteed to be thread-safe.
Title: foo_bpm
Post by: EpicForever on 2014-02-11 20:01:11
I use foo_bpm for various MP3 (mostly webshops encoded 320kbps) and FLAC files (my own CD-DA rips, WEB WAV -> FLAC transcodes).  It happens to all of them. Most noticeable crashes occured for example on some slightly corrupted FLAC streams (where stream itself was corrupted, but audio was OK accordingly to MD5).

My settings:
(http://imageshack.com/a/img854/3199/853u.jpg)

Most probably taken from forum and tweaked a bit.
Title: foo_bpm
Post by: mudlord on 2014-02-11 20:53:08
AFAIK fftw_plan_r2r_1d() and fftw_destroy_plan() are not guaranteed to be thread-safe.


In that case, change to something that is, like KISSFFT or ooura.
I was working on my own beat detection plugin as a replacement to this, seems thats no longer needed.
I suppose I could implement fraganator's BPM algorithm, too.
Title: foo_bpm
Post by: foosion on 2014-02-11 21:24:27
In that case, change to something that is, like KISSFFT or ooura.
I was already considering this, given that FFTW is licensed under the GPL.

I was working on my own beat detection plugin as a replacement to this, seems thats no longer needed.
I'll only do technical maintenance on foo_bpm. I am not interested in tweaking the algorithm. So feel free to fork my foo_bpm repo on Github. I could also give you push rights.
Title: foo_bpm
Post by: mudlord on 2014-02-11 21:27:37
In my own component, I have two different algorithms, one from SoundTouch, another from another source. Since fraganator's algorithm is under the WTFPL, I suppose I can implement that, too.

My component is 100% multithreaded, so it computes files just like how the official ReplayGain component does threading. (each song has its own worker thread)
Title: foo_bpm
Post by: foosion on 2014-02-12 01:33:05
Nice. foo_bpm does several (i.e. a configurable number of) passes over the same track. It seems to keep some parameters the same, but varies others. I wonder if this could be done during a single pass over the track.

By the way: foo_bpm 02.4.3 (https://github.com/stengerh/foo_bpm/releases/tag/v0.2.4.3) should eliminate further reasons for crashing.
Title: foo_bpm
Post by: tedgo on 2014-02-12 08:21:21
Thanks, but now i get this error message:
Quote
Failed to load DLL: foo_bpm.dll
Reason: This component is missing a required dependency, or was made for different version of foobar2000.

The libfftw.dll is present in the foobar2000 main directory.
Does it now belongs to another directory? Or is another dll needed now?
Title: foo_bpm
Post by: foosion on 2014-02-12 10:41:24
Oops, I forgot to put the libfftw3-3.dll into the archive. Please re-download.
Title: foo_bpm
Post by: tedgo on 2014-02-12 11:13:53
Thanks
Title: foo_bpm
Post by: mudlord on 2014-02-13 19:49:47
EpicForever, is this what you meant by multithreaded beat detection?

*deleted, not ready for primetime*

Quote
I wonder if this could be done during a single pass over the track.


What I was thinking is that fraganator's algorithm could be threaded like my component, while still allowing scanning of multiple audio segments per file.
Title: foo_bpm
Post by: EpicForever on 2014-02-13 20:11:45
WOW !! that was a quick bomb. And I see that accuracy is very good. Al least in Trance music - there's no need of halving or doubling BPMs. I haven't tested it on other music yet. I can't compare scanning times directly as your component does not write anything to console

OK, but how about writing values to tags? I can't find them in my files...
Title: foo_bpm
Post by: mudlord on 2014-02-13 20:32:05
It doesn't write to tags yet, nor to %bpm% titleformat syntax values. Those will be done when its officially made public.
Title: foo_bpm
Post by: tedgo on 2014-02-13 20:38:09
@mudlord
Wow, what a fast calculation
Unfortunately i tested it with some of my own composed music files (where i know the exact bpm's) and only 1 of 4 was detected with the correct bpm...
(synthpop files)

EDIT: But don't worry: the foo_bpm with default settings has detected all files with halfed or doubled bpm
(with "corrected" settings the half of my files where detected correctly, the other half with doubled bpm...)
Title: foo_bpm
Post by: EpicForever on 2014-02-13 20:40:14
Can't wait for this  I'll still be using foo_bpm for tapping BPMs - it is done nicely there. But it seams that foo_beatit will be my automatic bpm calculation rocket
Title: foo_bpm
Post by: mudlord on 2014-02-13 20:40:31
Yeah, the algorithm may be fast, but it has faults. SoundTouch also has faults. Personally I haven't tried fraganator's BPM component yet.
Title: foo_bpm
Post by: foosion on 2014-02-14 00:25:04
What I was thinking is that fraganator's algorithm could be threaded like my component, while still allowing scanning of multiple audio segments per file.

My impression of fraganator's is that is does the following (for a configurable value of 3):
Code: [Select]
decode -> analysis_1 \
decode -> analysis_2  | -> aggregate
decode -> analysis_3 /

What I think should be possible is:
Code: [Select]
           / analysis_1 \
decode -> |  analysis_2  | -> aggregate
           \ analysis_3 /

I will have to take a closer look at the core algorithm but it was my impression that there are N independent analysis passes over the same data. If you could reduce this as pictured you would get parallel data flow. Of course this could be combined with parallel control flow to allow concurrent processing of multiple tracks.
Title: foo_bpm
Post by: mudlord on 2014-02-14 01:01:48
I looked at the source, and it does what you describe in your second example (seeks to each portion to be BPM checked, per analysis segment. It doesn't reopen the decoder ), although it should still be threadable (multiple tracks at a time), which still will be a huge improvement.

edit: uploaded a completely untested kissfft class for foo_bpm
Title: foo_bpm
Post by: Anakunda on 2014-02-15 08:40:18
Is bpv 0.2.4.1 the latest update?
After I installed foobar seems unstable (always on startup one random plugin fails to load).
This version looks also pretty old which may be on cause.
Title: foo_bpm
Post by: hgodzillay on 2014-02-18 13:47:52
thx so much for this component !
last version was crashing my foobar alot but i can't do without it hope it's now ok
Title: foo_bpm
Post by: mudlord on 2014-02-19 11:20:49
Is bpv 0.2.4.1 the latest update?
After I installed foobar seems unstable (always on startup one random plugin fails to load).
This version looks also pretty old which may be on cause.


https://github.com/stengerh/foo_bpm/releases/tag/v0.2.4.3 (https://github.com/stengerh/foo_bpm/releases/tag/v0.2.4.3)
Title: foo_bpm
Post by: Anakunda on 2014-02-19 11:32:53
https://github.com/stengerh/foo_bpm/releases/tag/v0.2.4.3 (https://github.com/stengerh/foo_bpm/releases/tag/v0.2.4.3)

Thank U! But plugins fail to load even with updated version. Dunno which plugins interference this might be.
Title: foo_bpm
Post by: mudlord on 2014-02-19 11:38:54
Probably missing FFTW. Does your download include libfftw3-3.dll?

I made a additional FFT method available to foo_bpm, but I'm not sure if foosion has integrated it, which removes the need for extra DLLs.
Title: foo_bpm
Post by: foosion on 2014-02-19 12:13:50
The required DLL for FFTW should be part of the latest release. I started integrating KISS FFT but this is not part of a released version. So far I worked on some regression tests to make the transition as smooth as possible.
Title: foo_bpm
Post by: lvqcl on 2014-02-19 14:59:37
Thank U! But plugins fail to load even with updated version. Dunno which plugins interference this might be.

http://www.hydrogenaudio.org/forums/index....howtopic=103210 (http://www.hydrogenaudio.org/forums/index.php?showtopic=103210)
Title: foo_bpm
Post by: foosion on 2014-02-19 23:34:52
foo_bpm 0.2.4.4

This version uses KISS FFT so the license issue with FFTW is resolved. I implemented a naive wrapper for KISS FFT which means the computation is not as fast as it could be but it is easy to see that the output is in the the same format as that of FFTW. This is subject to change in future versions.

I have also uploaded this version to the official components page so it should be available via the built-in update function.
Title: foo_bpm
Post by: Crashing Bore on 2014-02-28 22:10:03
This is a brilliant plugin, and I really love it, mostly for the simplicity of the design which makes it open to be exploited by many different workflows.
I like to tap out to confirm bpm myself, but having a baseline bpm presented, the doubling and halving options, and the facts that the dialogs are non-modal allows me to look at the bpm detection list, run manual tap validation whilst playing the original track in foobar (Add in the preview plugin and updating/verifying track bpm is a doddle compared to any other method I've discovered.)
Perfect. I could kiss you.

One thing (surely flattery gets me some points ::grin ) I would like to see added is the ability to update the BPM tags without changing the filedate of the file.  This keeps 'new music' lists reliant on the filedate in order, while allowing the modified date to be updated and trigger rescans in libraries that watch modified date rather than filedate.

This is available as an option in the lyricsgrabber plugin, which is also very useful (in combination with the preview file plugin) for auto tagging lyrics into files.

Even if you do nothing more, I would just like to say a BIG thankyou thankyou thankyou. This is a wonderful, flexible, and fit for task tool.

The bore.
Title: foo_bpm
Post by: mneimeyer on 2014-04-30 01:38:51
I just added a bunch of FLAC files to my foobar2K 1.3.2 library. Using foo_bpm 0.2.4.4 I tried to tag the new files and nothing gets written to the files.

I can see the analysis window popup and when I enable the write debug messages to console I can see that the calculation is done... but, again, nothing actually gets added to the file.

I also tried an MP3 file just in case this was FLAC specific but that didn't help.

Any thoughts on what to check next?

Thanks!
Title: foo_bpm
Post by: foosion on 2014-04-30 08:48:26
What exactly happens when you click the "Update files" button in the result dialog? Are there any error messages on the console?
Title: foo_bpm
Post by: romor on 2014-04-30 13:15:14
I believe @mneimeyer has set "Writes tags automatically" in BPM analyzer preferences, in which case nothing is written to files, although files are being analyzed.
Unchecking that checkbox is working solution for me.

About operation progress in Windows taskbar icon - it cycles on every analyzed track, instead showing overall progress. I don't know if this is how foobar implements this feature, or component should assign right progressbar for taskbar icon?
Title: foo_bpm
Post by: foosion on 2014-04-30 13:29:20
Regarding the progress bar: The component uses the primary progress bar for each track and the secondary progress bar for the whole scan. It would be easy to reverse this in the code. Unfortunately, my computer at home is broken and haven't found the time to fix it and re-install everything.

Added issue on GitHub (https://github.com/stengerh/foo_bpm/issues/1).
Title: foo_bpm
Post by: mneimeyer on 2014-04-30 20:19:15
I believe @mneimeyer has set "Writes tags automatically" in BPM analyzer preferences, in which case nothing is written to files, although files are being analyzed.


That is correct. With "Write tags automatically" checked then nothing is added to the files even though it is clearly (looking at the console) finding/calculating the values.

Unchecking that checkbox is working solution for me.


Huh... I wouldn't have thought of that. You are correct. If I uncheck "Write tags automatically" then I get a popup with what will be written. If I click in that window to update then it does in fact update all the files.

So it appears to be only the automatic writes that are failing.

Thanks!





Title: foo_bpm
Post by: foosion on 2014-06-18 19:59:02
foo_bpm 0.2.4.5

Fixed automatic tag writing. Also integrates patches by fraganator to switch primary and secondary progress bars. The taskbar icon should now reflect total progress instead of per-file progress.
Title: foo_bpm
Post by: EpicForever on 2014-06-19 11:45:59
Dear foosion,
Could you explain me what are the current differences between foo_beatit and foo_bpm?

Maybe it will be easier for you to answer these questions:
- is foo_bpm multithreaded?
- is foo_bpm configurable in the way that it was before you took maintenance over this component?
- does accuracy of calculations changed compared to older versions?
- how about possibility of doubling/halving results and writing tags (it seems to be bit broken in foo_beatit) - is it present, does it work properly?
- can I write tech info into console?
Title: foo_bpm
Post by: foosion on 2014-06-19 12:34:01
I have done some maintenance work on foo_bpm. This means I fixed some bugs, restructured the code and replaced the used FFT library due to licence issues. I have also done cosmetic changes to the UI. The answers to your questions are as follows.

- is foo_bpm multithreaded?
No.
- is foo_bpm configurable in the way that it was before you took maintenance over this component?
You can configure exactly the same thing, I only changed the layout of the preferences page.
- does accuracy of calculations changed compared to older versions?
It should be the same. I haven't changed the calculations in foo_bpm itself. The change from FFTW to Kiss FFT may cause minor numerical differences.
- how about possibility of doubling/halving results and writing tags (it seems to be bit broken in foo_beatit) - is it present, does it work properly?
It should work like before.
- can I write tech info into console?
I haven't changed anything in this regard.
Title: foo_bpm
Post by: EpicForever on 2014-06-19 18:59:49
Thank you for clear answers
Do you plan to add multithreaded calculations to this component sometime in the future? Lack of this functionality was always a pain... I had to wait so long to have results for all files in a row. That's why currently I switched to foo_beatit - it calculates BPMs simultaneously using all cores of my CPU. This causes that I have to wait nearly six times shorter to have results
Of course I understand voluntary character of work of all programmers involved in foobar's core and plugins and I don't require any strong promises  . I just ask for information if you are considering adding such option or no.
Title: foo_bpm
Post by: foosion on 2014-06-19 19:58:48
I have no such plans at the moment. My motivation was mainly to fix the crash bugs and to leave the code in a better shape for anyone else who might want to work on it.
Title: foo_bpm
Post by: q-stankovic on 2014-06-19 20:41:26
Could you change a little thing nevertheless, foosion? For me the component would be perfect if "Manually tap for bpm" invoked from context menu would start playing the selected track rather than be directed to the now playing track. For the latter purpose the same called command could be provided by main menu -> playback ->.

That's anyway more logical too.
Title: foo_bpm
Post by: EpicForever on 2014-06-22 13:14:33
I have one more question regarding possibility of multithreaded work - is it possible with current version to separately run several concurrent analysis threads? You know - I mark 6 files and run BPM analysis, while it runs I choose another six files and run BPM analysis for them simultaneously and so on. I tried that in the past with "original" foo_bpm. Sometimes it worked but mostly plugin was crashing foobar after less than half minute... So has it changed or not?
Title: foo_bpm
Post by: lvqcl on 2014-06-22 13:38:59
Just try and see?
Title: foo_bpm
Post by: EpicForever on 2014-06-22 19:26:28
Changing component (uninst + inst and the same again to get back to foo_beatit) + waiting for crash (or no) + the fact that all those files which should have BPMs already have them... + at the moment I don't have much time for my own experiments.
All above causes that it's better to ask than try
Title: foo_bpm
Post by: foosion on 2014-06-23 11:33:29
g-stankovic: I have created an issue (https://github.com/stengerh/foo_bpm/issues/4) so this won't be forgotten.

EpicForever: The known crash bugs were fixed as was menioned earlier in this topic. There is no distinct change log available as of now but the release list on GitHub (https://github.com/stengerh/foo_bpm/releases) provides some information.
Title: foo_bpm
Post by: Forfit on 2014-06-23 11:40:52
I prefer tiny single file version.
Title: foo_bpm
Post by: foosion on 2014-06-24 20:51:17
foo_bpm 0.2.4.6

The tag progress window is now shown with a delay. If the tag update is fast enough, the window is not shown at all. Secondly, the component now uses the recommended API for tag updates in all cases. This primarily affects the "Halve BPM" and "Double BPM" context menu commands.
Title: foo_bpm
Post by: Z4g5r on 2014-06-27 20:58:46
Hi. Here's a couple of things to consider for the future version:

A. Component needs an option which would disable the annoying 'All tracks you have selected already have BPM info. Would you like to scan them anyway?' popup.

B. Whenever I go through the album to manually set BPMs (music in some genres, e.g. Rhythmic Noise, rarelly gets analyzed properly) I have to press Reset BPM after each track to restart the count. I suggest another through-menu-enabled option that would auto-reset the count to 0 whenever the Update File button is pressed. Also, if this is implemented, it would be more convenient to swap Reset BPM and Update file buttons like this:

(http://i.imgur.com/jugWQUk.jpg)

C. Double and Halve BPM buttons should probably be included in manual bpm analysis window, too.

And D. There are cases when analyzed bpm values are same throughout the track. Then there are cases when several to all of values vary - either the track has bpm changes or it simply has no beats, it's ambient music. I suggest that if more than X end-values per track vary(controlled in cfg menu), the BPM is set to 0. Also, the result window could contain a column showing how much different values were calculated per track. For example, if 9 of them were 125 and the 10th was 130, the value in the column would say 2.
Title: foo_bpm
Post by: zaede on 2014-06-29 09:00:20
Thanks a lot for updating foo_bpm.

If i use "Manual BPM Calculation" and the window would close after updating, than foo_bpm would be
perfect for me.

Greez Zäde.



Title: foo_bpm
Post by: q-stankovic on 2014-06-29 19:25:54
C. Double and Halve BPM buttons should probably be included in manual bpm analysis window, too.
Why? 

however, i think the manual bpm detection needs some polishing. F.e: In the result windows i can double or halve easily the bpm count, but i am not able to call the manual detection function from it when i estimate that the result is totally wrong
Title: foo_bpm
Post by: mooter on 2014-07-01 14:08:23
Forgive my ignorance, but I can't find the updated file.  The first post leads to 2.4.1, and your foosion page doesn't have it at all.  I'm currently on 2.4.4.
Title: foo_bpm
Post by: marc2003 on 2014-07-01 14:20:02
http://www.foobar2000.org/components/view/foo_bpm (http://www.foobar2000.org/components/view/foo_bpm)
Title: foo_bpm
Post by: foosion on 2014-07-01 14:25:09
mooter: You can get the latest version from the official components site (http://www.foobar2000.org/components/view/foo_bpm) or a specific version from the releases page on GitHub (https://github.com/stengerh/foo_bpm/releases).

Everyone else: I noted your suggestions. I will create separate issues to track them.
Title: foo_bpm
Post by: foosion on 2014-07-05 16:30:13
Everyone else: I noted your suggestions. I will create separate issues to track them.
Done (https://github.com/stengerh/foo_bpm/issues). I have added comments where I think further clarification or research are required. Feel free to post comments here or on GitHub.
Title: foo_bpm
Post by: geistvater on 2015-02-02 20:46:12
Everyone else: I noted your suggestions. I will create separate issues to track them.
Done (https://github.com/stengerh/foo_bpm/issues). I have added comments where I think further clarification or research are required. Feel free to post comments here or on GitHub.


Hi there, sorry if I'm reviving an old thread.

I have been using vanilla foobar forever but just got around to searching for such a bpm tool and found it today.  I have what is perhaps a nooby question but is it possible to add a column to foobar that lists this file tag?

I can sort by title, artist etc.. can I add a column that would let me sort by BPM.  It seems like I should be able to do so but I haven't been able to figure it out yet.

Thanks for this handy tool!

<3
Title: foo_bpm
Post by: marc2003 on 2015-02-02 20:56:59
yes. just go to file>preferences>display>default UI>playlist view>custom columns. from there you add a new column using [%bpm%] as the pattern. then when you've done that, close the preferences, right click the playlist column headers to enable your new column. you can drag/drop the placement wherever you like.

note: the square brackets are not necessary but it prevents foobar from displaying a ? when that tag is missing from a file.
Title: foo_bpm
Post by: geistvater on 2015-02-02 20:57:46
yes. just go to file>preferences>display>default UI>playlist view>custom columns. from there you add a new column using [%bpm%] as the pattern. then when you've done that, close the preferences, right click the playlist column headers to enable your new column. you can drag/drop the placement wherever you like.

tip: the square brackets are not necessary but it prevents foobar from displaying a ? when no tag exists in a file.


Thanks Marc2003!!  This will help a ton with setting up mixtapes
Title: foo_bpm
Post by: areskz on 2015-04-13 16:35:37
Hello everyone! I'm happy to just start using foobar2000 and to have found gems like bpm analizer and discgots tags fetcher.

Would you please tell me how do I add BPM and key sorting to my playlists? I haven't found any info on web about it.

And also, which tag does this BPM analizer writes tags to?

Thanks in advance!
Title: foo_bpm
Post by: klonuo on 2015-04-14 12:21:13
Would you please tell me how do I add BPM and key sorting to my playlists?

You can select all files in your playlist and prepend %bpm% to existing sort pattern. Or you can add %bpm% as custom column field in your playlist view (Preferences > Display > Default User Interface > Playlist View), then in your playlist view add this new column by right-clicking on column headers, and finally sort by clicking on BPM column.


There is no currently component for key detection. I'd suggest using excellent open source application KeyFinder (http://www.ibrahimshaath.co.uk/keyfinder/). It can detect keys for supported files and write metadata from the GUI interface, or you can automate the process with foobar by using foo_run component - for example:

Code: [Select]
"C:\Programs Files\KeyFinder\KeyFinder.exe" -f "%path%" -w

KeyFinder by default does not use Camelot codes (property of Mixed In Key) although you can set custom codes in it's preferences and find the codes with Google.
Title: foo_bpm
Post by: areskz on 2015-04-14 13:16:11
klonuo, thank you so much for the reply. %bpm% thing works like a charm.
As for KeyFinder, I am using it already, but didn't know that it is possible to automate the process with foo_run component. Thank you for advice!
Title: foo_bpm
Post by: quicktrick on 2015-08-26 15:38:19
Hi all!  Many thanks to everyone who developed such a useful plugin!

I have one question.

foo_bpm calculates BPM for every song in my playlists, but it doesn't show the BPMs in the BPM column of a playlist for songs which are in one .ape file and which are listed in a .cue file.  Is it possible to show them too?
Title: foo_bpm
Post by: lvqcl on 2015-08-26 16:40:10
foo_bpm calculates BPM for every song in my playlists, but it doesn't show the BPMs in the BPM column of a playlist for songs which are in one .ape file and which are listed in a .cue file.  Is it possible to show them too?

foobar2000 itself stores only a limited set of tags in CUE files.
Title: foo_bpm
Post by: quicktrick on 2015-08-26 18:15:06
foobar2000 itself stores only a limited set of tags in CUE files.

Is there any additional plugin to solve it?
Title: Re: foo_bpm
Post by: incifinci on 2016-01-28 03:08:04
Tried analyse BPM on 100 Presley's songs, MP3. With default settings were many absolute (not simple halfe/double like) troubles (as in case of other files in last months, too), about 30% (sometimes happens more...). The original developer's next recommended settings (https://hydrogenaud.io/index.php/topic,77142.msg680966.html#msg680966) gave me a much better results, errors remained only 10%. (At the end I allways check BPMs manually.)

Other. I use BPM only because of gym, walk and jog with music, so my limits are 80-160. It's interesting: I read all 9 pages here, and nobody talked about the probleme of 3/4 (or 6/8) rythm songs. Elvis has many this like slow songs: 65 bpm, or 195 bpm. So, I think, the plus button "1/3" will be helpful, too.
Title: Re: foo_bpm
Post by: Seymour on 2017-03-08 08:21:49
Regardless of low activity in this topic.
When scanning a group of tracks, it is better to update the files after each one's scan is finished, not after overall scan is completed.

Not bad performance indeed. The plugin is lacking some polishing. I hope if someone could improve it someday.
Title: Re: foo_bpm
Post by: Forssux on 2018-03-01 08:46:28
Hi There,

This is indeed a great plugin I tried Beatunes 5 to and found it was sometimes wrong, as so many in detecting BPM for slower music.
Foobar2000 struggles with this music to in default settings..but when applying the recommended settings things getting better
Even online service are often not correct .160 (https://songbpm.com/adele-i-ll-be-waiting),
Maybe it's time to revisted new research as found here (https://www.researchgate.net/publication/250445462_A_Comparison_between_Fixed_and_Multiresolution_Analysis_for_Onset_Detection_in_Musical_Signals)

Or explain the settings more elaborate ....
settings which make it more accurate but slower is fine by me

Adele - [21 CD1 #08] I'll Be Waiting isn't 162 BPM imho
Title: Re: foo_bpm
Post by: Forssux on 2018-03-02 08:08:44
https://github.com/Shemahmforash/Audio-Framework
Title: Re: foo_bpm
Post by: fohrums on 2018-09-12 11:31:02
This struggles with Drum & Bass tracks. Give it a try and see for yourself.
Title: Re: foo_bpm
Post by: VivinCels on 2022-05-07 12:19:20
I tried to analyse trance music with version  0.2.4.6 https://i.postimg.cc/tTF0f6S1/2022-05-07-161547.png
Title: Re: foo_bpm
Post by: DJ Graco on 2022-05-15 12:59:45
I have noticed that foo_bpm is seen as a problematic add-on by the online troubleshooter.
Title: Re: foo_bpm
Post by: n99 on 2023-05-06 00:06:19
Seems like there wasn't any update since 2014. No answer on GitHub so far
Title: Re: foo_bpm
Post by: juanportelab on 2023-06-17 12:44:55
I get the following message when trying to install: "Could not load component "foo_bpm-0.2.4.6-20140624.fb2k-component": This component was built for a different processor architecture."

How do I solve it?

I have windows 10 home 64 bits and intel i5
Title: Re: foo_bpm
Post by: fbuser on 2023-06-17 14:02:20
How do I solve it?
Use the 32bit version of foobar2000.
Title: Re: foo_bpm
Post by: juanportelab on 2023-06-23 20:11:27
It works thank you!