Skip to content

Commit

Permalink
Multiband Enhancer: slightly compensate stereo base signal gain
Browse files Browse the repository at this point in the history
  • Loading branch information
boomshop committed Dec 9, 2015
1 parent af8516e commit 8ec1539
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/modules_tools.cpp
Expand Up @@ -699,6 +699,10 @@ uint32_t multibandenhancer_audio_module::process(uint32_t offset, uint32_t numsa
if(_sb < 0) _sb *= 0.5;
tmpL = L + _sb * L - _sb * R;
tmpR = R + _sb * R - _sb * L;
// compensate loudness
float f = (_sb + 1) / 2 + 0.5;
tmpL /= f;
tmpR /= f;
}
L = tmpL;
R = tmpR;
Expand All @@ -709,8 +713,8 @@ uint32_t multibandenhancer_audio_module::process(uint32_t offset, uint32_t numsa
R = dist[i][1].process(tmpR);
}
// compensate saturation
L /= (1 + *params[param_drive0 + i] * 0.05);
R /= (1 + *params[param_drive0 + i] * 0.05);
L /= (1 + *params[param_drive0 + i] * 0.075);
R /= (1 + *params[param_drive0 + i] * 0.075);
// sum up output
outL += L;
outR += R;
Expand Down

0 comments on commit 8ec1539

Please sign in to comment.