Channels issue in juce_VSTPluginFormat

Around line 1093 in juce_VSTPluginFormat.cpp

You check to see how many channels the effect can handle, but don’t control for the number of channels in the incoming buffer.


        int i;
        int maxChans = jmax (effect->numInputs, effect->numOutputs);

	// added this ....
		if (maxChans > buffer.getNumChannels())
			maxChans = buffer.getNumChannels();
	// end edit ..
		
        for (i = 0; i < maxChans; ++i)
            channels[i] = buffer.getSampleData (i);

Thanks. In fact, that whole loop could be removed now that there’s an AudioSampleBuffer::getArrayOfChannels() method that’ll provide direct access to the buffer’s channels…

I am assuming the same will apply for AU plugs, though I haven’t dug it up in the code.

Anyway, thanks for the change. I’ve got a long list of plugins thatI am testing this week and will certainly toss anything else that seems to break in you’re general direction.

cheers as always ~

Looks like you fixed it for VSTs but forgot AUs.

Line 688 or so in juce_AudioUnitPluginFormat.mm could use a quick change.

[quote=“aaronleese”]Looks like you fixed it for VSTs but forgot AUs.

Line 688 or so in juce_AudioUnitPluginFormat.mm could use a quick change.[/quote]

I can’t see anything wrong with that bit of code… (?)

Hmmm … ok, on closer inspection it looks like something else was wrong here (I should lock the audioprocessor when instantiating the new plugin, doh!).

Thanks for looking, and for fixing the VST format.