Skip to content

Commit

Permalink
fix bug in _preprocess_notes when there is no remaining note
Browse files Browse the repository at this point in the history
  • Loading branch information
Natooz committed Aug 3, 2024
1 parent a82ce4d commit 2281c4f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions miditok/midi_tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
Track,
)
from symusic.core import (
NoteTickList,
PedalTickList,
PitchBendTickList,
ScoreTick,
Expand Down Expand Up @@ -671,6 +672,7 @@ def _preprocess_notes(
for key in note_soa:
note_soa[key] = note_soa[key][mask]
if len(note_soa["time"]) == 0:
track.notes = NoteTickList()
return

# Compute new velocities
Expand Down

0 comments on commit 2281c4f

Please sign in to comment.