[chuck-users] get midi channel associated with midi event

Atte André Jensen atte.jensen at gmail.com
Sat Jul 22 18:40:08 EDT 2006


Spencer Salazar wrote:

> Thus the following code would  
> store the channel in the "channel" variable:
> 
> msg.data1 & 0x0f => int channel;

Ok, I've worked a bit with it, and in all my ignorance I don't know how 
to correctly handle the remaining part of the data1-part. I tried:

  midi_msg.data1 &0xf0 - 128 => type

this gives me:
     "noteon" => types[16];
     "controller" => types[48];
     "bender" => types[96];

But looking at http://www.borg.com/~jglatt/tech/midispec/messages.htm I 
see noteon should be 8, controller 11 and pitchwheel and bender 14, 
right? How do I correctly and safely extract those types from the 
data1-part?

-- 
peace, love & harmony
Atte

http://www.atte.dk      | quartet:      http://www.anagrammer.dk
http://www.atte.dk/gps  | compositions: http://www.atte.dk/compositions


More information about the chuck-users mailing list