Skip to content

Commit

Permalink
Merge pull request #361 from CPJKU/fix_356
Browse files Browse the repository at this point in the history
add check for empty note array
  • Loading branch information
sildater authored Jul 23, 2024
2 parents 693b2c4 + 50d3343 commit 30ffdc4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions partitura/utils/music.py
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,9 @@ def _make_pianoroll(
onset = note_info[:, 1]
duration = note_info[:, 2]

if len(note_info) == 0:
raise ValueError("Note array is empty")

if np.any(duration < 0):
raise ValueError("Note durations should be >= 0!")

Expand Down

0 comments on commit 30ffdc4

Please sign in to comment.