Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

demo_bpm_extract.py consistently oversamples bpm by +2 #366

Open
maphouse opened this issue Jun 1, 2022 · 5 comments
Open

demo_bpm_extract.py consistently oversamples bpm by +2 #366

maphouse opened this issue Jun 1, 2022 · 5 comments

Comments

@maphouse
Copy link

maphouse commented Jun 1, 2022

the bpm returned in this function (https://github.com/aubio/aubio/blob/master/python/demos/demo_bpm_extract.py) is consistently +2 bpm above what it should be (I have determined this with hundreds of music files using other bpm detection algorithms and tap notation)

@piem I would appreciate assistance in figuring out what in this function is giving this result and whether it can be fixed!

thanks!

@timvis
Copy link

timvis commented Jun 25, 2022

There is also
aubio.tempo().get_bpm()
if I get it right

@maphouse
Copy link
Author

There is also aubio.tempo().get_bpm() if I get it right

Thanks for the suggestion! I'm happy to know aubio has a method for bpm, would far prefer to use what you suggest to this other script... Why isn't it anywhere in the docs though? https://aubio.org/manual/latest/py_analysis.html?highlight=tempo#aubio.tempo I can't find get_bpm anywhere...

@timvis
Copy link

timvis commented Jun 26, 2022

I found the method by printing dir( aubio.tempo() ).

But it shows only half of the expected BMPs for techno music. Some other music works well. I think it could be a band issue, therefore I would like to filter out unwanted frequency ranges, so I would get only samples for the bass or the high hats. It might not be the right topic here, but maybe someone is reading this... any hints welcome.

@maphouse
Copy link
Author

I found the method by printing dir( aubio.tempo() ).

But it shows only half of the expected BMPs for techno music. Some other music works well. I think it could be a band issue, therefore I would like to filter out unwanted frequency ranges, so I would get only samples for the bass or the high hats. It might not be the right topic here, but maybe someone is reading this... any hints welcome.

That approach sounds pretty legit! I'd be curious to know how it improves results... There's def a lot of dance music out there with crazy mids that confuse bpm readers..

With some bpm detection algorithms, you can set upper and lower bounds, which sometimes forces the analyzer to read say 140 instead of 70. This is what happens for me in foobar2000 with https://github.com/stengerh/foo_bpm
I'd prefer to use aubio though (this is the project I'm integrating aubio with btw https://github.com/maphouse/analyze-tag-songs)

I'll try out get_bpm then and follow up here

@maphouse
Copy link
Author

I found the method by printing dir( aubio.tempo() ).

But it shows only half of the expected BMPs for techno music. Some other music works well. I think it could be a band issue, therefore I would like to filter out unwanted frequency ranges, so I would get only samples for the bass or the high hats. It might not be the right topic here, but maybe someone is reading this... any hints welcome.

I just got back to this today.

I wasn't able to access the get_bpm method from python. Too difficult! It wasn't obvious to me how to create a "tempo" object (https://aubio.org/manual/latest/py_analysis.html) and access the bpm that way...

It was easier for me to use the shell command "aubio tempo songname", so I integrated it into my script that way. Results for house music are pretty accurate! Much moreso than what I got when using https://github.com/aubio/aubio/blob/master/python/demos/demo_bpm_extract.py

Tracks with BPMs under 100 don't do well though.
Since the script retrieves the median detected bpm, I'm wondering if something like the standard deviation could be used to establish how accurate the detected bpm is...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants