Listeners, Get and updating a fader from received messages

Hello, I think I'm still struggling to understand the syntax and general mechanics on these topics.

I have one address to send an OSC volume change message ( let's say set/volume) and another one to receive the volume value in case of an external change ( get/volume).

I can create a fader that modifies the volume with set/volume, no problem, it works very well but then... I don't know how to operate. I tried several methods but without result.

The only thing I managed to do was to create a button that sends a message to the get/volume address and then see in the console that a message was received with the value of the volume, but I didn't even manage to display this value in a text widget, and even less to modify it dynamically...

If someone could help me... :slight_smile:

Thanks !

Could you paste the logs that show the received messages ? That'll help guiding you through.
The common usage is to have feedback sent back on the same osc address as the control message (see General mechanics - Open Stage Control)

Sure,
(DEBUG, OSC) Out: { address: '/track/get/name', args: [ { type: 'i', value: 0 } ] } To: 127.0.0.1:11000
(DEBUG, OSC) In: { address: '/track/get/name', args: [ 0, '1-E-Piano Basic' ] } From: 127.0.0.1:11000

The common usage is to have feedback sent back on the same osc address as the control message (see General mechanics - Open Stage Control)

Yeah i know and believe me, i read that page many many times :slight_smile: But I didn't make it...

You use Abletonosc ?

Notably yes but I have the same problem with arduino osc projects but for the last two days it's on abletonOSC that I get my head around ahah :slight_smile:

Or for the volume :
(DEBUG, OSC) Out: {
address: '/live/track/get/volume',
args: [ { type: 'i', value: 1 } ]
} To: 127.0.0.1:11000
(DEBUG, OSC) In: { address: '/live/track/get/volume', args: [ 1, 0.8500000238418579 ] } From: 127.0.0.1:11000

The key here is the number of arguments sent back by ableton:

args: [ 1, 0.8500000238418579 ]

Two arguments are sent here, the first is most probably the track number and the second is the value you're interested in. A widget can't decide which argument should be interpreted as the value, and the arguments before the value are of importance to determine what the messages are for.

That's what the preArgs property is for, it allows deciding what "static" arguments a widget should look for before the "value" argument. For instance, a fader or a text widget with

  • address: /live/track/get/volume
  • preArgs: 1

will only receive messages on this address with a first argument equal to 1. Additionally, the fader widget in this case would only receive messages with exactly two arguments because it only expects a single value (the text widget doesn't care, and for example an xy pad would expect 2 values).

Sometimes you need more that one static argument before the value(s), in which case the preArgs property must be formatted as a javascript array:

[
  1,
  "A"
]

Thank you very much for this detailed answer. I didn't really understand how the preArgs work on the received messages I think.
I don't have time to try it now but I think it should already be a big help.

It works perfectly well, i'm able to get the values. Many thanks.
It's just that abletonOSC has a weird behavior (i think it's just because it's in alpha version) ; changing values in Ableton doesn't send anything, you have to send a message to the 'get' address to Ableton and then Ableton send the value. I'm not sure that there's a strategy to have a fluid behavior in Open Stage Control (send a get message every xxx ms ? :face_with_diagonal_mouth:)