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 &quot;if (msg.data1 != 144) continue&quot; lines, change the next if line to &quot;if (msg.data1 != 144 and msg.data3 &gt; 0)&quot;, and change else to &quot;else if (msg.data1 == 128)&quot;, 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">&lt;<a href="mailto:acsmith@willamette.edu">acsmith@willamette.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I&#39;m running into problems getting the MIDI polyphony working.<br>
Specifically, in the ChucK examples, I&#39;m catching all of the noteon<br>
messages but none of the noteoffs.  One thing, I don&#39;t really<br>
understand what &quot;off @=&gt; us[note];&quot; is supposed to do, when &quot;off&quot; 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&#39;t see anything for message 128 in the source code.  I&#39;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&#39;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>