Display control parameter on label
-
Hi all, I'm relatively new to this but I'm wondering how I go about displaying a parameter (for example, left delay sync time) on a label that updates whenever the slider is changed?
-
@paper_lung In the slider's callback you can set the label's text property. Or you can get rid of the label completely and use LAF.
-
@d-healey Thanks. The thing I'm unsure about is how to connect the label to the sliders parameter - as in which command should I be looking for? There's a ton in the API such as 'getparameter' - would it be something like that? Sorry for the dumb question, trying to wrap my head around it!
inline function onKnob1Control(component, value) { Label1.set("text", "text goes here" + commandgoeshere? ()); }; Content.getComponent("Knob1").setControlCallback(onKnob1Control);
-
@paper_lung You don't need to connect the label to anything, the label is just for displaying the value.
To change the parameter of a module you can use the
setAttribute
function from within the slider's callback.For example to change the attack of an envelope you could use something like
envelopeReference.setAttribute(envelopeReference.Attack, value);
Replace
envelopeReference
with the variable that references your envelope. -
@d-healey Great, that makes sense, thanks for the help!