Decoding MIDI with discrete logic
The Dark force of dance
batzman at all-electric.com
Tue May 4 09:05:31 CEST 1999
Y-ellow Jeremy 'n' y'all.
At 11:25 AM 05/01/99 +0100, Jeremy Brookes wrote:
>> It might appear that all that has to be done is to
>> turn the 8 bit serial lumps into parallel & see what is there, but
>> WARNING WARNING you have to account for thigs like , what if there
>> is some sysex coming down, you have to know not to look at this,
>> there could be anything there.
>
>There shouldn't be a problem with sysex as all the bytes inside a sysex
>message are 7Fhex or less, while the byte for the controller info is 80hex
>or above (can't remember exactly). So if the logic is matching for the
>controller byte, it can't get confused by a sysex byte. MIDI is actually
>quite well written at byte level when you look into it closely enough. It
>appears to have been written to accommodate very simple processors or even
>logic chip processing.
8n is the controller message status byte. Where n= MIDI channel number.
Having just done this I can tell you that is't not quite that simple. when
you throw running status into the mix you get something that requires quite
a sequence in order to parse the messages. The sequence as far as sysex
goes is something like this.
Is sysex?
no --> carry on doing what you're doing.
Yes --> Ignore all bytes following till bit 7 is set.
Is EOX?
Yes --> Resume from running status.
No --->
Is timing?
Yes --> ignore
no -->
Jump back to start of parser and begin parsing again.
Or something like that.
Note here. That this all depends on the system you're using. The handling
of timing information can be intrinsic to your parser but it is useful to
note that MIDI clock is the only message which can interrupt a sysex stream
and therefore has the highest priority of all. You can however, usually
ignore it as I can't think of a single case where the parsing of a timing
message (in a system which doesn't require timing) will not cause a
termination of running status. But it won't cause the termination of a
sysex message.
But! It should also be born in mind that eox isn't the only thing that
_can_ terminate a system exclusive message. Any other controller message
will effectively mean that the sysex message is over.
It's interesting to note that the original firmware in the MPU401 did not
terminate sysex unless it received a valid EOX. Which is why when talking
to some older AKAI samplers, the interface it self would tend to hang.
"Ah those were the days."
Be absolutely Icebox.
_ __ _
| "_ \ | | batzman at all-electric.com / aek at all-electric.com
| |_)/ __ _| |_ ____ ALL ELECTRIC KITCHEN
| _ \ / _` | __|___ | The Elementary Urban sanity CD
| |_) | (_| | |_ / / out now on Transmission Communications
|_,__/ \__,_|\__|/ /
/ ,__ http://www.all-electric.com
Goodfortune |_____|
More information about the Synth-diy
mailing list