2

I can not find an OSC library for Arduino that supports Touch OSC's multitoggle controls. Am I doing something wrong, or is there a library that does have support for this control?

The library I'm using: https://github.com/recotana/ArdOSC

The OSC message I'm sending from Touch OSC:

/octobar/togglearray/2/2 1.

The Snippet relative to catch it on the Arduino:

server.begin(serverPort);
server.addCallback("/octobar/togglearray",&togglearray);

void togglearray(OSCMessage *_mes) {
    Serial.println("Toggle Array");
}

I do have other callbacks working, and I have not pasted all of the server code here since it is working with fader and push button controls. The problem seems to be any control that supports multiple selection.

4
  • 1
    Shouldn't the second line be: server.addCallback("/octobar/togglearray/2/2",&togglearray); Commented Sep 18, 2012 at 15:07
  • A toggle array is a table of toggle-able buttons. The /2/2 portion of the OSC message defines the row/column on that array. Oddly enough, I thought about writing a callback per every row and column and it doesn't work. I'm really trying to avoid changing the OSC layout to have 40 individual buttons aligned perfectly in an array.
    – Mark Kropf
    Commented Sep 18, 2012 at 19:33
  • 1
    The manual for TouchOSC differentiates between Addressing the first toggle in the first row (indexes in OSC path) /multitoggle/1/1 0and Addressing the first toggle in the first row (indexes as parameters) /multitoggle 1 1 0. If the message you're sending is /octobar/togglearray/2/2 1then /2/2is part of the OSC-Address and should be in the callback. I guess you have to send the message with "indexes as parameters" (but I didn't find how to do that in the manual) Commented Sep 19, 2012 at 12:48
  • Philipp, thank you, yes I really wish the TouchOSC app allowed us to select indexes as parameters. Thus far I've not found the ability to set this option in the app.
    – Mark Kropf
    Commented Sep 19, 2012 at 14:57

1 Answer 1

0

I have been trying to do almost exactly this and switched to the Z_Osc library as I could not work out how to parse the incoming messages using ArdOsc.

I do something like this:

 rcvMes=server.getMessage();
 mess=rcvMes->getZ_OSCAddress();
 if (mess.startsWith("/1/multitoggle1/")) {
     y=(mess.substring(16)).toInt(); 
     x=(mess.substring(19)).toInt();
 }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.