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
{
public:
    MyAudioProcessor()
        : 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

https://docs.juce.com/develop/classAudioProcessor.html#a6e206c1d2987a250a2d6c2af4c3af01a

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?