Hi, I think there was a problem in your arduino code:
 
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.
 
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.
 
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 ;-)
https://lists.puredata.info/pipermail/pd-list/2016-06/115160.html
 
Christof
 
Gesendet: Donnerstag, 16. Juni 2016 um 22:58 Uhr
Von: "Martin Peach" <chakekat...@gmail.com>
An: "pd-list@lists.iem.at" <pd-list@lists.iem.at>
Betreff: Re: [PD] Pduino sysex vs. OSC advice
On Thu, Jun 16, 2016 at 11:35 AM, Rick Snow <ricks...@gmail.com> wrote:
​Thanks again Christof for pointing me in a promising direction.  I have been working with the OSC tagging via slipenc and slipdec.
 
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" 
 
 
The default SLIP packet length is set n the source:
#define MAX_SLIP 1006 /* maximum SLIP packet size */
You can set the maximum packet length by giving [slipdec] a creation argument, e.g.  [slipdec 32768].

Martin
 
_______________________________________________ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list

Attachment: _60_LEDs_OSC_HueSat_evenOdd_korr_optimized.ino
Description: Binary data

Attachment: _60_LEDs_OSC_HueSat_evenOdd_korr.ino
Description: Binary data

_______________________________________________
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list

Reply via email to