miditoolkit
miditoolkit copied to clipboard
fix note closing method
With the current method of closing notes, one note-off may close multiple note-on events from previous ticks as commented. So if there is a note with same pitch overlapped over the ticks, the following note would be closed and cannot show the intended duration of the note.


Amended algorithm makes closing events one by one, in FIFO method. And this method won’t make any miss cause mido makes (note on - note off) pair for a note.

Although with the problem that overlapped notes in same pitch would be meaningless in MIDI, I would like to fix this method for I generate note events in a sequential way with DL model.
English is not my first language, so if there any, feel free to edit my awkward expressions in documented comments.