Hi,
I am writing a vst synth plugin and also testing it as a standalone app.
don’t seem to be able to populate the AudioBuffer because numOutputChannels is zero, also when
running in the vst in Cubase.
here’s my processBlock code:
void WaveFaktoryAudioProcessor::processBlock (juce::AudioBuffer& buffer, juce::MidiBuffer& midiMessages)
{
juce::ScopedNoDenormals noDenormals;
auto numInputChannels = getTotalNumInputChannels();
auto numOutputChannels = getTotalNumOutputChannels();
#ifndef JucePlugin_PreferredChannelConfigurations
bool WaveFaktoryAudioProcessor::isBusesLayoutSupported (const BusesLayout& layouts) const
{ #if JucePlugin_IsMidiEffect
juce::ignoreUnused (layouts);
return true; #else
// This is the place where you check if the layout is supported.
// In this template code we only support mono or stereo.
// Some plugin hosts, such as certain GarageBand versions, will only
// load plugins that support stereo bus layouts.
if (layouts.getMainOutputChannelSet() != juce::AudioChannelSet::mono()
&& layouts.getMainOutputChannelSet() != juce::AudioChannelSet::stereo())
return false;
// This checks if the input layout matches the output layout
#if ! JucePlugin_IsSynth
if (layouts.getMainOutputChannelSet() != layouts.getMainInputChannelSet())
return false; #endif
return true;
#endif
} #endif
And no custom Busesproperties (where JucePlugin_IsMidiEffect = 1):
If you’ve enabled JucePlugin_IsMidiEffect then your BusesProperties will have no inputs or outputs. I’d recommend removing the #if lines completely, and directly specifying the input and output layout that you want.
As a side note, maybe it’s a good time for the juce team to remove that macro mess and if needed replace it with some simple code for those who really need it instead of cluttering all other projects.
I imagine a function that you call from isBusesLayoutSupported, e.g.: