BPM

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

BPM

josh
Hi
Just found some time to have a play with UOS.
SO far, I think I am doing OK, I can play mp3.
I have managed to get the current position of song in ms.

I am having trouble with BPM detection;

bpm1:=uos_InputGetBPM(PlayerIndex1,InputIndex1);

It always returns 0;

Is there any documentation on this function?
Reply | Threaded
Open this post in threaded view
|

Re: BPM

fredvs
Administrator
Hello.

Here isntheb site of SoundTouch BPM finder:

https://www.surina.net/soundtouch/index.html

> bpm1:=uos_InputGetBPM(PlayerIndex1,InputIndex1); It always returns 0

Is it for all mp3 that you try ?

Did you try the demo consolebpmdetect ?

Do you have also always BPM  = 0 ?

Fre;D
Reply | Threaded
Open this post in threaded view
|

Re: BPM

josh
Hi

If I run console demo

C:\uos_master\uos-master\examples>consolebpmdetect Another.mp3
Result of loading libraries (if 0 => ok ) : 0
Result of loading SoundTouch plugin (if 0 => ok ) : 0
soundtouch_getVersionId = 20001
soundtouch_getVersionString = 2.0.1pre
length(thebuffer) = 259456
BPM = 181.1336212

C:\uos_master\uos-master\examples>consolebpmdetect k.mp3
Result of loading libraries (if 0 => ok ) : 0
Result of loading SoundTouch plugin (if 0 => ok ) : 0
soundtouch_getVersionId = 20001
soundtouch_getVersionString = 2.0.1pre
length(thebuffer) = 259456
BPM = 181.1336212

C:\uos_master\uos-master\examples>consolebpmdetect m.mp3
Result of loading libraries (if 0 => ok ) : 0
Result of loading SoundTouch plugin (if 0 => ok ) : 0
soundtouch_getVersionId = 20001
soundtouch_getVersionString = 2.0.1pre
length(thebuffer) = 259456
BPM = 181.1336212
Reply | Threaded
Open this post in threaded view
|

Re: BPM

josh
I think the issue is with the dll's.

I tried your app STrumPact pre-compiled win 64, this detect bpm ok.
If I replace the 64bitdll's ( all of them ) with the ones downloaded from latest svn
Then it does not detect BPM and errors, other strange thing happen on one of the songs I tested the generated wave of the track was fine, but when with new dlls' it maxed out as a solid bar.

Reply | Threaded
Open this post in threaded view
|

Re: BPM

fredvs
Administrator
This post was updated on .
Hello josh.

> If I replace the 64bitdll's ( all of them ) with the ones downloaded from latest svn

Please take a look at this:

https://sourceforge.net/p/soundtouch/discussion/747307/thread/3de7b7d2/

I did the compilation of all the SoundTouch dll provided by uos.

It seems, indeed, that the Windows-release given by SoundTouch-site are obsolete.

Also, I wait for the new BPM algorithm promised by Olli.

https://sourceforge.net/p/soundtouch/discussion/747307/thread/0ff791da/

Fre;D
Reply | Threaded
Open this post in threaded view
|

Re: BPM

josh
Hi

Ok.. So at the moment it is broken?

The dll i replaced were from your lateset comit
Reply | Threaded
Open this post in threaded view
|

Re: BPM

josh
Just a thought.
When I was using bass i created a routine that took 2 seconds samples throughout the length of the song (starting from 10 seconds in, finishing 10 seconds before end ; this got rid of a lot of the start end silence); it took 10 of these bpm reading, discarded the top and lowest 2 to leave 6 then bpm was avaerage of these 6; this produced a pretty accurate reading.

I am not familiar enough with soundtouch, but you probably knwo how to send these 2 second sample block to be ananlyzed by soundtouch bpm algorithims.

unfortunately I cant find my code at the moment, so going from memory on the 2 second samples; it might have been 3 or 4 seconds samples.

The start and end points were 10 seconds from the start or end of sound.

On normal files the spped was pretty fast; as most pc could handle the whole mp3 in memory, when using  a large 4 hour mp3, it would take much longer as scanning and skipping a the file was much slower due to buffering in the data samples.
Reply | Threaded
Open this post in threaded view
|

Re: BPM

fredvs
Administrator
Hello.

You may take a look at consolebpmdetect demo.

You will see that the buffer used to detect the BPM is 1024 frames.
Of course you may adjust the length of that buffer.

I used 1024 frames because it is the smallest length needed to get a fast result.

But I agree that the algorithm used by SoundTouch is not perfect.

Note that BassFX pluggin (with BPM detect) uses SoundTouch code.

Fre;D

Reply | Threaded
Open this post in threaded view
|

Re: BPM

fredvs
Administrator
In reply to this post by josh
Hello.

> The dll i replaced were from your lateset comit

Sorry but I do not understand...

Fre;D
Reply | Threaded
Open this post in threaded view
|

Re: BPM

josh
Hi

I downloded Pre-compiled 64 it strumpact
StrumPract_win64_1_6_1.zip

Replace the dll's with the ones from the latest comit of uos
https://github.com/fredvs/uos

If I now click the BPM button I get no BPM detected;
I get access denied message when I try to play some of mp3
The wave generation does not always work.

Using the dll that came with the strumpact download then I do not get these errors with the same mp3 files.

This kind makes the issue with the dll's
Reply | Threaded
Open this post in threaded view
|

Re: BPM

fredvs
Administrator
Hello Josh.

I am not sure to understand.

Are you saying that the dll's of StrumPract/lib are working and those from uos/examples/lib are not working ?

But the dll's from StrumPract are the same dll's than uos !

Please, give more infos, I am disappointed...

Thanks.

Fre;D