[sdiy] MIDI State Machine diagram - please comment

cheater cheater cheater00 at gmail.com
Wed May 6 19:40:38 CEST 2009


>
> Conceptually it's easier to think of System Real Time as 1-byte
> sidechannel data that can be split off in the receive buffer and
> diverted to a separate state machine (or dropped, in your case).  That
> way you don't have to deal with it in every state of the "main" FSM.

Wouldn't that create a possible race condition?

On Wed, May 6, 2009 at 6:06 PM, ASSI <Stromeko at nexgo.de> wrote:
> On Mittwoch, 6. Mai 2009, johnspeth at yahoo.com wrote:
>> http://mysite.verizon.net/jspeth/MIDI_FSM.pdf
>>
>> If you're interested, please look it over and comment.  It
>> represents *my* understanding of how MIDI works.  It may be
>> incorrect but I'd sure like to know if it's wrong or how the
>> diagram can be improved.  Keep in mind the scope of MIDI support is
>> limited to what is drawn.  I expect it to tolerate unsupported MIDI
>> messages without any problems.
>
> So you don't intend to support more than one MIDI channel, no PitchMod
> and no CC (esp. Sustain)?
>
> Conceptually it's easier to think of System Real Time as 1-byte
> sidechannel data that can be split off in the receive buffer and
> diverted to a separate state machine (or dropped, in your case).  That
> way you don't have to deal with it in every state of the "main" FSM.
>
> As far as the main FSM goes, I would just have one dispatcher state
> that forks off into a "collect 2 more bytes" state for all status
> bytes except sysex, which just loops until EOX.  Both these substates
> need to terminate on encountering a status byte (which is not a
> failure condition for SysEx).  If the dispatcher state gets a non-
> status byte, it prepends the last valid status (running status) or
> drops the byte if it hasn't received one.  That gets you properly
> "normalized" three-byte MIDI messages that can then be parsed to your
> heart's wishes ( which you can again model as an FSM if you want).
> Only then would I deal with channel and message filters and construct
> trigger and gate signals and the like.
>
>
> Achim.
> --
> +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk]>+
>
> SD adaptations for KORG EX-800 and Poly-800MkII V0.9:
> http://Synth.Stromeko.net/Downloads.html#KorgSDada
>
>
> _______________________________________________
> Synth-diy mailing list
> Synth-diy at dropmix.xs4all.nl
> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
>




More information about the Synth-diy mailing list