Hello!
I am new to Juce. Therefore, forgive me if my question might be trivial. I am confused on how to create a mono input to stereo output plug-in.
I would like it to be able to handle both mono-to-stereo and stereo-to-stereo formats. There are no problems for the inputs (neglecting for the moment efficiency aspects). In the mono input case, I can simply duplicate it:
float *pfSampleL,*pfSampleR;
...
if (iNumInputChannels == 1) {
pfSampleL = pfSampleR = buffer.getWritePointer (0);
}
if (iNumInputChannels == 2) {
pfSampleL = buffer.getWritePointer (0);
pfSampleR = buffer.getWritePointer (1);
}
But how should I handle the outputs?
No problems if the input is stereo (I just overwrite the two buffers). However, what am I suppose to do in the mono to stereo case? Where is the extra buffer needed?
Thank in advance for any hint.
Massi
P.S.
It looks like that some hosts automatically convert the mono input to a stereo one. However I doubt that all will have the same behaviour.