iPlug2 Forum

Dynamically Updating IParams

Hi All,

I’m ready to take the IPlug2 Challenge! Well, I have a “basic” synth plugin I wish to try porting over. However, I have a couple of questions regarding “best practices”.

I have a couple of parameters that change their meanings based on the type of synthesis selected. One parameter just changes its name label. The other control changes both the label and its display. All of my parameters are normalized as ranges of [0,1], but of course may be displayed as human-grokable values.

Am I better off making the changes directly? Or, should I create parameters for both uses and just swap pointers and then send a value change to force a redraw?

I haven’t looked deeply into the widget set to how they are created or drawn yet to see if this will work. I’m still at the point of deciding which graphics backend to use, but I wanted to see if the weirdness I do is even supported before I get started.

Regardless, thanks to all for time and effort!

I forgot to add my third option: two controls–one hidden and the other displayed, and this seems to be supported, so I think I have my answer on this.

I’m sure I’ll have more questions on other matters later… Wish me luck! :grimacing:

Welcome!

It’s a bit ugly, but for maximum compatibility I tend to make multiple parameters, rather than make parameters change their meanings. Can’t always rely on hosts/plug-in formats supporting dynamically changing parameter names etc.

Regarding widgets, in iPlug2 you should be able to use the same IControls, and update the paramIdx to switch them between parameters

https://iplug2.github.io/iPlug2/class_i_control.html#ab4cd19e6ce4409f02b2cd9ba50e2bdd6

Thanks, Oli, for the reply. My biggest dread is reading other people’s code and trying to understand how it works, so this good practice for me.

Regarding changing the names dynamically, I can feed a generic or both names with a slash between on instantiation for the host to use and then just update as needed. I see some function pointers available to customize parameter value displays, which I’ll definitely need.

Once I know who’s responsible for what, I should be able to customize things to my needs. I basically do everything wrong (not on purpose!) since I don’t want to make just more boring synths.

Hopefully, my experiments bear fruit!