I had to mix a number of MP3s together for the radio station I work for and each one had to merge nicely into the next. As it was to be used for people to dance to, I needed to find tracks with a similar BPM.
I had a play around with various pieces of software which claimed to be able to display the BPM of an MP3 by analysing it, but none ever gave the same figure. Even the Winamp plugin varied huge amounts while the songs were playing.
So I decided to write a small routine to do it myself - tapping the spacebar to the beat of the music. Testing it against a freeware metronome program, it's fairly accurate.
Note: When you run the program, it averages out the tapping speed of ten taps of the spacebar, so you need to tap it more than ten times when you start, (or after changing the tempo), before a correct readout is displayed.
Sync On: Sync Rate 0
Set Window On
Set Text Opaque
Dim BeatArray(9)
Repeat
If SpaceKey() = 1
Gosub CalcBPM
Endif
Sync
Text 5,5,"Average BPM: "+Str$(BPM)+" "
Until ReturnKey() = 1
End
CalcBPM:
Elapsed = (Timer()-T)/10
T = Timer()
BeatArray(BeatCount) = Elapsed
Inc BeatCount
If BeatCount = 10 Then BeatCount = 0
Repeat
Until SpaceKey() = 0
TotalBPM = 0
For N = 0 To 9
Inc TotalBPM,BeatArray(N)
Next N
AvBeatLen# = TotalBPM / 10.0
BPM = 6000.0 / AvBeatLen#
Return
TDK