Hello friends,
I use BASS_FX_BPM_DecodeGet and after some searching I come to the following.
Works very nice, must say.
procedure TBassMixerAudio18.CalculateBPMValue;
var
SongMiddle,
SongStart: Double;
SongEnd: Double;
begin
FBPMValue := 0;
SongStart := (GetPlayingTime / 3);
SongMiddle := (GetPlayingTime / 2);
SongEnd := (GetPlayingTime - SongStart);
// http://www.un4seen.com/forum/?topic=13290.msg92939;topicseen#msg92939
// Limits set to 29 and 230 bpm which is the default value of soundtouch
// The detection of BPM starts at the middle of song and not for the whole song.
FBPMValue := BASS_FX_BPM_DecodeGet(GetStream, SongMiddle, SongEnd, MakeLong(29, 230), BASS_FX_BPM_MULT2, nil, nil);
// BASS_FX_BPM_MULT2: if ( BPM * 2 < max ) BPM = BPM * 2;
if (BASS_ErrorGetCode = 0) and (FBPMValue <> -1) then
begin
if (FBPMValue >= 180) then
FBPMValue := (FBPMValue / 2);
end;
end;
Have read a lot whether this is correct and still see a lot of differences? Is there a way to make it super or is it what it is?
I can think this is it.
Maybe some pointers for improvements?
Regards,
Eduard.