Mixing JS{{$}} and OSC{/address, 0}

Hello… again ?

I’d like to set the label of each button on a matrix to listen a different OSC address.
I tried different configurations, but none are working.
Placed in the props property :

“label”: “OSC{/2/labelEffect/JS{{return }},JS{{return }}}”

OR

“label”: “JS{{return OSC{/2/labelEffect/,}}}”

Is that possible ?

PS : Thank you for your time, I made a donation to the community this morning :innocent:

Hi,
mixing this is not possible as far as i know.

if your osc addy is "/x/labelEffect"

you could make "x" objects of type "strip" in the field "variables" you define e.g.:

{
"n": 1
}

in this strip you place your button
in property label

OSC{/@{parent.variables.n}/labelEffect }

then copy the strip, and replace variable n to your liking

or maybe better depending on how to often you have to update these labels, do this in a custom module...

hope i could help out (unfortunatly i don't have my main computer working right now)

greetz
schoko

@{} and OSC{} calls are resolved before JS{{}} calls so

OSC{/2/labelEffect/JS{{return }},JS{{return }}}

can’t work, but

JS{{return OSC{/2/labelEffect/,}}}

works (just tested it).

Note that osc listeners (OSC{}) inherit the widget’s preArgs by default (see docs for how to avoid this).

PS : Thank you for your time, I made a donation to the community this morning :innocent:

Thanks :slight_smile:

Oups, the forum doesn't display the dollar sign "$" I put after each return here :

And also no displayed here, before and after the comma :

You are using invalid quote characters (aka smart quotes) that o-s-c fails to interpret, I’m considering adding support for these since you’re not the first to bring this up.

Anyway, it seems I have overlooked your problem and I think you should follow this example to get a better control over your widgets, which a basic matrix widget hardly provides : Changing icon on matrix wdget based on on/off

Soooo flexible ! I used the your matrix example and use /EDIT command to update the label value.

Thank you again !