You can add visualisations to PluginGuiMagic. All analysis and rendering is already implemented, you only need to declare, which signal in your dsp you want to visualise.
To add for instance an analyser, you add a foleys::MagicPlotSource
pointer to the processor:
foleys::MagicPlotSource* outputAnalyser = nullptr;
In the processor constructor you create and advertise the analyser to the GUI:
outputAnalyser = magicState.createAndAddObject<foleys::MagicAnalyser>("output");
magicState.addBackgroundProcessing (outputAnalyser);
(Only some visualisations need the background processing, but if it is not needed, this is silently ignored.)
Now you only need to push the signal to the analyser in your dsp code, most likely processBlock():
// assuming you have an AudioBuffer<float> buffer
outputAnalyser->pushSamples (buffer);
Now you are ready to add the plot to the GUI:
Simply drag a Plot into a View and select the name you gave the analyser in the creation call as source:
Hint: to overlay several Plot curves select “content” as display method in the parent View
. You find that property in the “Container” section.
Now you should be able to see the analyser curve once you run the plugin.