In the top left corner of FLStudio, when you change a parameter, it shows you the value and a suffix to what you’re currently changing.
My plugins just show the value but no suffix. Is there a way to implement that?
In the top left corner of FLStudio, when you change a parameter, it shows you the value and a suffix to what you’re currently changing.
My plugins just show the value but no suffix. Is there a way to implement that?
I think it’s the ‘label’ in here:
https://docs.juce.com/master/classAudioProcessorValueTreeStateParameterAttributes.html
Thanks for the reply. I couldn’t make what you provided work but it helped me stumble across the AudioParameterFloat page, where I realized I could simply add the label there. Must’ve overseen it the first time I checked.
Here’s the code, maybe someone having the same question stumbles upon this thread someday
params.push_back(std::make_unique<juce::AudioParameterFloat>("MIX", "Mix", juce::NormalisableRange<float>(0, 100, 0.1), 100.0, "%")); // ID, name, (min, max, steps), start, label
It’s also worth mentioning you can provide lambda functions that convert to and from string so you can make it look exactly like you want…value adjustments, pre/post fix additions etc.
Sounds interesting, could you please elaborate on that with an example? I’m not sure I fully understand what you mean.
If you look at one of the constructors for AudioParameterFloat you’ll see that you can pass in two functions. The first can return a string from the value and the second one can return the value from a string.
It’s this constructor:
AudioParameterFloat (const ParameterID ¶meterID, const String ¶meterName, NormalisableRange< float > normalisableRange, float defaultValue, const String ¶meterLabel, Category parameterCategory=AudioProcessorParameter::genericParameter, std::function< String(float value, int maximumStringLength)> stringFromValue=nullptr, std::function< float(const String &text)> valueFromString=nullptr)
Note the last two parameters. You can pass in your own functions there. This way you have full control over the string representation of your float.
i’d advice handling this completely with the lambdas that convert values to strings and strings to values. that enables you to also make good labels for things where a number is not simply followed by a unit, but some other type of value display, for instance temposync values (…, 1/16t, 1/16., 1/16, …)