Displaying the modified value of Label associated to a slider when the GUI loads

Hi all,
I am using the function textFromValueFunction to modify the text of a label associated to a slider. I can indeed change that text but only when the slider is actually moved, whereas I would like to have it changed already when the GUI is created. I am using this code:

class PanelFilter 
{
public:
    
    PanelFilter (AudioProcessorValueTreeState& valueTreeState)
    {
        filterSystemDecayLabel.setText ("System Decay", dontSendNotification);
        filterSystemDecayLabel.attachToComponent (&filterSystemDecaySlider, true);
        addAndMakeVisible (filterSystemDecayLabel);
        addAndMakeVisible (filterSystemDecaySlider);
        filterSystemDecayAttachment.reset (new SliderAttachment (valueTreeState, "system_decay_panel_filter", filterSystemDecaySlider));
        
		filterSystemDecaySlider.textFromValueFunction = [](float value)
        {
            float systemDecay = value / PluginConstants::scaleFactor;
            return juce::String(systemDecay);
        };
        
        filterSystemDecaySlider.valueFromTextFunction = [](const String &text)
        {
            float systemDecay = text.getFloatValue();
            return systemDecay * PluginConstants::scaleFactor;
        };
		
		
	}	

Note that the value that is displayed at the start of the GUI is the one I set here

AudioProcessorValueTreeState::ParameterLayout FilterSynthesizerAudioProcessor::createParameterLayoutPanelFilter1()
{

	auto SystemDecayFilter1Param = std::make_unique<AudioParameterFloat> ("system_decay_panel_filter1",// parameterID
                                                                  	"System Decay Filter1",             // parameter name
                                                                  	0.0f * PluginConstants::scaleFactor,       // minimum value
                                                                  	0.99999f * PluginConstants::scaleFactor,   // maximum value
                                                                  	0.9965f * PluginConstants::scaleFactor);   // default value
    
	

that is called in

FilterSynthesizerAudioProcessor::FilterSynthesizerAudioProcessor()
     : AudioProcessor (BusesProperties().withOutput ("Output", AudioChannelSet::stereo(), true)),
       parametersPanelFilter1 (*this, nullptr, Identifier ("ParametersPanelFilter1"), createParameterLayoutPanelFilter1())
{

    systemDecayParameterPanelFilter1 = parametersPanelFilter1.getRawParameterValue ("system_decay_panel_filter1");
}
	

Don’t set the textToValue and valueToText lambdas on the Slider. They are automatically set by the SliderAttachment from the parameter.
Use the approach I just answered here.

And maybe stay within one thread, if you have follow-up questions. It makes it hard to answer in the right thread and people have to read multiple threads…