Audio parameter tut

Hi guys a newbie to c++ but not coding, been into music for a long while, and finally decided to go for it and make my own VST’s and learn how c++ can be used to make top notch music apps and plug-ins, now trying to get my head around parameters

I’m trying t modify the audio parameter tut , so i want to have 2 gains

so the input audio goes through gain and then gain2
so i first added a 2nd “addParameter”

what about the "buffer.applyGain (*gain); " i tried "
“buffer.applyGain (*gain);
buffer.applyGain (*gain2);”

but the latest slider change overrides the main gain how can i make it a secondary gain and get input from gain(1st one)

help or is there a tut or something else showing multiple parameters for audio plug-ins

Just multiply gainValue1 and gainValue2 as a single parameter for applyGain()


The parameter *gain and *gain2 in your example are just multipliers.
The line buffer.applyGain (*gain); overwrites the audio data by multiplying it.

You can use the audio data BEFORE you apply the second gain buffer.applyGain (*gain2);, if that’s what your plugin is supposed to do (like having a pre-gain and a post-gain.
Or if you need both versions at a time, you will need a copy of the buffer as a member variable. But for a multiplication you can easily come up with a solution, so that it is not necessary…

Try to put as many operations in one go, like @Rail_Jon_Rogut suggested, that will save CPU.