KUIML - Randomising parameters

Official support for: bluecataudio.com
Post Reply New Topic
RELATED
PRODUCTS
Plug'n Script

Post

Hello,

I'm using an IMAGE_ACTION_BUTTON to randomise parameters on my plugin. It calls an ACTION that runs a script. It works, but sometimes the results are unexpected, as though some parameters update and others don't. Could you have a glance at my code below and see if there are any obvious errors? By the way, this is a custom skin in use after the plugin has been exported, hence dsp.input1 etc.

Code: Select all

<EXPOSED_OBJECTS object_ids="dsp.input1.*;dsp.input2.*;dsp.input3.*" />
<ACTION id="randomise" type="Script" script="
    dsp.input1.BeginCapture();
    dsp.input1 = rand(dsp.input1.min, dsp.input1.max);
    dsp.input1.EndCapture();
    dsp.input2.BeginCapture();
    dsp.input2 = rand(dsp.input2.min, dsp.input2.max);
    dsp.input2.EndCapture();
    dsp.input3.BeginCapture();
    dsp.input3 = rand(dsp.input3.min, dsp.input3.max);
    dsp.input3.EndCapture();" />
<IMAGE_ACTION_BUTTON action="randomise" />
The knobs move, and the DSP responds correctly about 50% of the time. (If just moving the knobs by hand, the DSP responds as expected at all times.)

Thank you!

Post

Hi,

Sorry for the delay! The code looks fine at first sight, what kind of results do you get in the DSP when it does not behave properly? Do the parameters look fine in the host application? (which plug-in format is it btw?)

Post

No worries! I was able to solve it in the end. It was my own error in the DSP side, and had to do with double to integer conversions. The random parameter values were all doubles and my parameters were using integer steps, so sometimes the rounding would cause unexpected results (wasn't obvious to see because the knobs would automatically snap, even if their underlying value was a decimal value - saw that once I switched to the generic editor). Thanks for confirming the KUIML code, though! All works well now :)

Post

Great news! Thanks for the heads up!

Post Reply

Return to “Blue Cat Audio”