Re: [linux-audio-dev] Basic MIDI question

From: Jens M Andreasen <jens.andreasen@email-addr-hidden>
Date: Wed Jul 26 2006 - 14:56:20 EEST

On Wed, 2006-07-26 at 09:51 +0300, Ari Kauppi wrote:
> On Wed, 26 Jul 2006, Jens M Andreasen wrote:
>
> > if(runningStatus == NOTE_ON || runningStatus == NOTE_OFF)
>
> If you plan to receive messages from other channels than 0 you have to
> use (runningStatus & 0xF0) instead of the full runningStatus and perhaps
> check for (runningStaus & 0x0F) == receiveChannel..

Thanx!
In this case I think we can get by without increasing instruction count,
like this:

      if((runningStatus - NOTE_OFF) < 0x20) // note_on or note_off
      {

... and keep switch(runningStatus & 0xF0) in mind for an extension.

The receive channel is better handled in the note on/off function(s).
There can be all kinds of differences between channels that the parser
need not to have any knowledge of.

If this is going to be some kind of Official Blinking Light Parser
Contest, I better do an explicit rewrite so it can compile :-)

Those who chip in, get to share the prize!

-- 
Received on Wed Jul 26 20:15:09 2006

This archive was generated by hypermail 2.1.8 : Wed Jul 26 2006 - 20:15:09 EEST