How to convert a mono reverb into stereo

Hello, I am new to JUCE and created a reverb following a tutorial, however it is in mono, is it possible to change this to stereo, is this the correct page in PluginProcessor to change this?

    // This is the place where you check if the layout is supported.
    // In this template code we only support mono or stereo.
    if (layouts.getMainOutputChannelSet() != AudioChannelSet::mono()
     && layouts.getMainOutputChannelSet() != AudioChannelSet::stereo())
        return false;

    // This checks if the input layout matches the output layout
   #if ! JucePlugin_IsSynth
    if (layouts.getMainOutputChannelSet() != layouts.getMainInputChannelSet())
        return false;

    return true;

If you are wanting it to support 2 channels that can be done in the pro jucer, settings channel configurations {2,2}

If it is only outputting one channel you need to specify 2 channels in prepareForPlay, when setting the size of the reverb.

Then process two channels. In the process block.

Hope that helps.

Thanks for getting back, is that


Also here is my processblock

void AlgoReverbAudioProcessor::processBlock (AudioBuffer<float>& buffer, MidiBuffer& midiMessages)
    ScopedNoDenormals noDenormals;
    auto totalNumInputChannels  = getTotalNumInputChannels();
    auto totalNumOutputChannels = getTotalNumOutputChannels();

    for (auto i = totalNumInputChannels; i < totalNumOutputChannels; ++i)
        buffer.clear (i, 0, buffer.getNumSamples());

    float predelaySec = predelayMS * 0.001;
    float predelaySamples = predelaySec * Fs;
    for (int channel = 0; channel < totalNumInputChannels; ++channel)
        for (int n = 0 ; n < buffer.getNumSamples(); ++n){
         float x = buffer.getWritePointer (channel)[n];
            float verb = predelay.processSample (x, channel);

            verb = schroeder.processSample (verb,channel);
            verb = lpf.processSample(verb, channel);
            float y = (1.f-wet) * x + wet * verb;
            buffer.getWritePointer(channel)[n] = y;

Either the prepareToPlay, has set the channels to 1.

Or your processSample has the arguments flipped, I thought it went (channel, sample). Other than that the block looks fine.

After that, I would assume some variable in the reverb is got mixed up. Maybe test the filter, then depth at 0 then 1, to determine if it’s input or output.

What is in your prepareToPlay? I learned in rackAfx and they used prepareForPlay, unfortunately my code always alternates the two functions when I make a new class. :joy: