Adding/Modify audio parameters at runtime (AudioProcessorValueTreeState)

I am working with a custom VST host on a headless system (so no GUI to control the plugins). In order to properly control my audio plugin, I use audio parameters, but I need to add or to modify these audio parameters after the construction of the AudioProcessor. Is there any way to do this?

For example, my VST plugin scans several directories on my system for audio files to work with. I would like to add these files to the selection of an AudioParameterChoice in my AudioProcessorValueTreeState at runtime, but I cant find a workaround for that.

I am grateful for any help!

1 Like

found a solution or it’s not possible?

There is an API for parameter changes. The Plugin can send a updateHostDisplay() and set the flag withParameterStateChanged.
It is however far from certain, if the host implements this and if it will react at all.

Changing the range of an existing parameter is a bad idea. The normalise happens in your plugin, but the number you get from the host for recorded automation is between 0 and 1. If at recording time it was normalised from 10 steps, but then you denormalise next time into 15 steps, you can imagine what happens.

The AudioProcessorValueTreeState is not designed to allow changing, adding or removing parameters at runtime.
But if you manage your parameters yourself, you can call setParameterTree() to supply a new parameter layout. But the docs are clear, it is at your own risk:

Replacing the tree after your AudioProcessor has been constructed will crash many hosts, so don’t do it! You may, however, change parameter and group names by iterating the tree returned by getParameterTree(). Afterwards, call updateHostDisplay() to inform the host of the changes. Not all hosts support dynamic changes to parameters and group names.

Good luck

1 Like

I’d like to add a param when I press a button and make cubase notify about this… What do you think about? It should be fine?