Even I had to reread the documentation to remember the rules. You should 
not be checking each byte in each event for status bytes -- status bytes 
(except for End-of-Sysex) will only be in the first byte of any given event.

So, once you see a MIDI_SYSEX in the first byte of an event, you should 
start looking for end-of-sysex in the remaining 3 bytes. In subsequent 
messages, if the first byte is a real-time status byte, process the 
message as a real-time message and resume sysex processing on the next 
message. If the first byte is a non-real-time and non-end-of-sysex 
status byte, the sysex message has been truncated and you will not 
receive any more bytes for it. Otherwise, the message must be more sysex 
data. Process the bytes one-at-a-time and if you find an end-of-sysex 
byte, you've finished processing the sysex message.

I think the mm program (Midi Monitor) has code to fully parse the 
incoming MIDI stream, so you might be able to use that as a reference.

-Roger

On 4/11/11 11:25 PM, rdx...@yahoo.de wrote:
> greetings,
>
> i am thinking the following but i am not sure if this is
> a) actually the correct way to detect truncated sysex and if so
> b) is always correct:
>
> ...
_______________________________________________
media_api mailing list
media_api@create.ucsb.edu
http://lists.create.ucsb.edu/mailman/listinfo/media_api

Reply via email to