[Solved] SingleComponentEffect as Synth Plugin

SDK for VST 3 audio plug-in and host development.
willpirkle
Posts: 40
Joined: Tue Jun 21, 2016 12:53 pm

[Solved] SingleComponentEffect as Synth Plugin

Postby willpirkle » Thu May 03, 2018 7:50 pm

SDK: 3.6.9
OS: Windows 8.1 (I don't think it matters)

What is the proper way to configure the class factory definition for a Synth plugin that uses the SingleComponentEffect?

If I define the class factory as:

DEF_CLASS2 (INLINE_UID (0xB9F9ADE1, 0xCD9C4B6D, 0xA57E61E3, 0x123535FD),
PClassInfo::kManyInstances, // cardinality
kVstAudioEffectClass, // the component category (do not changed this)
"ASynthSimple", // here the Plug-in name (to be changed)
0, // single component effects can not be destributed so this is zero
Vst::PlugType::kInstrumentSynth, // Subcategory for this Plug-in (to be changed)
FULL_VERSION_STR, // Plug-in version (to be changed)
kVstVersionString, // the VST 3 SDK version (do not changed this, use always this define)
Steinberg::Vst::ASynthSimple::createInstance)// function pointer called when this component should be instantiated

and I do *not* add an audio input bus during the initialization function (i.e. I do not call addAudioInput()), then it will fail/crash the validator. If I do add an audio input bus, then it will pass validation, but that seems incorrect, as a synth, it shouldn't need an audio input.

The last thing the validator prints before failing is:
[Scan Editor Classes]

The NoteExpressionSynth (processor component) uses this same definition, and does not have an issue - and it does not define an input bus during initialization.

DEF_CLASS2 (INLINE_UID_FROM_FUID(Steinberg::Vst::NoteExpressionSynth::ProcessorWithUIController::cid),
PClassInfo::kManyInstances,
kVstAudioEffectClass,
stringPluginName " With UI",
Vst::kDistributable,
Vst::PlugType::kInstrumentSynth,
FULL_VERSION_STR,
kVstVersionString,
Steinberg::Vst::NoteExpressionSynth::ProcessorWithUIController::createInstance)

You can replicate this with the SDK sample code for againsimple. If you set up the definition as above in againsimple.cpp, and remove the audio input bus code:

// we want a stereo Input and a Stereo Output
// addAudioInput (STR16 ("Stereo In"), SpeakerArr::kStereo); <-- commented out

Then it will fail/crash the validator as well.

During the testing, I am modifying setBusArrangements( ) as well, so that it matches a synth plugin (numIns = 0, numOuts = 1) and I am also checking for valid buffer pointers during process( ), but those functions do not seem to get called.

Is there a correct procedure for defining the SingleComponentEffect as a synth plugin, that does not need an audio input bus, and that will pass validation?

Thanks as always,

Will

ygrabit
Posts: 95
Joined: Fri Jun 17, 2016 7:52 am
Location: Hamburg

Re: SingleComponentEffect as Synth Plugin

Postby ygrabit » Tue May 08, 2018 12:39 pm

Hi

i found a bug in SingleComponentEffect, will be fixed in next update.
here you can try, replace the activateBus method in vstsinglecomponenteffect.cpp by:

//-----------------------------------------------------------------------------
tresult PLUGIN_API SingleComponentEffect::activateBus (MediaType type, BusDirection dir,
int32 index, TBool state)
{
BusList* busList = getBusList (type, dir);
if (busList == nullptr || index >= static_cast<int32> (busList->size ()))
return kInvalidArgument;

Bus* bus = busList->at (index);
if (!bus)
return kResultFalse;

bus->setActive (state);
return kResultTrue;
}

Voilà
YVan Grabit

olilarkin
Posts: 18
Joined: Tue Jun 21, 2016 11:49 am

Re: [Solved] SingleComponentEffect as Synth Plugin

Postby olilarkin » Mon Jun 18, 2018 9:30 am

hi yvan,

I think I found another issue, unless I did something wrong elsewhere...

https://github.com/steinbergmedia/vst3sdk/issues/16

olilarkin
Posts: 18
Joined: Tue Jun 21, 2016 11:49 am

Re: [Solved] SingleComponentEffect as Synth Plugin

Postby olilarkin » Mon Jun 18, 2018 9:34 am

dammit, why do I always speak too soon.. I forgot to call audioInputs.clear(); to remove the default input buses

ygrabit
Posts: 95
Joined: Fri Jun 17, 2016 7:52 am
Location: Hamburg

Re: [Solved] SingleComponentEffect as Synth Plugin

Postby ygrabit » Mon Jun 18, 2018 9:44 am

Hi...:-)
i will add some security to getBusArrangement...
Thanks
YVan Grabit


Return to “VST 3 SDK”

Who is online

Users browsing this forum: No registered users and 2 guests