Hi,
I’m seeing some odd behavior with display of plugin value/text depending on which constructor I use (first one uses NormalisableRange second one uses float minValue, float maxValue, float defaultValue).
When running in Ableton Live 10, I see the display of text in the automation lane when changing the value with mouse and in the plugin parameter page differently. The text is displayed in what looks like the raw 0.0 to 1.0 range in when using the first constructor and in the range of the min/max (0 to 100) when using the second constructor. I want to append a percent sign to the value shown and the first constructor is the only way to set that.
I’ve created two parameter using the different constructors to demonstrate the behavior. I’ve tweaked around with the values for the NormalisableRange but nothing seems to fix this issue.
Is this a known issue in Live or with the AudioParameterFloat class?
auto stringFromVal = [] (float v, int length)
{
String asText (v, 2);
return length > 0 ? asText.substring (0, length) : asText;
};
addParameter (Gain1_ = new AudioParameterFloat ("Gain1_", "Gain1", {0.0f, 100.0f, 0.01f, 1.0f}, 100.0f, "%"
, juce::AudioParameterBool::genericParameter, stringFromVal));
addParameter (Gain2_ = new AudioParameterFloat ("Gain2_", "Gain2", 0.0f, 100.0f, 100.0f));
The UI drawn by my plugin editor uses the following code. The coreValue returns the 0.0 1.0 value and the other two return the desired percent value (22.03%).
auto coreValue = param->getValue();
auto value = param->getCurrentValueAsText() + "%";
auto valueText = param->getText(coreValue, 4) + "%";
Here are screenshots of the UI:

