[sdiy] MIDI state machine for arpeggiator

Matthew Smith matt at smiffytech.com
Sun Mar 1 02:25:25 CET 2009


Quoth ASSI at 2009-02-28 21:37...
> I don't know where you expect to get the MIDI data from and if you can 
> make certain assumptions, but if it's from a master keyboard or 
> sequencer you really need to implement running status (you get just 
> one status byte and then many note/velocity pairs) and recognize that 
> a NoteOn with Velocity=0 really is a NoteOff.

I think I understand.  Just to confirm, rather than what I thought was 
the stream:

noteon-n1-v1 noteon-n2-v2 noteon-n3-v3

...where n(n) is note number and v(n) is velocity.

For the same channel we may actually see:

noteon-n1-v1-n2-v2-n3-v3 ... etcetera

...and with v(n)=0 as part of the note on stream representing a note off.

> Your state machine is not robust in the sense that when a byte 
> goes missing it doesn't synchronize at the next command byte (it would 
> swallow it when waiting for velocity for instance).

So each state > 0 needs to look out for another command byte?

If my understanding is correct, it's still fairly simple stuff.

Many thanks for your response, Achim.

Cheers

M

-- 
Matthew Smith
Smiffytech - Technology Consulting & Web Application Development
Business:      http://www.smiffytech.com/
Blog/personal: http://www.smiffysplace.com/
LinkedIn:      http://www.linkedin.com/in/smiffy
Skype:         msmiffy
Twitter:       @smiffytech



More information about the Synth-diy mailing list