09-02-2022, 05:01 PM
(This post was last modified: 09-02-2022, 05:05 PM by mnrvovrfc.
Edit Reason: I upped the version of Fedora before Nov-2022
)
I purposely created a MIDI file with four events, of different sizes, pitches and velocities so you could see more easily what is being wrapped into.
I'm sorry I couldn't do anything better than terminal "od" command to show the innards of the MIDI file. One thing to keep in mind is that in the RPP file, right after the "E" the "delta time" is stored in decimal, while everything in the screenshot of "od" output is in hexadecimal. Therefore the "delta time" is lost in the string of events in the listing by "od". The "delta time" is tricky, must be a sequence in which the very last byte of that sequence should be the only one not having the high-bit set, while the other bytes before it must be 128 or greater. The "delta time" determines the length and position of notes which is why things get complicated in a polyphonic or multi-track MIDI file.
The MIDI event is really comprised of four values: the "delta time", the event combined with the MIDI channel, the note pitch and finally the velocity. A MIDI note-on must be matched by a note-off later on in the sequence. It has to have the same lower-nibble for MIDI channel and the same MIDI note pitch so the processor knows which note to close. Usually the "delta time" is set to zero for MIDI note-on but is figured out for the note-off, while the velocity is usually set to zero for MIDI note-off.
Almost forgot to mention the MIDI "event" could be note-on, note-off, continuous controller (CC), pitch bend, aftertouch or system-exclusive. The latter is a whole new realm LOL. For example "90" in hex means MIDI note-on for channel 1, and "BB" means MIDI CC for channel 12.
Yes the DAW pictures are ugly... as I've said, it's an early version of REAPER, and it's on Fedora 36 MATE. :/
I'm sorry I couldn't do anything better than terminal "od" command to show the innards of the MIDI file. One thing to keep in mind is that in the RPP file, right after the "E" the "delta time" is stored in decimal, while everything in the screenshot of "od" output is in hexadecimal. Therefore the "delta time" is lost in the string of events in the listing by "od". The "delta time" is tricky, must be a sequence in which the very last byte of that sequence should be the only one not having the high-bit set, while the other bytes before it must be 128 or greater. The "delta time" determines the length and position of notes which is why things get complicated in a polyphonic or multi-track MIDI file.
The MIDI event is really comprised of four values: the "delta time", the event combined with the MIDI channel, the note pitch and finally the velocity. A MIDI note-on must be matched by a note-off later on in the sequence. It has to have the same lower-nibble for MIDI channel and the same MIDI note pitch so the processor knows which note to close. Usually the "delta time" is set to zero for MIDI note-on but is figured out for the note-off, while the velocity is usually set to zero for MIDI note-off.
Almost forgot to mention the MIDI "event" could be note-on, note-off, continuous controller (CC), pitch bend, aftertouch or system-exclusive. The latter is a whole new realm LOL. For example "90" in hex means MIDI note-on for channel 1, and "BB" means MIDI CC for channel 12.
Yes the DAW pictures are ugly... as I've said, it's an early version of REAPER, and it's on Fedora 36 MATE. :/