<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>Hi, I think there was a problem in your arduino code:</div>

<div> </div>

<div>you did the testing against the address outside the while loop, so you will only have access to the latest message. The point of the while loop is that it will keep reading new OSC messages till the buffer is empty. So do your matching *inside* the while loop, right after a new message has been filled. Also, since your if clauses are mutually exclusive, you should do 'else if', so it will stop testing once you got 'true'. I attached a corrected version. You can try it and see if it works now. Unfortunately I couldn't test it myself.</div>

<div> </div>

<div>I also did an optimized version, where I made an array fad[0] which gives you more flexibility and lets you do the matching with a simple for loop instead of chained if clauses. Again, not tested.</div>

<div> </div>

<div>For this kind of application, you probably wouldn't need OSC. The question how to handle the bitshifting in a MIDI style protocol has already been answered in this thread ;-)</div>

<div>https://lists.puredata.info/pipermail/pd-list/2016-06/115160.html</div>

<div> </div>

<div>Christof</div>

<div> 
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Gesendet:</b> Donnerstag, 16. Juni 2016 um 22:58 Uhr<br/>
<b>Von:</b> "Martin Peach" <chakekatzil@gmail.com><br/>
<b>An:</b> "pd-list@lists.iem.at" <pd-list@lists.iem.at><br/>
<b>Betreff:</b> Re: [PD] Pduino sysex vs. OSC advice</div>

<div name="quoted-content">
<div>On Thu, Jun 16, 2016 at 11:35 AM, Rick Snow <span><<a href="ricksnow@gmail.com" target="_parent">ricksnow@gmail.com</a>></span> wrote:

<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 0.0px 0.0px 0.0px 0.8ex;border-left: 1.0px solid rgb(204,204,204);padding-left: 1.0ex;">
<div>
<div class="gmail_extra">
<div class="gmail_quote">
<div>
<div style="font-family: verdana , sans-serif;font-size: small;">​Thanks again Christof for pointing me in a promising direction.  I have been working with the OSC tagging via slipenc and slipdec.</div>

<div style="font-family: verdana , sans-serif;font-size: small;"> </div>

<div style="font-family: verdana , sans-serif;font-size: small;">As of now I have fairly reliable communication between PD and the Arduino sketch using a version the patch you provided.  I am able to reliably send messages and the sketch responds as I expect most of the time.  However, when sending several faders simulaneously I get some glitching.  Right now I am wondering if it has something to do with using OSC instead of the raw slip packages.  I do get this message in the pd console but I'm not sure that it relates to the glitching: "slipdec: input packet longer than 1006" </div>

<div style="font-family: verdana , sans-serif;font-size: small;"> </div>
</div>
</div>
</div>
</div>
</blockquote>

<div> </div>

<div>The default SLIP packet length is set n the source:<br/>
#define MAX_SLIP 1006 /* maximum SLIP packet size */<br/>
You can set the maximum packet length by giving [slipdec] a creation argument, e.g.  [slipdec 32768].<br/>
<br/>
Martin
<div> </div>
</div>
</div>
</div>
</div>
_______________________________________________ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list" target="_blank">https://lists.puredata.info/listinfo/pd-list</a></div>
</div>
</div>
</div></div></body></html>