markusschwenk / midieditor

Provides an interface to edit, record, and play Midi data
GNU General Public License v3.0
470 stars 69 forks source link

Sysex Event Does not have a Length #87

Open Randog77 opened 3 years ago

Randog77 commented 3 years ago

It seems to me that the MIDI Editor is not dealing with Sysex events properly in the SMF. In the MIDI stream itself it does not have a length, but in a SMF it does. I have found that if a length is in the SMF it is actually sent out as as Data in the Sysex as opposed to just information for the SMF. The length should be ignored when transmitting the Sysex. When recording with the MIDI Editor it does not seem to put the length of the Sysex in the SMF it creates. When using this .mid file on another player causes a problem because the length is not the SMF. Here is an excerpt from the MIDI Specification.

is used to specify a MIDI system exclusive message, either as one unit or in packets, or as an "escape" to specify any arbitrary bytes to be transmitted. A normal complete system exclusive message is stored in a MIDI File in this way: F0 The length is stored as a variable-length quantity. It specifies the number of bytes which follow it, not including the F0 or the length itself. For instance, the transmitted message F0 43 12 00 07 F7 would be stored in a MIDI file as F0 05 43 12 00 07 F7. It is required to include the F7 at the end so that the reader of the MIDI file knows that it has read the entire message.