I'm having a problem understanding MIDIEventPacket
structure.
An event packet can be represented as
timeStamp
words: [word, word, ...]
...
Each word
is a chunk of a message.
A MIDI message can be constituted by 1 or more word
.
In the documentation, an event packet is defined as A series of simultaneous MIDI events
. This would mean that words within a packet can be part of different events.
This would mean that given words[0] is msgs[0].words[0]
either of these is correct:
words[1] is msgs[0].words[1]
OR is msgs[1].words[0]
BUT in the definition of MIDIEventListAdd
function, its words
parameter is defined as the new event, which may be a single MIDI event or a partial SysEx event
which would imply that all words within a packet constitute either a Sysex message, or only one MIDI event. Unless this means that MIDIEventListAdd
will add different events into the same packet if the timestamp provided is the same.
The question basically boils down to this: if it's the case that packets can contain multiple messages, there seems to be no way to differentiate between the first and last words of each contained message. Am I correct in interpreting this to mean mean that unless the message is tagged as sysex, I have to check the message type tag of words[0]
to project the expected msg[0]
word count?