diff --git a/modules/juce_audio_processors/format_types/juce_AU_Shared.h b/modules/juce_audio_processors/format_types/juce_AU_Shared.h index d6266244f9..1c2553cce2 100644 --- a/modules/juce_audio_processors/format_types/juce_AU_Shared.h +++ b/modules/juce_audio_processors/format_types/juce_AU_Shared.h @@ -366,21 +366,18 @@ struct AudioUnitHelpers static Array getAUChannelInfo (const AudioProcessor& processor) { + #if JucePlugin_IsMidiEffect + // A MIDI effect requires an output bus in order to determine the sample rate. + // No audio will be written to the output bus, so it can have any number of channels. + // No input bus is required. + return { AUChannelInfo { 0, -1 } }; + #endif + Array channelInfo; auto hasMainInputBus = (AudioUnitHelpers::getBusCountForWrapper (processor, true) > 0); auto hasMainOutputBus = (AudioUnitHelpers::getBusCountForWrapper (processor, false) > 0); - if ((! hasMainInputBus) && (! hasMainOutputBus)) - { - // midi effect plug-in: no audio - AUChannelInfo info; - info.inChannels = 0; - info.outChannels = 0; - - return { &info, 1 }; - } - auto layout = processor.getBusesLayout(); // The 'standard' layout with the most channels defined is AudioChannelSet::create9point1point6().