As per subject,
For a plug-in that supports sidechain, when the Sidechain input in Logic is set to None, on the sidechain bus I get the same data that is fed to the main bus rather than silence (which is what I’d expect when None is selected, right?)
steps to reproduce:
-
Grab the latest JUCE tip (which was af66027 at the moment I detected this, but I see no work has been done in this area since)
-
Build the NoiseGate example plug-in with a printout of the content of the channels received by processBlock() (details below)
-
Launch debugging with Logic X
-
Create an empty project and add one track with actual stereo data in it
-
Insert the Noise Gate plug-in in the track
-
Check that “None” is selected in the “Sidechain” combo in the top right corner of the plug-in window
-
Play the track
-
Observe from the printout that the plug-in is getting 4 channels:
-
the first two are the main input channels (stereo)
-
the following two (the sidechain stereo channels) are an exact replica of the first two, rather than containing only silence as expected
samp:2048, chan: 4 | ch0: 0.1304 | ch1: 0.0824 | ch2: 0.1304 | ch3: 0.0824 // call #10
samp:2048, chan: 4 | ch0: 0.1003 | ch1: 0.0688 | ch2: 0.1003 | ch3: 0.0688 // call #11
samp:2048, chan: 4 | ch0: 0.1154 | ch1: 0.0840 | ch2: 0.1154 | ch3: 0.0840 // call #12
samp:2048, chan: 4 | ch0: 0.0994 | ch1: 0.0753 | ch2: 0.0994 | ch3: 0.0753 // call #13
samp:2048, chan: 4 | ch0: 0.0864 | ch1: 0.0672 | ch2: 0.0864 | ch3: 0.0672 // call #14
samp:2048, chan: 4 | ch0: 0.0765 | ch1: 0.0613 | ch2: 0.0765 | ch3: 0.0613 // call #15
samp:2048, chan: 4 | ch0: 0.0806 | ch1: 0.0583 | ch2: 0.0806 | ch3: 0.0583 // call #16
samp:2048, chan: 4 | ch0: 0.0789 | ch1: 0.0550 | ch2: 0.0789 | ch3: 0.0550 // call #17
samp:2048, chan: 4 | ch0: 0.0549 | ch1: 0.0606 | ch2: 0.0549 | ch3: 0.0606 // call #18
samp:2048, chan: 4 | ch0: 0.0743 | ch1: 0.0544 | ch2: 0.0743 | ch3: 0.0544 // call #19
samp:2048, chan: 4 | ch0: 0.9598 | ch1: 0.9406 | ch2: 0.9598 | ch3: 0.9406 // call #20
Why is it so? What’s happening here?
Details regarding the printout:
I simply have made a little helper function that takes an AudioSampleBuffer and prints the magnitude of each of its channels in columns, so that I can DBG() that and get a nice stream organized in columns that shows the evolution of the single channels content over time, as seen above.
The function is (feel free to use it):
String dbgAudioBuffer (const AudioSampleBuffer& buffer, const String& tag)
{
String s;
const int numSamples = buffer.getNumSamples();
const int numChannels = buffer.getNumChannels();
s << String::formatted ("samp:%4d, chan:%2d", numSamples, numChannels);
for (int channelIndex = 0; channelIndex < numChannels; ++channelIndex)
{
s << String::formatted (" | ch%d: ", channelIndex);
const float magnitude = buffer.getMagnitude (channelIndex, 0, numSamples);
if (magnitude != 0.0f) s << String (magnitude, 4);
else s << "------";
}
s << " // " << tag;
return s;
}
and I have called it at the very beginning of the processBlock():
void processBlock (AudioSampleBuffer& buffer, MidiBuffer&) override
{
static int tag = 0;
DBG (dbgAudioBuffer (buffer, "call #" + String (tag++)));
....

