Set dynamically switch values

Lot of hope in this one.

Is there a way to set dynamically switch values, so the number of switch is set with an OSC message containing that value.

I did it in matrix, but matrix is not working for the purpose.

[...], so the number of switch

I don't understand that part sorry.

You can put an OSC{} block in the values property to make it editable with an osc message: try loading this session and sending /switch_1/values '{a:1,b:2,c:3}' to o-s-c.

I edited my question.
the message that I'm receiving is just an integer number that I cannot modify.
if I'm receiving '10' -> get 10 switches.

Then process that number with a bit of js, for example:

JS{
var n_values = OSC{values} || 3
return Array(n_values).fill(0).map((val,index)=>index) // [0,1...n_values]
}
1 Like

this kind of example will help me to progress
thx