Advice on creating automated gain staging plugin

I am new to vst development but not to programming and am wanting to create a plugin that can automate gain staging for mixing in Cubase. It would analyze the audio the user has set in the loop region and then adjust Cubase’s built in Gain in the Channel Settings to the users desired level for the selected track. Is this doable with the VST3 API or is any of this outside of it’s scope?

Thank you for any help!

A vst plugin is self contained and can only change what the API lets it change. I do not believe that there is an API to change the Gain of the channel settings (that would be reaching “outside” the plugin).

What you can do though, is implement a vst effect plugin that you would put in the effect chain of the channel and that would do the work: receives the input, analyze the audio it receives and adjusts it accordingly. The “again” example provided in the SDK is an example of a gain effect plugin that adjust the gain statically… you want to adjust it dynamically so it is a good place to start.