Skip to content

Crash in autobpm plugin / Docs incomplete #5185

@JOJ0

Description

@JOJ0

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

Metadata

Metadata

Assignees

Labels

autobpmbugbugs that are confirmed and actionable

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions