KUIML - using strings in parameter formulas

Official support for: bluecataudio.com
Post Reply New Topic
RELATED
PRODUCTS

Post

Hello,
I have a knob to control panning with a range of values from -100 to 100. Is it possible on the KUIML side to prefix L when the value is < 0, R when the value is > 0, and C when the value equals 0?
I believe it will be some manipulation of PARAM_TEXT's content="", but I'm not quite sure where to start.
Thanks :)

Post

ajl1606 wrote: Wed Mar 22, 2023 3:31 pm Hello,
I have a knob to control panning with a range of values from -100 to 100. Is it possible on the KUIML side to prefix L when the value is < 0, R when the value is > 0, and C when the value equals 0?
I believe it will be some manipulation of PARAM_TEXT's content="", but I'm not quite sure where to start.
Thanks :)
Automatic text display doe snot have conditional capabilities, so I think the only way is to do it manually with script actions:
param.value_changed event => trigger script action that updates a string, displayed in a simple TEXT widget.

Post

Ah, OK. Is the following sort of on the right track?

Code: Select all

<PARAM id="pan_knob" min="-100" max="100" />
<STRING name="pan" />
<TEXT string_id="pan" />
<ACTION_TRIGGER event_id="pan_knob.value_changed" script="if (pan_knob.value < 0) { pan = "L"; } else if (pan_knob.value > 0) { pan = "R"; } else { pan = "C"; } pan += abs(pan_knob.value);" />

Post

Looks like a good starting point, indeed!

Post Reply

Return to “Blue Cat Audio”