How to notify the host about a program change from the plugin (VST3)

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

I got a plugin with an own patch browser. The patches are exposed to the host

Code: Select all

			// create top root unit with kProgramId as id for the programList
			addUnit(new Unit(String("Root"), kRootUnitId, kNoParentUnitId, kProgramId));
			// create the program list: here kNumProgs entries
			ProgramList* prgList2 = new ProgramList(String("program"), kProgramId, kRootUnitId);
			addProgramList(prgList2);
			for (int32 i = 0; i < kNumPrograms; i++)
			{
				String title;
				title.printf(programs[i].name, i + 1);
				prgList2->addProgram(title);
			}
		
			//---Program Change parameter---
			Parameter* prgParam2 = prgList2->getParameter();

			// by default this program change parameter if automatable we can overwrite this:
		//	prgParam2->getInfo().flags &= ~ParameterInfo::kCanAutomate;
			parameters.addParameter(prgParam2);
When the host changes the patch number my plugin sucessfuly notices it.
However when i change the patch number in my plugin the curretly selected patch in the host's plugin browser does not get updated. It still shows the old patch.

In VST 2.4 you simply did call
setProgram (VstInt32 program) { curProgram = program; }

However i can't find this in VST3. How do I notify the host about a program change?

The VST3 SDK really drives me nuts :?

Thanks,
Markus

Post

I think what you want here is "EditControllerEx1::notifyProgramListChange". It calls "IUnitHandler::notifyProgramListChange", which has the following comment describing it:

Code: Select all

 /** Tell host that the plug-in controller changed a program list (rename, load, PitchName changes).
     \param listId is the specified program list ID to inform.
     \param programIndex : when kAllProgramInvalid, all program information is invalid, otherwise only the program of given index. */
 virtual tresult PLUGIN_API notifyProgramListChange (ProgramListID listId, int32 programIndex) = 0;
This SDK sure is... something.
owner/operator LHI Audio

Post

I've already tried this one. But it doesn't work properly. Many hosts (including Cubase) still show the wrong patch in their preset-browser.

Post

Your best bet is going to be to post on the VST 3 SDK forums over at Steinberg: https://sdk.steinberg.net/viewforum.php?f=4
owner/operator LHI Audio

Post

I signed to Steinberg's forum and will need to ask many questions about the obfuscated VST3 SDK... :?

Post

I think that you just need to have a parameter that is declared as "program number", and update it accordingly.

But beware: we used to be in the same situation, and we had to completely remove VST3 presets support because it just does not work well with internal presets management:
1. if your presets list changes (user presets, or new factory presets in a new version), you are screwed, unless you always keep the same order (which is not very flexible).
2. In the particular case of virtual instruments in Cubase, when loading a project containing a VI, they will change the program number AFTER recalling the state of the plug-in, which resets the state to the last loaded preset (because the user will expect that clicking on a preset that was already loaded and modified just reloads the preset, right?).

Post

VST3 SDK is a hot mess.

Post

Blue Cat Audio wrote: Mon Oct 26, 2020 1:03 pm 2. In the particular case of virtual instruments in Cubase, when loading a project containing a VI, they will change the program number AFTER recalling the state of the plug-in, which resets the state to the last loaded preset (because the user will expect that clicking on a preset that was already loaded and modified just reloads the preset, right?).
Cubase does this nonsense for VST2 as well. Everybody I've talked to about it has a little timer that fires whenever the host loads state (or vst2 chunk, whichever) and which disregards all preset changes for a few hundred milliseconds after it.

I won't say that I'm unsurprised that it also happens with VST3 plugins, but, hey – the more things change, the more things stay the same.
owner/operator LHI Audio

Post

I can confirm the weird behavior of Cubase.

Beside of that it was impossible to make preset-lists work in a consistent way with all hosts. Many did not update the list properly after a bank change or did not sync the preset number properly.

I removed the exposing of the preset-list to the host. Only a single preset is shown now.
It's really sad that I had to remove features like proper midi-support or preset-lists because of VST3. It often takes hours to find out the most trivial stuff.
What really upsets me is the ongoing waste of development-time with the 'great' VST3 SDK. :pray:

Post Reply

Return to “DSP and Plugin Development”