NormalizableRange - Making interval Parameter Dependent

Hi everyone,

I am trying to make the interval in my NormalizableRange gainSteps change depending upon the current value of the gain. I have called


In my NormalizableRange function with something like

if (*apvts.getRawParameterValue(BAN1_GAIN_ID) >= 3.0f || *apvts.getRawParameterValue(BAN1_GAIN_ID) <= -3.0f )
  interval = 1.0;
} else {
  interval = 0.5;

However, since I called gainSteps within my apvts, where my parameter ranges lie, everything compiles correctly and crashes my DAW instantly. I’m guessing this causes some kind of recursion where both apvts and gainSteps call each other, and the DAW doesn’t like that.

Do you all know of a workaround for this?

I would love to have gain steps of 0.5 dB between 0 and ±3 dB, 1 dB steps between 3 and 6 dB, 2 dB steps between 6 and 12 dB, and a 3 dB step from 12 to 15 dB.

Thank you for your help,