Automating multiple knobs doesn't work - how to fix?

Hello developers!
I have a question regarding automation of several knobs. I take the AGain project (VST3 ver.3.6.0) as a basis. There is one slider. I just added an additional knob:

bool AGainEditorView::open (void* parent)
    m_TestKnob = new CAnimKnob(size, this, 'Test', 61, eTest_CY, pbmp, pt);

tresult PLUGIN_API AGainController::initialize (FUnknown* context)
    //1st param:
    parameters.addParameter(STR16("Gain"), 0, stepc, defVal, ParameterInfo::kCanAutomate, kGainId);
    //2nd param
    parameters.addParameter(STR16("Test"), 0, stepc, defVal, ParameterInfo::kCanAutomate, kParamTest);

It works. I can turn the knob and the value changes. But automation (I use Cakewalk) only works for the first parameter (for “Gain”). If I swap the location of the first and second parameters, the automation for “Test” will work, but the automation for “Gain” will stop working. I couldn’t figure out why this was happening.
How can I fix this?

Did you run the validator? Does it run successful?

No, I didn’t run it. I don’t even know how to start it. I had a hard time compiling the project :slight_smile:
I’ll clarify the question: when I do automation in the host, the volume slider moves. That’s how it should be. But my additional knob stays in place during automation. And when I swap two lines of code in the controller (parameters.addParameter…), then my additional knob moves, but the slider does not respond to automation.
That is, only the first control (the first parameter) responds normally to automation.

I’ll add. I just ran the validator from the command line. All tests are successful. Result: 94 tests passed, 0 tests failed

What are the values of kParamTest and kGainId? They must be different! And the same for the tags of the knobs.

And why don’t you use the latest version of the SDK? It’s much easier today to create its own projects and to define the UI.

	/** parameter ID */
	kGainId = 1,	 ///< for the gain value (is automatable)   ( = 0 also works)
	kParamTest,      ///< for knob test
	kBypassId,	     ///< Bypass value (we will handle the bypass process) (is automatable)
	kVuPPMId,	     ///< for the Vu value return to host (ReadOnly parameter for our UI)

And why don’t you use the latest version of the SDK?

Okay, I’ll try tomorrow. Thank you.
The reason for using the old SDK is that I want to create controls manually, and not using a visual editor. Only the old SDK has such examples.
Examples of the new SDK use this:
auto* view = new VST3Editor (this, "view", "again.uidesc");
I will have to connect an editor instead, as is done in the old SDK:
AGainEditorView* view = new AGainEditorView (this);
This should probably work.

Can you explain, why you want this?

If you code your editor yourself, then you have to make sure to update the correct knob when it is automated (you get a call to IEditController::setParamNormalized). Most likely that’s where you have it wrong.

Thank you very much for your answers.
I am studying VST SDK. I once wrote VST2 plugins, and everything was absolutely clear there. Now I want to get involved with VST plugins again and that’s why I’m studying VST3. If I use the library as a “black box”, I will not thoroughly understand how the code works. So I want to go through all the steps: from creating a plugin completely manually to a visual editor. For the same reason, I don’t want to use something like JUCE at the initial stage. First I need to learn how to write code entirely by hand.

Then a good idea is to read the technical documentation in the dev portal.

1 Like