Dynamic Number of Parameters

7 posts / 0 new
Last post
Crandles
Offline
Last seen: 6 months 1 day ago
Joined: 12 Jun 2012 - 18:16
Dynamic Number of Parameters

Is there anyway to have a dynamic number of parameters for a VST plugin? I was think about making a modification to a plug-in I'm working on where the number of filters could be selectable (and users could pass their own impulse responses to create them). Each filter has a an adjustable delay associated with it. I suppose I could just declare a bunch of extra of parameters in the Parameters enum and they would go into use once the extra filters have been added which would be pseudodynamic as there would be an upper limit on the number of filter which could be added.

MarC
Offline
Last seen: 2 days 5 hours ago
Joined: 21 Nov 2006 - 00:22
Re: Dynamic Number of Parameters

You will probably end up having to write too much code. This might help:
http://www.rawmaterialsoftware.com/viewtopic.php?f=8&t=7900&start=15#p52479

Crandles
Offline
Last seen: 6 months 1 day ago
Joined: 12 Jun 2012 - 18:16
Re: Dynamic Number of Parameters

Do you mind on elaborating how? There's a lot of material to go through there.

MarC
Offline
Last seen: 2 days 5 hours ago
Joined: 21 Nov 2006 - 00:22
Re: Dynamic Number of Parameters

Crandles wrote:
Do you mind on elaborating how? There's a lot of material to go through there.

I think that the best solution would be to generate a fix number of parameters and then only use a range of them. I don't think that this is very negative in memory or performance terms and will avoid you many potential troubles (like for example asking yourself if the host will ever update the information that collects about the plugin parameters, which I think it doesn't). In my previous post, I linked a header (PluginParameters.h) that I use to create parameters in a way that a single for() clause can declare them and create automation and StateInformation support for them. Use at your own risk. The code in the PluginProcessor constructor would look like this for one single parameter gain for each module.

    for (int moduleIndex=0;moduleIndex<MAX_NUM_MODULES;moduleIndex++){
      paramControl.add(new FloatParameter<>(&module[moduleIndex]->gain,"gain"+(String)(moduleIndex),0,1));
    }

There's an example plugin too: PluginTemplate where you can see how the PluginParameters.h header works. Besides that you may want to create a separate Jucer component for the module that you want to repeat, and then add it to your main component programatically.

Fill in the gaps. It is hard work.

Rory
Offline
Last seen: 2 days 3 hours ago
Joined: 26 Jun 2008 - 12:14
Re: Dynamic Number of Parameters

As far as I'm aware, the simple answer is no. If you do decide to create a max number of params, and only use some, be aware that a lot of plugin hosts will show all your parameters which looks kind of messy. I thought that VST 3 would have made dynamic parameters a possibility, but no.

MarC
Offline
Last seen: 2 days 5 hours ago
Joined: 21 Nov 2006 - 00:22
Re: Dynamic Number of Parameters

Rory wrote:
If you do decide to create a max number of params, and only use some, be aware that a lot of plugin hosts will show all your parameters which looks kind of messy.

I agree. In that sense, it is clearer to show all your modules in your UI and then be able to enable or disable each of them.
Crandles
Offline
Last seen: 6 months 1 day ago
Joined: 12 Jun 2012 - 18:16
Re: Dynamic Number of Parameters

Thanks