[sdiy] MIDI State Machine diagram - please comment

Neil Johnson neil.johnson97 at ntlworld.com
Wed May 6 23:27:54 CEST 2009


Hi John,

>> - 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.

Oh I'm not.  The issue is whether you match specific messages (in  
your case note-on and note-off) or whether you match classes of  
messages (channel voice with 1 parameter, with 2 paramters, etc).   
Adding new messages to the former approach results in an explosion of  
state transitions, while the latter requires minimal changes to the  
state machine but linear changes to the message class handlers (think  
extra cases in a switch).

Cheers,
Neil
--
http://www.njohnson.co.uk






More information about the Synth-diy mailing list