Fix midi export

Issue #15 resolved
Heiko Rufan created an issue

SMF.write() does not work:

There is a wrong type hint in the signature (SMF instead of SMFData).

Also, the sorting method can lead to note_on events being sorted before note_off events when they have the same timestamp. This can corrupt the output file.

Attached is a diff for the fixes.

Thanks for the great work!

Comments (5)

  1. きのもと結衣 repo owner
    • changed status to open

    Thanks for report. and I will implement for running status that note_on velocity 0 as note_off.

  2. Heiko Rufan reporter

    There is another issue here I did spot at first: If you have a program change or other control change at the same time as a note-on, you want these to be processed before the note-on.

    So the logic here should rather be: If several events have the same timestamp, note-on must always come last.

  3. きのもと結衣 repo owner

    In the first place, it is best to allow sorting to be turned on or off.
    They should have been originally generated in sequence.

  4. Log in to comment