Change skew of parameter in apvts

I have created my parameters using apvts and everything works perfectly fine. However, I want to be able to change the “skew” of a specific parameter when the user presses a button.

My parameter is built as follows:

        parameters.push_back(std::make_unique<juce::AudioParameterFloat>("RATE", "Rate", juce::NormalisableRange<float>(0, 1, 0.001, 0.3), 0.12));

And when the user presses a toggle button, I want the skew to toggle between 0.5 and 0.3.

Through a button listener in the audioProcessor, I’ve tried:

            apvts.getParameterRange("RATE").setSkewForCentre(0.5);
            DBG(apvts.getParameterRange("RATE").skew);

But the skew doesn’t change. DBG still prints 0.3.

Is there a way to do it?

I don’t think there’s a way to do this directly on the parameter.

Instead, the skewed parameter should probably use a plain normalised (zero to one) range, and the skew should be applied externally. That is, the ‘skew control’ parameter should be checked and used to compute the current value of the skewed parameter. You’ll also need to supply custom ‘value to text’ and ‘text to value’ functions to the skewed parameter, and account for the ‘skew control’ parameter in these functions too.

1 Like