AudioProcessorGraph UI Help Needed

Hey there,

I’m trying to create a FX chain VST closely following the tutorial here

Here is what I want to do: have a UI which appears for each of the potential processors that can be placed in each slot (in my case, a reverb, delay and filter) such that when a user selects, say, Reverb in slot 1, the UI for the reverb appears in the UI of the AudioProcessorGraph FX chain (which in my case, is the main plugin processor as in the tutorial) at the given slot (assume three horizontal combo boxes at the top of the UI with space underneath for said processor to “appear”). I have separate classes for each processor like the tutorial as well. I currently have a single plugin editor h and cpp file for the graph, and none for the individual classes.

My question is how to do this. If curious my codebase is virtually identical to the tutorial except for the processing code for each processor. I have gotten stuck trying to declare sliders and attachments, and the processors themselves in the editor.h file of the FX chain for the reverb, delay and filter, which demands that an instance of reverb, delay and filter are explicitly declared in the constructor of the Plugin Editor - when changing this my IDE demands that I change the createEditor() function to reflect the constructor, however this is clearly the wrong approach.

Any help is much appreciated. In short I just want to be able to add the relevant dials and knobs to the UI based on the selection of the processor slots by the user.

Should probably also mention I’m quite new to c++ and very new to Audio Programming and graphics.

Cheers guys

I’d have one AudioProcessorEditor for each AudioProcessor. Inside of each one you put all the sliders and stuff needed, try to put everything as local as you can. Then whenever you select another different processor you hide the AudioProcessorEditor that was showing, and show the one associated with the new selected processor. You can do all of this showing/hiding as if they were simple Components (in the end they inherit from it) so there’s nothing tricky/fancy about that. Example:

  • Delay Processor contains the Delay Editor. Inside of it you put all the delay sliders, buttons and stuff.
  • Reverb Processor contains Reverb Editor. Inside you put all the reverb sliders, buttons and stuff.
  • Once you select Reverb, hide Delay Editor and show Reverb Editor.

You use the constructor if you have things in it that need to be set when creating that class. Example: you have a class Square that takes 2 parameters in its constructor (wide and height), so when you declare a new Square you will pass those 2 values to set its sizes. Probably you have an AudioProcessorValueTreeState there if you have followed the tutorial. I’d suggest you to try using simple classes with constructors to get used to it before aproaching a wider problem like this.

1 Like

Thanks for your help here John. I’ll give implementing this a go. Re your last comment - if I had the time I would have approached this in a more modular fashion but unfortunately this is a component of a Master’s thesis I’m writing so learning time is not on my side!

Thanks again though.