I was wondering if it is possible to dynamically change the min, max, and default setting of a DAW parameter. I’m asking because I dynamically change (populate) my effect components to reflect what effect is inserted, as in for example either a Chorus, Distortion, Flanger, or Phaser which for these effect all use a “Feedback” control, but which min, max, and default setting is slightly different.
I create my DAW parameters here;
AudioProcessorValueTreeState::ParameterLayout createParameterLayout ()
{
AudioProcessorValueTreeState::ParameterLayout params;
for (int module = 0; module < maxModules; module++)
{
params.add (std::make_unique<AudioParameterFloat> (String (module) +
"SFXChorusFeedbackID", "SFX " + String (module + 1) +
" Chorus Feedback", -0.5f, 0.5f, 0.0f));
params.add (std::make_unique<AudioParameterFloat> (String (module) +
"SFXDistortionFeedbackID", "SFX " + String (module + 1) +
" Effect Feedback", -1.0f, 1.0f, 0.0f));
params.add (std::make_unique<AudioParameterFloat> (String (module) +
"SFXFlangerFeedbackID", "SFX " + String (module + 1) +
" Flanger Feedback", -0.5f, 0.5f, 0.25f));
params.add (std::make_unique<AudioParameterFloat> (String (module) +
"SFXPhaserFeedbackID", "SFX " + String (module + 1) +
" Phaser Feedback", -0.65f, 0.65f, 0.0f));
}
Then in PluginEditor I do a SliderAttachment these above four to the same component knob via valueTreeState, but this creates the problem that min, max, and default is not behaving correctly. Any ideas?