How can I create AudioEffectX* object?

Audio Plugin Hosts and other audio software applications discussion
Post Reply New Topic
RELATED
PRODUCTS

Post

AUTO-ADMIN: Non-MP3, WAV, OGG, SoundCloud, YouTube, Vimeo, Twitter and Facebook links in this post have been protected automatically. Once the member reaches 5 posts the links will function as normal.
Excuse me for unclever question and for my poor English, but I really can't understand, how can I create AudioEffectX* plugin from VST2-3 DLL? I can create AEffect* object by using such code:

Code: Select all (#)

typedef AEffect *(*vstPluginFuncPtr)(audioMasterCallback host);

VstIntPtr VSTCALLBACK hostCallback(AEffect *effect, VstInt32 opcode, VstInt32 index, VstInt32 value, void *ptr, float opt)
{	return NULL;}

AEffect * GetVSTPlugin(LPCWSTR path, HMODULE *pModule)
{
	AEffect *plugin = NULL;

	*pModule = LoadLibrary(path);
	if (*pModule == NULL)
	{ 
		sprintf(sLastError, "Plugin '%S' load error: %d\n", path, GetLastError());
		return NULL;
	}

	vstPluginFuncPtr mainEntryPoint = (vstPluginFuncPtr)GetProcAddress(*pModule, "VSTPluginMain");
	if (mainEntryPoint == NULL)
	{
		sprintf(sLastError, "Plugin '%S' has not entry point 'VSTPluginMain'\n", path, GetLastError());
		return NULL;
	}
	plugin = mainEntryPoint(hostCallback);
	return plugin;
}
....
HMODULE hModule;
AEffect * Plugin =  GetVSTPlugin(PathToDLL, &hModule);
but this plugin is not able to get parameter properties.
I can use it for getting parameter properties such as Name, Label, DisplyName, Value
( for example: Plugin->dispatcher(effGetParamName, i, 0, &Param->Name, 0);),
but I can't get maxVal, minVal and Step (float or int) for concrete parameter. For this, in AudioEffectX.h declared virtual method getParameterProperties(int Index, VstParameterProperties &Props) and new dispatcher opcode - effGetParameterProperties. But class AudioEffectX is not child of AEffect, so I can't cast my Plugin to it.
In DLL from address "VSTPluginMain" begins exactly AEffect structure.

Maybe, new DLLs (VST 2 and higher) have any another entry point, not VSTPluginMain, which contains AudioEffectX structure?

Please, could you tell me, what I must write for getting maxVal, minVal and Step of i-th parameter?

Thanx for advance!

Post

Your post is in the wrong subforum, this subforum is about using hosts for end users of the software, not for developing hosts. (You might want to repost this in the DSP subforum here on KVR instead http://www.kvraudio.com/forum/viewforum.php?f=33 .)

Regarding your problem, you shouldn't expect the plugins will even have an instance of AudioEffect or AudioEffectX. Those are Steinberg's C++ helper classes and plugins are not required to be based on those. A host must use a plugin only via the C API. (That is, via the AEffect struct and the dispatcher function pointer.)

Also note that most plugins will not even implement the parameter properties anyway. (This was implied by one of the Reaper developers when they added support for those, if I recall right they found no VST plugins besides their own that implement those.)

VST3 plugin hosting will by the way require completely different code, VST3 has pretty much nothing in common with VST2.

Post

Many thanks for the detailed answer. Now I'll think...

Post Reply

Return to “Hosts & Applications (Sequencers, DAWs, Audio Editors, etc.)”