AudioProcessorValueStateTree tracking float instead of slider value

I’ve managed to use the AudioProcessorValueStateTree to track slider values from the Editor to Processor, but I can’t work out how to do this for a float value stored in my editors child components.

For example I would use:

std::make_unique<AudioParameterFloat>("mastergain", "MasterGain", -60.0f, 6.0f, -12.0f)


ScopedPointer<AudioProcessorValueTreeState::SliderAttachment> masterGainVal;


masterGainVal = new AudioProcessorValueTreeState::SliderAttachment(processor.tree, "mastergain", master.gainSlider);

But I want to be able to track a float and for the parameter to update when the float does:

float someValue = 1;