Processing stereo audio source in seperate channels

I have a stereo WAV audio source. I will give Compressor to the right channel and EQ to the left channel. I create 2 Mono Buffers to process the right and left channels separately. I copy the right channel of the source to the right mono buffer, and the left channel to the left mono buffer. Then I give compressor to the right buffer and EQ to the left buffer.

Is this the way ?

for each dsp processor that you have in your project you first check if they were made to work with stereo signals or not. if they do you can apply them to your stereo signal directly, else you have to make an array of 2 of them yourself. i don’t recommend doing it without an array btw, because the plugin might be instantiated on a mono track, so then you only need the first processor

1 Like

I see, If I’d like to apply a mono processor on a n channels signal, I should create an array of processor sized n. Thanks for your suggestion.
I have checked if each processor in my project were made to process stereo signals. They process stereo signals.
But for a stereo input signal, I want only left channel is processed with EQ and only right channel is processed by compressor. I thought this can be achieved in processBlock like the code below:

void AudioFilePlayerProcessor::processBlock(AudioSampleBuffer& buffer, MidiBuffer& midiMessages)
{
    for(int i = getTotalNumInputChannels(); i < getTotalNumOutputChannels(); ++i)
        buffer.clear(i, 0, buffer.getNumSamples());
//create two temporary buffers
juce::AudioBuffer<float> leftChannelDataBuffer , rigthChannelDataBuffer;
leftChannelDataBuffer.makeCopyOf(buffer);
rightChannelDataBuffer=leftChannelDataBuffer;

eq.process(leftChannelDataBuffer);
compressor.process(rightChannelDataBuffer);

buffer.copyFrom(0,0,leftChannelDataBuffer.getReadPointer(0),leftChannelDataBuffer.getNumSamples());
buffer.copyFrom(1,0,rigthChannelDataBuffer.getReadPointer(1),rightChannelDataBuffer.getNumSamples());

}

I wonder is it the efficient way? Do you know any other way doing that which is more efficient?