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

Crash in autobpm plugin / Docs incomplete #5185

Open
JOJ0 opened this issue Apr 10, 2024 · 2 comments
Open

Crash in autobpm plugin / Docs incomplete #5185

JOJ0 opened this issue Apr 10, 2024 · 2 comments

Comments

@JOJ0
Copy link
Member

JOJ0 commented Apr 10, 2024

Sorry for being brief. A quick report on a crash I'm experiencing with the rather new autobpm plugin. Something with librosa. I'm on Python 3.11.

Problem

Running this command in verbose (-vv) mode:

$ beet -vv autbpm label:syncopathic

Led to this problem:

Traceback (most recent call last):
  File "/home/jojo/.pyenv/versions/beets/bin/beet", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/jojo/git/beets/beets/ui/__init__.py", line 1865, in main
    _raw_main(args)
  File "/home/jojo/git/beets/beets/ui/__init__.py", line 1852, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/home/jojo/git/beets/beetsplug/autobpm.py", line 46, in command
    self.calculate_bpm(lib.items(ui.decargs(args)), write=ui.should_write())
  File "/home/jojo/git/beets/beetsplug/autobpm.py", line 81, in calculate_bpm
    tempo, _ = beat.beat_track(y=y, sr=sr)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jojo/.pyenv/versions/3.11.3/envs/beets/lib/python3.11/site-packages/librosa/beat.py", line 185, in beat_track
    beats = __beat_tracker(onset_envelope, bpm, float(sr) / hop_length, tightness, trim)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jojo/.pyenv/versions/3.11.3/envs/beets/lib/python3.11/site-packages/librosa/beat.py", line 433, in __beat_tracker
    beats = __trim_beats(localscore, beats, trim)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jojo/.pyenv/versions/3.11.3/envs/beets/lib/python3.11/site-packages/librosa/beat.py", line 507, in __trim_beats
    smooth_boe = scipy.signal.convolve(localscore[beats], scipy.signal.hann(5), "same")
                                                          ^^^^^^^^^^^^^^^^^
AttributeError: module 'scipy.signal' has no attribute 'hann'

Here's a link to the music files that trigger the bug (if relevant):

difficult to provide....

Setup

  • OS: Manjaro Linux
  • Python 3.11.3
  • librosa 0.10.1
  • resampy 0.4.3
  • beets version: git master

Also a quick note on the existing docs: https://docs.beets.io/en/latest/plugins/autobpm.html

The installation requirements could be better. We need to pip install librosa resampy as far as I figured it out. That correct? We should explicitely state that in the docs

@JOJ0 JOJ0 changed the title Crash in autobpm plugin Crash in autobpm plugin / Docs incomplete Apr 10, 2024
@JOJ0
Copy link
Member Author

JOJ0 commented Apr 10, 2024

@tandy-1000 Hi :-) Just a heads up. Maybe you have seen this issue? And also note that we should improve the docs a little here. Please clarify if my pip install assumption are correct, I'll correct the issue description then :-)

@wisp3rwind
Copy link
Member

wisp3rwind commented Apr 10, 2024

Looks like a simple bug in librosa, though: librosa/librosa#1830 (i.e. librosa uses scipy < 1.0.0API).

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