Go Down

Topic: OSC Messages failling to correctly send value (Read 430 times) previous topic - next topic

HenriKoenig

Hi All,

I'm a novice programmer working on an OSC controller project for Qlab using Mega and Ethernet Shield V2.
I'm using the following libraries acquired from Arduino site and from CNMAT for the OSC stuff:

SPI.h
ethernet2.h
ethernetUdp2.h
OSCBundle.h


I've had some fairly good results so far, but I'm getting stuck at formulating an OSC message which carries a value attached in a way that is accepted by Qlab.

So if I send an OSC message that is purely an address like:

       /for/example/this

I have no issue at all and Qlab responds every time with the expected reply.

The problem arises when I try to send a message with a value like:
     
       /for/example/this/value 1

Then I never get the expected response from Qlab, as if it never receives the value part.
I've tried two different approaches, one which is to create the message complete with value, the other to use the OSC add function to add the value after the address has been define.

Here's the code showing both methods tried:

Code: [Select]


// Method one with value integrated with message
      Udp.begin(destPort);
      OSCMessage msgOUT("/cue/3/preWait 1");
      msgOUT.add(value);
      Udp.beginPacket(outIp, destPort);
      msgOUT.send(Udp); // send the bytes
      Udp.endPacket(); // mark the end of the OSC Packet
      delay(20);
      msgOUT.send(Serial);
      Serial.println();
      msgOUT.empty(); // free space occupied by message

     
// Method two with adding the value after
      int value = 1;
      Udp.begin(destPort);
      OSCMessage msgOUT("/cue/3/preWait");
      msgOUT.add(value);
      Udp.beginPacket(outIp, destPort);
      msgOUT.send(Udp); // send the bytes
      Udp.endPacket(); // mark the end of the OSC Packet
      delay(20);
      msgOUT.send(Serial);
      Serial.println();
      msgOUT.empty(); // free space occupied by message



Neither methods get a response or reaction from Qlab but print in the serial monitor differently:

Method one prints: /cue/3/preWait 1
Method two prints: /cue/3/preWait,i

Now where I get a little confused is if I send a random OSC Message to Qlab with value like:
     
      /a/random/value 2

And then ask Qlab to capture the message to control go for example, it captures it exactly as represented above irrelevant of wether I use method one or two to create the message on Arduino.

Now if I send the same custom OSC message above to the Arduino from Qlab the serial monitor prints:

/a/random/value,i

I'm appreciative of any help or advice. I've also included a copy of the complete sketch.

Thanks
Henri


Go Up