"Linking" an AudioProcessorParameter to a GUI Component

Once an AudioProcessParameter (i.e. AudioParameterInt) is linked to the audio processor with addParameter, users can modify the parameter in realtime using their host. With my GUI components, I can modify this parameter when the user changes the GUI component by assigning a listener to the component (i.e. sliderValueChanged) and setting the parameter’s value there.

If the user modifies the parameter in realtime in their host, the GUI component is not updated to reflect the current value as the component has no idea the parameter updated. I could not find a way to listen for specific audio parameter changes.

Is there a straightforward way to assign a AudioProcessParameter to a GUI component, and have changes work and update both ways?

You may find the SliderParameterAttachment, ComboBoxParameterAttachment, and ButtonParameterAttachment classes from JUCE 6 useful. There’s also a ParameterAttachment type which you can use to implement connections to custom GUI components.

1 Like