refreshParameterList() and varying parameter arrays

Sorry for bringing this up once again but none of the topics my searches returned explained the topic to an end and I’m looking for an answer here to base a potential new JUCE project on.

I’m thinking about developing a sampler that can load different multisample instruments.

Now if an instrument A has 3 parameters

  • Attack
  • Decay
  • Volume

and an instrument B has 2

  • Volume
  • Pan

is there a way to change the AudioProcessor’s parameter array when instrument A is loaded and I then load instrument B? I can see methods of adding parameters but not for removing from or clearing the array.

Looking at the documentation of the AudioProcessor class seeing the function refreshParameterList() and especially the explaining sentences

A processor should implement this method so that the host can ask it to rebuild its parameter tree. If a plugin never changes its parameters, it's enough to create its parameters in its constructor and do nothing in this method, but some may want to

and also the function updateHostDisplay() gave me some hope.

So question:
Can I change the number of parameters, their names, ranges and resolution while the sampler plugin is instantiated i.e. at runtime? Maybe if I don’t support legacy VST2 but only VST3, AU and AAX (Mac & Win)? If so, what is best practice to do so? What is the alternative? Exposing a fixed number of meta parameters with generic names and map them to actually existing params? Is there a nicer alternative by now?

// EDIT:
Just seeing setParameterTree()… Is that what I should use? If yes - does it work in all major hosts?

Juce has currently very limited support for dynamically changing the plugin parameters. I don’t think anything in the parameters can be changed once they have been created.

@fabian: Can you shed some light on the issue?