<span style="font-weight: bold;">\</span><b class="gmail_sendername">Piccolos</b> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi all,</blockquote><div><br>Hi there!<br>&nbsp;</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I&#39;m a new Chuck user </blockquote><div>
<br><br>Welcome! <br></div><br><div>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>It works perfectly for noton and noteoff events but when I send A
<br>program Change,<br>an error occurs :<br>[chuck](via RtMidi): RtMidiOut::sendMessage: event parsing error!</blockquote><div><br><br>Yeah, it should work for CC changes as well.<br><br>The issue relates to Program Change messages being two bytes while note and cc messages (the ones which ChucK anticipates) are three bytes.
<br><br>The good news is that it *can* work right now.<br><br>Anyway; if the first byte (.data1) is 192 the MIDI message will be a program change and the receiving end (your synth and apparently rtmidiout) will anticipate one data byte (holding the program number) after this. Sending a second data byte (.data3) is bad midi syntax and this is probably what RtMidiOut is complaining about. In the case of your code the second data byte is probably the .data3 of the last three-byte message you got as your input but I&#39;m a little unsure there because to me it seemed that ChucK&#39;s MIDI in doesn&#39;t realy like two byte input messages&nbsp; either (and I think it ignores single byte clock messages).
<br><br><br>To get back to your problem; I got the output of Program Change messages to work fine with the .data3 set to &quot;0&quot; so I think this should work;<br>---------------<br>msgin.data1 =&gt; msgout.data1;<br>
msgin.data2 =&gt; msgout.data2;<br><br>//this range just covers program change messages<br>if ( (msgin.data3 &gt; 191 ) &amp;&amp; (msgin.data3 &lt; 208) ) 0 =&gt; msgout.data3;<br>else msgin.data3 =&gt; msgout.data3;<br>
<br>mout.send(msgout);<br>---------------<br><br><br>...but right now stuff isn&#39;t pluged in here so I can&#39;t test meaning no refunds or waranty in case of fire, crashes or both. I got it to work with&nbsp; .data3 zero-ed out on Windows at least. 
<br><br><br>Hope that helps,<br>Kas.<br></div></div>