adamjakab / BeetsPluginBpmAnalyser

A beets plugin for obsessive-compulsive music geeks to add BPM information to their songs.
MIT License
23 stars 4 forks source link

error when trying to fetch bpm values #2

Closed thedevilisinthedetails closed 4 months ago

thedevilisinthedetails commented 4 years ago

when typing in the cmd beet bpmanalyser -t '{directory}' i get an error:

File "/usr/local/lib/python3.7/site-packages/beetsplug/bpmanalyser.py", line 122, in func self.analyse_songs() File "/usr/local/lib/python3.7/site-packages/beetsplug/bpmanalyser.py", line 150, in analyse_songs self.execute_on_items(items, analyse, msg='Analysing tempo...') File "/usr/local/lib/python3.7/site-packages/beetsplug/bpmanalyser.py", line 170, in execute_on_items with futures.ThreadPoolExecutor(max_workers=self.cfg_threads) as e: File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/concurrent/futures/thread.py", line 128, in __init__ if max_workers <= 0: TypeError: '<=' not supported between instances of 'str' and 'int'

i see bpmanalyser plugin enabled in beets when i do "beet version"

adamjakab commented 4 years ago

The -t option is for selecting how many threads you want to use in the process. It expects a number like 1 or 2 or 4 and normally it defaults to the number of cores your CPU has.

I wonder where you got the '-t' info from. Is it the guide that is not clear enough in explaining this?

Anyways, you can analyse songs that are already imported into your library (not {direcory}). Just use the normal query interface for that. For example: beet bpmanalyser artist:pink floyd or similar.

adamjakab commented 4 years ago

I also marked this issue a bug because providing the wrong input to the -t or --threads options should not break the application.

thedevilisinthedetails commented 4 years ago

The -t option is for selecting how many threads you want to use in the process. It expects a number like 1 or 2 or 4 and normally it defaults to the number of cores your CPU has.

I wonder where you got the '-t' info from. Is it the guide that is not clear enough in explaining this?

Anyways, you can analyse songs that are already imported into your library (not {direcory}). Just use the normal query interface for that. For example: beet bpmanalyser artist:pink floyd or similar.

i must have missed that option (-t) explanation; thanks for the info. Thing is i guess most my artist dont have bpm in the database being used by your plugin? I figure at least depeche mode would be there but nothing is even returned when trying this beet bpmanalyser artist:Depeche Mode

adamjakab commented 4 years ago

This plugin does not use databases. It analyses the song and calculates the bpm. The only reason you will get no output whatsoever is when the song has already bpm information. Try: beet info artist:Depeche Mode to see what info you have on the song and you'll see that probably you already have bpm information on it. If for some reason you want to recalculate it you can always force the analysis of the songs with the -f or --force flag (in your case: beet bpmanalyser --force artist:Depeche Mode.

adamjakab commented 4 years ago

Just a note. You can also list all your songs which do NOT have bpm information with: beet ls bpm:0 and fix them with: beet bpmanalyser bpm:0

thedevilisinthedetails commented 4 years ago

I tried with an artist that has no bpm and did what you suggested: bpmanalyser --force artist:000 did a check beet info artist:000 and i see bpm as 0

adamjakab commented 4 years ago

Please retry with debugging: beet -vv bpmanalyser --force artist:000 and paste here the output. And also check if aubio is working on your system with: aubio tempo <path_to_mp3> This plugin uses aubio so I am starting to think that there is a problem there. Did you use pip to install it?

thedevilisinthedetails commented 4 years ago

looks like the module is missing ImportError: No module named aubio i installed via pip3 and when i do a aubio --version i get this: ~ aubio --version aubio version 0.4.9

adamjakab commented 4 years ago

Hi, Ok you have aubio installed and the version is correct. I think you have some issues with with different python environments. Do you have more than one version of python installed? Can you try and see what these return? python -V and python3 -V Let's see if we can figure it out.

adamjakab commented 4 years ago

Hi, I think you also have a very outdated version of this repo. you should make sure to hava v1.3.3 installed. If I were you I'd uninstall everything first (none of your configuration files, library or audio files will be deleted) - only python modules:

pip uninstall beets-bpmanalyser
pip uninstall aubio
pip uninstall beets

...and any other beets plugins you might have installed, and then reinstall them in this order:

pip install beets
pip install beets-bpmanalyser

upon reinstalling beets-bpmanalyser you should see the last line of the output saying something like: Successfully installed aubio-0.4.9 beets-bpmanalyser-1.3.3.

Now try again. I am sure it will work.

PS: It is important that you uninstall and reinstall beets also and not only the plugin.

thedevilisinthedetails commented 4 years ago

Hey sorry for the delay. Will try what you suggested today and get back to you.