Just FYI, the only reason I'm using OSC as a wrapper is due to way the "host / server" program (Touch Designer) works. It's the fastest way to transmit UDP when communicating with an Arduino (that I can use right now, with my hardware/ software combo). I'm using a very new Arduino Uno R3, and a very new Arduino Ethernet Shield, which I haven't mentioned yet.
My incoming OSC message is always formatted like this - it never varies in its format. From http://opensoundcontrol.org/spec-1_0
An OSC message consists of an OSC Address Pattern followed by an OSC Type Tag String followed by zero or more OSC Arguments.
The incoming message is "/ard/12345", where the argument is always a 5 digit int. It could be "11111", or "91919", but it will never be longer or shorter than 5 digits. The address will never change, it's always "/ard".
When the OSC message arrives at the Arduino, I want to "intercept" it, then break the OSC message argument into 5 variables- 5 single digits ints.
Each of these will will be used to drive processes on the Arduino. They are not specific processes yet. I'm trying to build a solid communication foundation between Touch Designer and Arduino first, before I start designing Arduino processes. So, for example, I could create a scenario like this:
argument digit 1 becomes a variable that is used to drive a motor
argument digit 2 becomes a variable that is used to drive an led
argument digit 3 becomes a variable that is used to drive a different led
etc.
After the Arduino has intercepted, interpreted, and used the incoming message, I'll send a customized message back to Touch Designer.
There are many OSC libraries for the Arduino, the reason I am using OSCuino is that it seems like the most robust. But I'm finding the documentation to be over my head. I can successfully receive OSC bundles, and I can build custom messages and bundles to send. It's pretty easy to build bundles to send:
OSCBundle bndlOUT;
bndlOUT.add("/from_ard").add(111);
Udp.beginPacket(Udp.remoteIP(), outPort);
bndlOUT.send(Udp);
Udp.endPacket();
The part of this process that I'm stuck on is how to (on the Arduino) break the incoming OSC message argument into 5 variables- 5 single digits ints. Once I have those, I can use the variables in custom functions.
Thanks very much for your help-