CPJKU / madmom

Python audio and music signal processing library
https://madmom.readthedocs.io
Other
1.35k stars 206 forks source link

Input Device on DBNBeatTracker online mode #487

Closed darkzbaron closed 3 years ago

darkzbaron commented 3 years ago

Expected behaviour

I would have expected Madmom to use the default input device

Actual behaviour

No information on actual input device used and nothing happen

Steps needed to reproduce the behaviour

"madmom\bin\DBNBeatTracker" online

Information about installed software

Python 37

` madmom 0.16.1 numpy 1.20.2 PyAudio 0.2.11

superbock commented 3 years ago

Unfortunately, this is not enough information to help fixing your issue. E.g., are you able to record something by yourself with pyaudio?

darkzbaron commented 3 years ago

Hi thanks so much for the rep. I was using an old bin file for DBNBeatTracker which caused an issue while using the latest madmom package.

It looks like you remove the ability to select the recording pyaudio device! It's a shame now I have to modify the source.

Also, any idea what would be the most appropriate algorith to animate a light to music? I am using the DBNBeatTracker but there are "not enough" beat events to my tast, I tried to increase the gain but not sure that's the right approach.

Thanks so much for the great work anyway

superbock commented 3 years ago

Regarding the ability to select the audio source: this should still be there (see the --list option of all online capable scripts to list all devices selectable with --device).

You might want to set --min_bpm to a higher value, this should force the DBN to chose a higher tempo, most likely double of the correct tempo, but please make sure to increase --max_bpm accordingly.

If this does not work, you could try using OnsetDetectorLL, but this gives all onsets of an audio, which might not be very periodic and thus less suited to control lights.

darkzbaron commented 3 years ago

HI there, thanks so much for your help! I am making progress using DBNBeatTracker,. I am looking to add another dimension to my script, namely the intensity of the beat, can I get that from your source or does the DBN only returns confidence level/probability?

superbock commented 3 years ago

The DBN returns only the positions of the beats, but you can of course re-evaluate the output of the RNN. But maybe a simple thresholding of the RNN activation is enough for your apllication.