AudioProcessorValueTreeState Changes Slider UI settings

I was following the tutorial for AudioProcessorValueTreeState and added all my existing parameters into the Tree. I then added attachments for my sliders. However, when I do this my sliders now display differently, values display with 3 decimal places, sizing of the slider in a grid view are changed.

Once added as a SliderAttachment it seems some of the slider properties are ignored since I can’t seem to get them to work the same as before adding the Slider to the Tree

Is this something that is expected or is this user error?

auto range { juce::NormalisableRange<float> (0.0, 1.0, 0.01) };

auto param { std::make_unique<juce::AudioParameterFloat> ("paramID", "Parameter Name", range, 0.5f, {}) };

The third arguments of juce::NormalisableRange is the interval. If you only provide start and end value, it will defaults to 0 interval which will shows trailing decimal numbers.

Yes, it is expected.
The Slider should behave exactly as the parameter when seen from the host. That’s why all customisation, like the before mentioned NormalisableRange, as well as the textFromValue and valueFromText lambdas are propagated to the Slider.

You can override this when you specify Slider settings after you added the SliderAttachment, but it is not advisable. It is better practice to customise the Parameter and let it propagate to the Slider for consistency with the host, like mentioned before.

Have a look at this AudioParameterFloat constructor.

Thank you both for your answers. I will experiment with this and see if I can understand what it is doing.