[sdiy] MIDI State Machine diagram - please comment
johnspeth at yahoo.com
johnspeth at yahoo.com
Wed May 6 21:44:07 CEST 2009
> > http://mysite.verizon.net/jspeth/MIDI_FSM.pdf
Neil's list is a good summary of things that are wrong or not quite right.
> - In your "status unknown" state you don't handle System Realtime messages,
> while you do in other states.
You're right. I'll correct that.
> - Why treat Note On and Note Off differently? They have the same structure,
> just different status byte. As Achim suggests treat them the same, and then
> interpret the collection of three bytes later on - its also much easier to pick
> up on the 0-velocity note-off command.
This issue is a prickly subject. Let's not confuse behavior with implementation. I'm attempting to capture behavior. My ultimate goal is to go from a behavioral diagram to an implementation with little extra work. I'd love to know if anyone knows of a tool or language that can take state diagrams as input and output C or C++ code. IAR's VisualState is a pricey tool for that purpose. I'd prefer a free one. Anyone?
Nonetheless, I readily admit that behavior can be captured using an infinite number of expressions of state machines. The NOTE-ON/NOTE-OFF similarity is an obvious way to simplify my state machine.
> - In the Sysex state what do you do if you receive a status byte other than
> EOX? The official line is to abort the sysex. Specific to your diagram, what
> if a Note On status byte terminates a sysex?
You're right again. I'll correct that.
> - What about all the other MIDI messages? There is lots of useful information
> coming across the MIDI cable. Seems odd to support Sysex but ignore pitchbend
> or even mod.wheel.
Yep. My intent was to build a custom MIDI interface for my Prophet. The digital interface doesn't handle wheel inputs. There's a separate analog interface that I decided not to use. I suppose my FSM should have included the required MIDI Implementation Chart.
> - No mention of channel filtering for the note messages. Are you supporting
> OMNI ON mode only?
You're right. Channel filtering is implied. In my device, the channel will be fixed (no front panel). I can add a note about that.
> Look forward to seeing the update!
Rev 2 is at http://mysite.verizon.net/jspeth/MIDI_FSM.pdf.
Thanks for all the comments.
John Speth.
More information about the Synth-diy
mailing list