How to create Surround Plugins

Hello there. I’m trying to create a stereo input, 5.1 layout output plugin.

class MyAudioProcessor : public juce::AudioProcessor
        : AudioProcessor(BusesProperties().withInput("Input", juce::AudioChannelSet::stereo())
                                          .withOutput("Output", juce::AudioChannelSet::create5point1()))
        // Constructor

    void processBlock(juce::AudioBuffer<float>& buffer, juce::MidiBuffer&) override
        const int totalNumInputChannels = getTotalNumInputChannels();
        const int totalNumOutputChannels = getTotalNumOutputChannels();       

    // Other overridden methods...

I test the plugin with Cubase, as VST3. Standalone plugin does not crash but VST3 crashes. I write processed samples to each channel at the end of processBlock call. (sample by sample)

Writing samples to channels, (for channelIndex >=2) results with a read access violation. What would be the problem?

You also need a suitable implementation for isBusesLayoutSupported

You should also check in your processBlock method that the channel counts are actually what you expect, and if they are not, do some kind of fallback processing.

1 Like

Thanks. By the way, what are the things I need to pay attention to when developing a surround (multi output) VST3 plugin with Juce Framework, especially for running on Cubase? Does it have some limitations or specific rules?