How best to display the audio level at certain points in an AudioProcessorGraph (not just at the end)?

Let’s say you were developing a plugin host, and you could have a number of “instrument layers” that each held a (third-party) instrument plugin and a chain of (third-party) effect plugins that were layered into the mainAudioOutput. In the AudioProcessorGraph, the audio is connected like this (nodes shown as [node] ):

InstLayer1 [Instrument] —> [effect] —> [effect] —> [mainAudioOutput]
InstLayer2 [Instrument] —> [effect] —> [effect]—> [effect] —> [mainAudioOutput]. …etc.

Now, say you wanted to have a level meter for each InstrumentLayer that displayed the audio level BEFORE it gets to the MainAudioOutput, but AFTER the effects chain, separate for each instrument layer.

Is there any way to “intercept” the audio level at certain parts of an AudioProcessorGraph to display its level in a meter?

Or alternately, what I have been experimenting with is creating a simple AudioProcessor class that basically just intercepts processBlock() so it can display the audio level and passes it on, and then you add that simple “LevelMeterProcessor” as a node and incorporate it into the AudioPluginGraph, like this:

InstLayer1 [Instrument] —> [effect] —> [effect] —> [LEVEL METER] —> [mainAudioOutput]
InstLayer2 [Instrument] —> [effect] —> [effect]—> [effect] —> [LEVEL METER] —> [mainAudioOutput]  …etc.

That seems like it could work, but is there a better/easier way?

That is how I would have solved it.

Another idea is to use the AudioProcessorParameter::outputMeter, if your processors support that. Would be cool, if your host would implement that, only the high end hosts do that as far as I am aware :slight_smile: