Best way to handle parameter changing in different modes

Hi all,

I have a general question about handling parameters in a certain situation. If you imagine having a delay plug-in, you might want to have the option of setting the delay time either in seconds or in tempo-synced intervals (quarter note, eighth note, etc. based on the current BPM). Presumably there would be a button or other UI element for toggling between these values as well.

Behind the scenes, what’s the best way for handling these two choices? The best I can figure is basically having two parameters and two sliders, one each for the time in seconds and the time in musical intervals. Clicking a toggle button changes which slider is visible/active, and which parameter the AudioProcessor should respect. However, in this case, both parameters would show up to the user for automation, modulation, etc. in their DAW, which could be kind of messy and confusing.

Is there a better way to handle this situation? I imagine it’s not wise to change the range and values of a parameter on the fly (and might even be impossible?). Is there a way to enable/disable parameters, such that they won’t appear in the list of automatable parameters when viewed in a DAW?

I usually look at how other plug-ins do this. Using two separate parameters with a parameter to choose between them seems like a common solution. Arguably, it’s also better than hiding a parameter (and much less messy to implement).

If you choose the ‘two parameters’ approach, you may use another APVTS to hold these parameters and attach the APVTS to a dummy processor to make sure that they are not in automatable parameters.

Thanks yall for the responses!

If you choose the ‘two parameters’ approach, you may use another APVTS to hold these parameters and attach the APVTS to a dummy processor to make sure that they are not in automatable parameters.

So basically are you saying that you’d remove/add parameters from the main APVTS at runtime to enable it or disable it for automation? E.g. if you enabled tempo syncing, you’d add the musical interval parameter to the main APVTS and move the milliseconds parameter to a dummy APVTS.

Is this possible? I’ve read some other posts about hosts not supporting changing the range of a value [1]. Fully adding or removing a parameter sounds even more drastic.

[1] - Change valueTreeParameters in PluginProcessor at runtime - #2 by fr810

I mean you can create another apvts (which contains those parameters) and attach the apvts to a dummy processor during the construction of your main processor. However, users can only adjust the delay (both of them!) through UI afterwards :face_with_monocle: It might be a bad idea for your case.