We did some experiments with this but ended up not needing it. We got some way but gave up when realising we didn’t need it.
Below is some simple code you can add to a fresh Projucer plug-in project.
Basically, you can change the name of the parameter so just override getName(). For example:
struct FlexyParameter : public AudioProcessorParameterWithID
{
FlexyParameter (const String& paramID) : AudioProcessorParameterWithID (paramID, {}) {}
String getName (int maximumStringLength) const override { return name.substring (0, maximumStringLength); }
float getValue() const override { return value; }
void setValue (float newValue) override { value = newValue; }
float getValueForText (const String& text) const override { return text.getFloatValue(); }
float getDefaultValue() const override { return 0.0f; }
float value = { 0.0f };
String name;
};
Then add some parameters in the Processor constructor.
const String prefix = "param_";
for (int i = 0; i < 6; ++i)
addParameter (new FlexyParameter (prefix + String (i)));
Then to test it out you can have a UI something like this:
class FlexyParamsAudioProcessorEditor : public AudioProcessorEditor,
public Label::Listener
{
public:
FlexyParamsAudioProcessorEditor (FlexyParamsAudioProcessor& p)
: AudioProcessorEditor (&p), processor (p)
{
const auto& params = processor.getParameters();
for (const auto* param : params)
{
const auto* flexyParam = static_cast<const FlexyParameter*> (param);
auto* const label = new Label();
label->setEditable (true);
label->setColour (Label::outlineColourId, Colours::white);
label->setText (flexyParam->name, dontSendNotification);
label->addListener (this);
labels.add (label);
addAndMakeVisible (label);
}
setSize (400, 300);
}
void paint (Graphics& g) override
{
g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId));
}
void resized() override
{
auto rect = getBounds().reduced (20);
for (auto* label : labels)
label->setBounds (rect.removeFromTop (30).reduced (2));
}
void labelTextChanged (Label* labelThatHasChanged) override
{
const auto& params = processor.getParameters();
const int index = labels.indexOf (labelThatHasChanged);
if (auto* flexyParam = static_cast<FlexyParameter*> (params[index]))
{
flexyParam->name = labelThatHasChanged->getText();
processor.updateHostDisplay();
}
}
private:
FlexyParamsAudioProcessor& processor;
OwnedArray<Label> labels;
};
The key is to use AudioProcessor::updateHostDisplay() after you change the name.
Notice that if the parameter name is empty then at least in Logic Pro as an AU doesn’t list it. Live using a VST2 just gives a default name if it’s empty:
But Kontakt is able to hide parameters in Live using VST2:
That looks like similar behaviour to what you have with Kontakt in Cubase (?)
Reaper using VST2 also hides parameters with empty names:
But using VST3 in Reaper doesn’t update when the parameter names are updated (so using this test plugin no parameters are ever shown).
This is all using the unmodified JUCE. Even hacking around with the VST3 SDK we couldn’t find a way to get it to update the parameters names.