[Solved] SingleComponentEffect as Synth Plugin

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

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 (busList->size ()))
return kInvalidArgument;

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

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

Voilà

hi yvan,

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

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

Hi…:slight_smile:
i will add some security to getBusArrangement…
Thanks