[chuck-users] utility code for sending MIDI messages

Michael Heuer heuermh at gmail.com
Mon Mar 19 12:21:22 EDT 2012

Kassen wrote:
> Michael Heuer wrote:
>> Lucas Zawacki wrote:
>> > I think this hidden gem was mentioned by Kassen somewhere and I've
>> > used it ever since to manipulate MIDI:
>> > http://www.rattus.net/~packrat/audio/ChucK/
>> Ah yes, thanks Lucas, just found this on the ChucK wiki.  Is the
>> author Bruce on the mailing list?
> He used to be, at least, that's how I first heard about this, I think.
> People develop and intrests change; I'm not sure he still is on the
> list.

Maybe someone else can help explain this part to me then?  I'm not
good at bit-twidding.

((command & 0xf) << 4) | ((channel - 1) & 0xf) => midimessage.data1;
command | channel => command;
byte1 & 0x7f  => midimessage.data2;
byte2 & 0x7f => midimessage.data3;

Why is the ... => command; line there?  Isn't that dead code?

The bitwise and value for data2 and data3 (0x7f) is not the same I see
in this java midi library (0xff)




More information about the chuck-users mailing list