Skip to content

Commit

Permalink
Unison: Mono mode no longer stereo pans (#935)
Browse files Browse the repository at this point in the history
If you use the unison module and *don't* hook up the right
output, we skip the unison stereo pan and just sum the voices
onto L.
  • Loading branch information
baconpaul authored Sep 11, 2023
1 parent 5c30a78 commit 0604f91
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/UnisonHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ struct UnisonHelper : modules::XTModule, sst::rackhelpers::module_connector::Nei
outputs[OUTPUT_L].setChannels(nChan);
outputs[OUTPUT_R].setChannels(nChan);

bool stereoOut = outputs[OUTPUT_R].isConnected();

if (samplePos == 0)
{
modAssist.setupMatrix(this);
Expand Down Expand Up @@ -475,11 +477,18 @@ struct UnisonHelper : modules::XTModule, sst::rackhelpers::module_connector::Nei
outputs[OUTPUT_VOCT_SUB1 + v].setVoltage(vo, p);

auto iv = inputs[INPUT_SUB1 + v].getVoltage(p);
float pL, pR;
unisonSetup.attenuatedPanLaw(vi, pL, pR);
if (stereoOut)
{
float pL, pR;
unisonSetup.attenuatedPanLaw(vi, pL, pR);

outputL[svi] += iv * pL;
outputR[svi] += iv * pR;
outputL[svi] += iv * pL;
outputR[svi] += iv * pR;
}
else
{
outputL[svi] += iv;
}
}
}
}
Expand Down

0 comments on commit 0604f91

Please sign in to comment.