miditoolkit icon indicating copy to clipboard operation
miditoolkit copied to clipboard

fix note closing method

Open hyeonch opened this issue 2 years ago • 0 comments

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.

miditoolkit_1 miditoolkit_2

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.

miditoolkit_3

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.

hyeonch avatar Jul 11 '22 04:07 hyeonch