Mid Side - Pan control


#1

If I process a signal in mid side. To create a pan on the side do I just multiply side signal by 1.0 to 0.0 when either the side signal is positive or negative respectively. I want to keep part of a chain mid/side and not convert back.


#2

I don’t know the question, but if you amplify/attenuate the side signal, you just move it closer or further from the centre. You don’t move it left or right.
Addition: and multiplying with negatives just swaps left and right channel

To pan a mono signal full left: put the signal to the left, and the mid half the signal…


#3

Hi Daniel,

Yeah I’m aware that I’m moving it further or closer that’s why I mentioned wether it was negative or positive. I was just wondering if there was a way or function that handled the logic saved swapping back and forth between M/S and L/R


#4

Ah, I see… I usually add a spare buffer, so I can use the vectorised copyFrom and addFrom methods:

const auto numSamples = buffer.getNumSamples();

spare.copyFrom (0, 0, buffer.getReadPointer (0), numSamples);
buffer.applyGain (0, 0, numSamples, 0.5);
buffer.addFrom (0, 0, buffer.getReadPointer (1), numSamples, 0.5);
buffer.addFrom (1, 0, spare.getReadPointer (1), numSamples, -1.0);
buffer.applyGain (1, 0, numSamples, -1.0);

…somehow it feels it could be done in one step less, but I can’t come up with it…

Feels like a nice addition to the FloatVectorOperations, so it could be done without the spare buffer…