Hi,
I'm working on my first patch which is a controller for Hy-Rep2, which contain 8 same track sequencing.
After creating my first track I wanted to duplicate it to create "Track02" but they are sharing same value despite I change the main panel container.
Does it means I need to customize every controller ?
Best
Yes. A way to do so is to use the panel's variables property:
{
"n": 1
}
And use it to define it's children's ids (@{parent.variables.n}). When copying the panel, incrementing that variable will increment all the children too. If using a clone widget, the variables property can be overridden with the props property:
{
"variables": {"n": 2}
}
Edit: it's also possible to use the paste action "ID + 1" that will simply paste copied widgets and increment their id automatically.
The paste function “ID + 1” is fine, I didn’t saw it because I’m always using shortcut.
But I need to understand "n" : 1 solution.
btw it can be a cool solution to have hierarchy
A problem with "ID +1" is that doesn’t take the update +1 on “text” that is getting value from @{knob}
And at this time I did not succeed with the ( @{parent.variables.n} )
Here is a simple example: clone_variable_n.json (5.5 KB)
The panel on the left is the “template” widget, its variables property is used to define its children’s ids (and the texts’ values). The panel on the right is a clone widget targeting the template widget that overrides the variables property.
so I’m diving into cloning, it seems to be really powerful,
I’m only have one problem
in my midi prearg I wrote :
[
6,
20 + @{parent.variables.n}
]
and … that’s not working like this
I have this matrix button with custom js in the props so I tried to add the #{} but did not work I changed the JS{{}} by #{} which can contain other #{} but same error :