Knobs in matrix : change range?

Hi,

i'm trying to use a matrix of knobs.
I Would like to send a range of value between 0 and 127. What is the good syntax to use in props ?
How to set up the ids to string ?

JS{{

var p = {}
var ids = ['A', 'B', 'C', 'D']
var colors = ['auto', 'red', 'cyan', 'orange']

p.id = ids[$]
p.label = ids[$]
p.colorWidget = colors[$]

/* doesn't work. What is the good syntax to use ?
p.range.min = 0
p.range.max = 127
*/

p.steps = 6


return p

}}

I have read this topic.

Furthermore, the A, B, C, D labels seem not to work too.

matrix-knobs-01.json (3.5 KB)

Cheers

I Would like to send a range of value between 0 and 127. What is the good syntax to use in props ?

In your case:

p.range = {min:0, max: 127}

or

p.range = {}
p.range.min = 0
p.range.max = 127

Furthermore, the A, B, C, D labels seem not to work too.

Knobs don't have a label property.

ok it works

for the labels i meant the id. :slight_smile: so the ids are not correct

Ids are correctly set, what leads you to think otherwise ? My guess is the address that in this case does not default to /id since it's inherited from the matrix itself (with /$ appended to it).

i'd like for the address to get /matrix_1/A , /matrix_1/B

Then write

p.address = "/matrix_1/" + ids[$]

yep. Thanks !
how to dynamically get the matrix id ? suppose i decide to change the matrix_id
something better than this wrong syntax
p.address = {@parent(id]}+ ids[$]

Is it possible to get the same behaviour using the matrix address property ? Which syntax in that case ?

p.address = @{this.address} + "/" + ids[$]

Great !

i meant into the matrix address field of the OSC property :slight_smile:

No it's not possible.

Cette syntaxe est une syntaxe propre à o-s-c ou bien est-ce réellement du javascript ?

Non ce n'est pas du javascript.