Matrix switches and label

Hi,

in the matrix props i set an empty object and label it with an array by OSC receive.

var props = {}; var labels;
labels = OSC{...};
props.label = labels[$]
return props

which is working, but i have a built in "scanner" that could add elements to the matrix
when an element is added, the last element just has a number in it, but not the string that is passed by the osc listener(reduce an element seems to be no problem).
The osc messages is correct...

I think JS code is executed before the osc listener, or something like that, but how could i avoid this behaviour ? (can i label props.label without $ ?)

Thanks!

If you want to have scoped advanced syntaxes you’ll need to use a matrix of clone widgets instead (see clones_and_variables.json example from this thread ).

Thanks, it turns out it is more easy to use with just a switch :slight_smile:

Another question comes to mind:

rigsListArray = Object.entries(rigsList); //convert object to an array with key/value pair
rigsListArrayPart = rigsListArray.filter(([key,value]) => (value >= 15 && value < 19)) //filter array by value
rigsListPart = Object.fromEntries(rigsListArrayPart); // convert array to an partly object than the origin

with this code i get only parts of my object (which values are 1,2,3,... )

is there a more convenient way to do this, i don't found another solution...

Thanks!

is there a more convenient way to do this

Not that I know of, sorry