IIRC, note offs are sometimes sent as note ons (0x9n = 144 for channel 0) with velocity 0, and sometimes as the dedicated note off message (0x8n = 128 for channel 0) - which of these methods you get depends on the controller.<div>
<br></div><div>So try removing the "if (msg.data1 != 144) continue" lines, change the next if line to "if (msg.data1 != 144 and msg.data3 > 0)", and change else to "else if (msg.data1 == 128)", and see how that works. This is coded off the top of my head, but I hope you see what I mean.<br>
<br></div><div>/Stefan</div><div><br><div class="gmail_quote">On Mon, Apr 20, 2009 at 6:45 AM, Andrew C. Smith <span dir="ltr"><<a href="mailto:acsmith@willamette.edu">acsmith@willamette.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I'm running into problems getting the MIDI polyphony working.<br>
Specifically, in the ChucK examples, I'm catching all of the noteon<br>
messages but none of the noteoffs. One thing, I don't really<br>
understand what "off @=> us[note];" is supposed to do, when "off" is<br>
an Event. Basically, all of my noteon messages are coming as [144 key<br>
vel] while my noteoffs are coming as [128 key 64]. How does this<br>
work? I don't see anything for message 128 in the source code. I'm<br>
testing on this one:<br>
<a href="http://chuck.cs.princeton.edu/doc/examples/midi/polyfony2.ck" target="_blank">http://chuck.cs.princeton.edu/doc/examples/midi/polyfony2.ck</a><br>
<br>
Thanks everyone. I tried reprogramming my keyboard (Korg Kontrol49)<br>
but I couldn't figure out how to make it work.<br>
<br>
Andrew<br>
_______________________________________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Release me, insect, or I will destroy the Cosmos!<br>
</div>