Receive specific argument

Hello,
I´m very new to OSC and I find it fascinating. I am actually using it to control a Robot and I think it is a great solution.
I have a simple question I can´t find answers for.
My robot is sending an OSC message with 2 arguments that I can see on the debug as:
OSC received: {
address: '/oscRobot/move',
args: [ 19.75, -2.59 ]
} From: 192.168.2.105:60036

How can I visualize each argument on a knob?

I know I can send the messages separately and assign specific addresses to each widget such as /oscRobot/move/x and /oscRobot/move/y, but this is not efficient and it seems like there should be a way to do this easily, right?

Thanks!

Hi, there are two ways to separate the arguments received by open stage control:

Using a custom module

Incoming messages can be routed to different addresses (ie different widgets) using a user-written piece of code refereed as custom module, I posted a short example in this topic.

Using a script widget

A script widget listening on /oscRobot/move can dispatch the arguments it receives, its script property would look like:

// o-s-c v1.0.0
set('knob_1', value[0])
set('knob_2', value[1])

or

JS{{
// o-s-c v0.49.12
set('knob_1', value[0])
set('knob_2', value[1])
}}
1 Like

Thanks, @jean-emmanuel, that code made the magic happen!
I really appreciate it!
Just out of curiosity. Would either of your two proposed methods be more efficient in some way?