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sh9MUX8XZC
Pretty straight forward example really. I've added a slider, and I'm trying to do this:
Content.makeFrontInterface(600, 600); const var Knob1 = Content.getComponent("Knob1"); Knob1.setValue(0.43);
But the value never changes. Is this a bug, or am I massively misunderstanding the intention here?
I'm on the develop branch. This commit:
6d43b53 - - more doc fixes -
@Orvillain Have you set
saveInPreset
to true? because then it will override whatever value you set in the onInit callback. -
@Christoph-Hart
Ahhhhhhhhhh! Good shout. That works for the minimal example, but I'm still having an issue in my larger example.Basically I'm updating the knob value from a draggable point in a custom panel. And now that I've set the save in preset to false, it does update the visual display. However, the new value is not flushing through to the connected processor, which is a Scriptnode synthesiser.
I can come up with a simple example project, but if you have any ideas in the mean time?
The end goal is to update a UI widget from a panel event.x position, at the same time as updating a DSPnetwork's top level macro parameter value.
-
@Orvillain I might not be following 100% here but if you're setting the value of a control with
setValue()
it won't actually trigger the control to do its thing. For that you need to call.changed()
after setting the value. -
@d-healey said in Why is ScriptSlider.setValue() not working here?:
@Orvillain I might not be following 100% here but if you're setting the value of a control with
setValue()
it won't actually trigger the control to do its thing. For that you need to call.changed()
after setting the value.Bah! Okay, this is not a bug then. Just my unfamiliarity. This fixed it. Cheers!
-
-