CPJKU / partitura

A python package for handling modern staff notation of music

Home Page:https://partitura.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Assertion Error for computing performance features when tempo curve < 0

manoskary opened this issue · comments

Hello, I got an AssertionError in the Zeilinger/Magallof subset which occurs when an element of the tempo curve is less than zero.
Reference on line 479 of performance_codec.py:

assert((tempo_curve >= 0).all())

Which piece is this? I put the assertion there since tempo should not be negative, if the note order is correct.

Which piece is this? I put the assertion there since tempo should not be negative, if the note order is correct.

Many pieces actually:

  • match_mag/chopin_op37_No1.match
  • match_mag/match_mag/chopin_op32_No1.match

to name a few.

I think the best course of action would be to replace the assertion with a warning.

Sure, assertion is indeed not needed for released code. But I can't reproduce the negative tempo assertion failure, with the new monotonize_times function (but that's not on development branch so I see).

For the first file the error stems from a nan in the tempo curve. This is there because the variable unique_s_onsets is not unique but contains twice the same value in the very end.

Don't close this yet, I want to dig a bit deeper.