[Solved] VST3 parameter update not recognized in Samplitude

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

Post

Hello everyone,

i'm facing an issue with my VST3 implementation and Samplitude.
Basically, one of our testers has reported that our plug-in loads fine in Samplitude but controls don't change anything, soundwise.

I've downloaded the Samplitude trial version and I've done some debugging and discovered that parameter changes (both from the GUI editor and the Samplitude default editor) are working correctly, but upon the process call, the parameter changes counter is always zero, so the audio engine is not performing any update and the sound remains the same.
Samplitude has been the only host showing this behavior so far, the plug-in works fine in Reaper, Studio One and Cubase.

It's the first time I support the VST3 standard, so I'm probably missing something, but after hours of debugging I couldn't find the culprit.

Here are some code snippets from my VST3 wrapper.

Parameters creation:

Code: Select all

void VST3PlugInWrapper::EditController::setAudioApplication(AudioApplication* app)
{
	assert(app != nullptr);

	application = app;

	//Initialize parameters
	parameters.removeAll();

	for (int i = 0; i < application->getCore()->getNumParameters(); ++i)
	{
		const AudioApplicationCore::ParameterType& p = application->getCore()->getParameterDescriptor(i);

		parameters.addParameter(
			p.getName().toUTF16().get(), 
			p.getLabel().toUTF16().get(), 
			0, 
			p.getNormalizedDefaultValue(), 
			Steinberg::Vst::ParameterInfo::kCanAutomate, 
			i,
			Steinberg::Vst::kRootUnitId
		);
	}
}
User interaction callbacks (these are triggered by the GUI editor, when the user changes controls)

Code: Select all

void VST3PlugInWrapper::AudioProcessor::VST3HostHandler::notifyBeginParameterChange(int index)
{
    if (editController)
        editController->beginEdit(index);
}

void VST3PlugInWrapper::AudioProcessor::VST3HostHandler::notifyEndParameterChange(int index)
{
    if (editController)
        editController->endEdit(index);
}

void VST3PlugInWrapper::AudioProcessor::VST3HostHandler::notifyParameterChanged(int index, float value)
{
    if (editController)
    {
        editController->setParamNormalized(index, value);
        editController->performEdit(index, value);
    }
}
The process routine, with actual parameter updates on the audio core:

Code: Select all

Steinberg::tresult PLUGIN_API VST3PlugInWrapper::AudioProcessor::process(Steinberg::Vst::ProcessData& data)
{
	//Read inputs parameter changes
	Steinberg::Vst::IParameterChanges* paramChanges = data.inputParameterChanges;

	if (paramChanges)
	{
		const Steinberg::int32 numParamsChanged = paramChanges->getParameterCount(); //ALWAYS ZERO :-(

		for (Steinberg::int32 i = 0; i < numParamsChanged; ++i)
		{
			Steinberg::Vst::IParamValueQueue* paramQueue = paramChanges->getParameterData(i);

			if (paramQueue)
			{
				Steinberg::Vst::ParamValue value;
				Steinberg::int32 sampleOffset;

				const Steinberg::int32 numPoints = paramQueue->getPointCount();
				const Steinberg::Vst::ParamID idx = paramQueue->getParameterId();

				//Update processor with last parameter values
				if (paramQueue->getPoint(numPoints - 1, sampleOffset, value) == Steinberg::kResultTrue)
					application->getCore()->setProcessorParameterValue(idx, value);
			}
		}
	}

...

}
Any help would be greatly appreciated!
Last edited by Wild Hades on Tue Nov 07, 2017 10:59 am, edited 1 time in total.

Post

Ok, I've got it sorted out.

It seems like in Samplitude, if you don't create ANY parameter in the "initialize" method of the edit controller, any subsequent addParameter call will create the parameter correctly and show it in the default GUI editor, but changes will not be recognized, like the plug-in is being considered without parameters.

If you create AT LEAST ONE parameter, everything will work as expected, even if you remove it and recreate all the parameters later. Kinda weird...

Since I don't have parameter details in the "initialize" method of the edit controller (I only have their cardinality), I was creating them after the connect call on the audio processor and changes were getting ignored.

I've fixed it by creating them with dummy values in the "initialize" call and then updating their details (names, units, etc.) upon connection and everythingis working now.

Just FYI, in case someone stumble upon this issue.

Post Reply

Return to “DSP and Plugin Development”