Plain Project Generator Instrument -> Output Clipping

Dear VST developer community and Steinberg VST team,

I hope it’s fine to ask this, and I appreciate any pointers from you experienced VST developers. (I have an SWE background but little experience with the VST SDK (3.7.9), I hope you’ll be easy on me :slight_smile:).

I have used the project generator to create an “instrument” type project. Without touching any of the generated code, just building the instrument and then inserting it in Cubase, I get the track to clip tremendously (see screenshot).

I’m sure there’s something completely obvious I’m missing?

Thanks for any pointers you may have :slight_smile:

Instrument

Hi
The generated plug-in does not implement the process (Vst::ProcessData& data) function: check the generated processor.cpp file (around line 67)

     //--- Here you have to implement your processing
	 return kResultOk;
 }

you could write this:

//--- Here you have to implement your processing
if (data.numSamples > 0)
{
	for (int32 i = 0; i < data.numOutputs; i++)
	{
		for (int32 c = 0; c < data.outputs[i].numChannels; c++)
			memset (data.outputs[i].channelBuffers32[c], 0, data.numSamples * sizeof (Vst::Sample32));
	}
}

this should clear the output buffer of the plug-in.

1 Like

Hi @Yvan

Thank you for your kind and helpful reply, very much appreciated.

Yes, while testing the generated instrument project I didn’t write to the output buffer in the process function at all — my mistake seems to have been assuming that the buffer would be zero-initialized by the host, and not writing to it would therefore lead to silence. Wrong assumption on my part :slight_smile: — your reply pointed me in the right direction!

Thanks again and all the best