Cabbage Logo
Back to Cabbage Site

Set slider values after declaration

Hello,

Is there a way to make a widget’s parameters (like min, max,…) to be dependent of some other widget’s parameter? It would be handy if you could pop formulas in there as well.
Cabbage set value could do it in the code, but only a widget’s current value I think, no other parameters.

Regards,

Yorick

You can’t change a slider’s min/max/skew/increment after it has been created. This would cause automation to break in the host. As far as I know, no plugin formats (VST/AU/etc.) allow it. But you could set the slider to use a generic 0 to 1 range, and then use the value of another widget to scale the values.

1 Like

Ok,
thank you
I didn’t know you could scale a widget with another widget.
How would you be going about it ?

My idea was to simply multiply the output of one slider by another. The result will be one slider scaled by the other. In this example also update the popup box for the main slider, which makes it appear that its range has been modified. In reality it’s still 0 to 1, so automation will still work fine in a host. It’s a bit of a hack, but should work Ok.

dynamicRanges.csd (909 Bytes)

1 Like

Works as I want, with some value transformation added.
Thanks again !
Just a minor thing that the main slider updates only after changing its value.

dynamicRanges.csd (2.2 KB)

Once I put the code into an instrument, the popup-text only updates once I engage the instrument and then stays the same while turning the main slider or scaling slider.
The same happens with the push buttons, they only update after playing the instrument.
I have no idea why this happens.

They only update after you start the instrument because the coffee to update then is inside that instrument. You can you a dedicated instrument that is always on to handle these things. Then it should work ok. :+1:

I tried placing the block at the start of the instrument, to make sure it’s not ‘‘in the instrument’’, but still no difference whatsoever. So if I understand it well, you mean to assign it to a different instrument number ?

Ok, using a separate instr for managing the GUI works fine.
Thanks again!

1 Like