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.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Mark Kropf
  • 101
  • 1
  • 5
  • 1
    Shouldn't the second line be: `server.addCallback("/octobar/togglearray/2/2",&togglearray);` – Philipp Horn Sep 18 '12 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 Sep 18 '12 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 0`and `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 1`then `/2/2`is 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) – Philipp Horn Sep 19 '12 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 Sep 19 '12 at 14:57

1 Answers1

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();
 }
john_science
  • 6,325
  • 6
  • 43
  • 60
user1714819
  • 131
  • 1
  • 9