UI Won't Display after SliderAttachment

So I’ve been working on a basic plugin that uses the juce::dsp::IIR filter, however after setting up parameters using AudioProcessorValueTreeState, the UI won’t show.

I’ve tracked down the problem to the following 2 lines, when I comment them out, the UI appears on plugin load, and I can control the parameters via Ableton’s own sliders.

If I add them back in, the UI doesn’t show up, and the button in Ableton to trigger the UI disappears.

    cutoffVal = new juce::AudioProcessorValueTreeState::SliderAttachment(audioProcessor.tree, "cutoff", cutoffSlider);
    resoVal = new juce::AudioProcessorValueTreeState::SliderAttachment(audioProcessor.tree, "resonance", resoSlider);

Any advice greatly appreciated, thanks!

I like to wrap my Attached slider in their own structs:

struct AttachedSlider
{
AttachedSlider(juce::AudioProcessorValueTreeState& state, juce::String& id) :
slider(),
attachment(state, id, slider)
{}

juce::Slider slider; //or your own custom slider class
juce::AudioProcessorValueTreeState::SliderAttachment attachment;
}

in the parent component you then have it as a member

private:
AttachedSlider cutoffSlider;

And in the constructor you add and make visible:

addAndMakeVisible(cutoffSlider.slider);

also don’t forget to set to set the bounds appropriately in resized()

cutoffSlider.slider.setBounds(....);

this works for me everytime

I’ll try this out, thank you!

It could have many reasons, but I doubt it’s those lines at fault.
My guess would be you have some Slider::Listeners which go in an infinite update cycle never returning?
Try removing all other slider listeners.