2.1.0 - MIDI Playback Issues (Wrong Notes)

Windows SDK 2.1.0

MIDI Playback Issue.zip (437.8 KB)

I have a short MIDI file with two tracks which is loaded in a project and played back. I expect it to play back the notes as written and confirmed with various external MIDI utilities, but under certain conditions, specific notes are cut very short (notes are silenced almost immediately after playing).


I've attached a project which demonstrates the behavior. It will automatically play 5 variations of "Pop Goes the Weasel" to test different inputs:

  1. The original MIDI file, which I rendered from an external utility. Sequence is played using Playdate synth (square waves). No apparent issues with playback

  2. A modified version of the MIDI file used in (1), where I have moved all notes closer to the start of the song (intent was to make the notes start playing sooner). I did not try to snap the notes to a particular step. Sequence is played using Playdate synth. The song plays, but several of the notes are unexpectedly cut short

  3. A modified version of the MIDI file used in (1), where I have lengthened all notes to intentionally make them overlap. The results are similar to (2)

  4. Same as (2), but using a piano sample as the instrument. Same results as (2)

  5. Same as (3), but using a piano sample as the instrument. Same results as (2)


I'm out of ideas for what could be causing this. Is there something about timing/polyphony in MIDI files that I don't understand that could lead to this behavior?

All modifications of the MIDI files used can be played without issues in external tools like MIDIEditor and FL.

I took a closer look at the MIDI files, and discovered that there actually were unexpected artifacts in them after editing, saving, then reopening them in the editor that I'm using. But the odd thing is that the errors in the file don't seem to match the errors that I actually hear when running my Playdate project.

For example, when viewing "testscore2.mid" in the attachment above, very short notes can be seen at several locations in one of the tracks (I have no idea how they were introduced, but that's not a Playdate problem). But the notes that are cut off while playing the song in the Playdate project are not the notes that are short.

I'm seriously mystified by this whole thing. Thinking of submitting a bug report for this... if anyone has any thoughts, I'd be glad to hear them.