TriggerCoder / CSharpSynthForUnity2.0

4 stars 1 forks source link

IndexOutOfBounds when loading MIDI file #6

Open achimmihca opened 1 year ago

achimmihca commented 1 year ago

I have an IndexOutOfBounds exception when opening this midi file of Ode to Joy

First the exception happens in ReadMetaMessage

case 0x2F://endoftrack
    return new MetaEvent(delta, status, metaStatus, reader[p++]);

When I add an index check there, then the exception occurs in other positions. Would be nice if this can be fixed.

Note that the midi file uses kar file extension because it contains lyrics for karaoke. The file can be safely renamed to use mid file extension if needed.