MIDI-IN questions

Bytes with the high bit set Always reset the state machine to keep it in sync.

And yes, you need to check for statusbytes that are not Note on/off and handle them separatly.