How can I increase precision of an AudioParameterFloat?

Hi,

I’m using std::make_unique<juce::AudioParameterFloat>("normDryParam", "Norm Dry", 0.0f, 1.0f, 1.0f) to setup a basic param. But I see it “snap” to a fixed precision (seems 1e1).

How can I increase it? So that 0.0001 and 0.0002 are considered different?

Thanks

IIRC, there’s a constructor that takes a NormalisableRange and you can provide the interval for that.

I know this doesn’t directly answer your question, but if your parameter needs that kind of precision you might wanna work out a better range entirely. for example a lot of people, who design sampler-type instruments, make the mistake of using linearly skewed attack knobs, even though more than 10ms is rarely needed on something like a piano sample. the solution is not to let users go even finer between 0.00001 and 0.00002 % of the knob, but to skew 0 to 10ms across at least 25% of it and let the rest of the range be less precise

3 Likes

Got it:

auto createRange = [](float min, float max)
{
    juce::NormalisableRange<float> range(min, max, 0.001f);
    return range;
};

std::make_unique<juce::AudioParameterFloat>("normDryParam", "Norm Dry", createRange(0.0f, 1.0f), 1.0f),

Thanks, as usual :slight_smile:

1 Like