gearmulator icon indicating copy to clipboard operation
gearmulator copied to clipboard

Fault in single patch midifile save

Open Guod3 opened this issue 2 years ago • 2 comments

There are 3 bytes that come after the sysex message F7 at the end a of a *.mid single patch save that serve no purpose and cause python midifile functions to crash. Removing these 3 bytes does not effect single patch loading from the *.mid in osirus.

Guod3 avatar Mar 24 '23 01:03 Guod3

it works just fine here (i do see those 3 bytes), can you give more context regarding what you attempted ? I couldn't make it crash. (here: win11, python 3.9.13 / midifile 0.2.0)

ylmrx avatar Apr 23 '23 15:04 ylmrx

I tried various python midi libraries including mido, they raised various errors which went away when I binary edited out the extraneous bytes. Sorry I don't have the specifics anymore, I went on to use my own binary file operations.

Guod3 avatar Apr 25 '23 03:04 Guod3

The three bytes FF 2F 00 mark the end of a track, see midi file specification here: https://www.music.mcgill.ca/~ich/classes/mumt306/StandardMIDIfileformat.html

dsp56300 avatar May 18 '24 15:05 dsp56300

Found the issue, the chunk length that was written was incorrect.

dsp56300 avatar May 18 '24 15:05 dsp56300