Skip to content

Commit

Permalink
describe sidechain processing
Browse files Browse the repository at this point in the history
  • Loading branch information
gregrecco67 committed Feb 22, 2024
1 parent 3b565cd commit 929728e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/SynthVoice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ void SynthVoice::renderNextBlock(juce::AudioBuffer<float>& outputBuffer, int sta
if (proc.globalParams.sidechainEnable->isOn()) { // just overwrite them
osc1CosineBuffer.copyFrom(0, 0, proc.sidechainSlice, 0, 0, numSamples);
osc1CosineBuffer.copyFrom(1, 0, proc.sidechainSlice, 1, 0, numSamples);
// taking sidechain as the vertical component, we calculate the horizontal component
// effectively mapping the sidechain to a semicircle
for (int i = 0; i < numSamples; i++) {
auto ls = std::clamp(osc1CosineBuffer.getSample(0, i), -1.f, 1.f);
auto rs = std::clamp(osc1CosineBuffer.getSample(1, i), -1.f, 1.f);
Expand All @@ -195,7 +197,6 @@ void SynthVoice::renderNextBlock(juce::AudioBuffer<float>& outputBuffer, int sta
}
}


osc2.processAdding(osc2Freq, osc2Params, osc2SineBuffer, osc2CosineBuffer);
osc3.processAdding(osc3Freq, osc3Params, osc3SineBuffer, osc3CosineBuffer);
osc4.processAdding(osc4Freq, osc4Params, osc4SineBuffer, osc4CosineBuffer);
Expand Down

0 comments on commit 929728e

Please sign in to comment.