diff options
author | Damien Zammit <damien@zamaudio.com> | 2015-06-13 05:55:21 +1000 |
---|---|---|
committer | Damien Zammit <damien@zamaudio.com> | 2015-06-13 05:55:21 +1000 |
commit | ebd992864db8c165d9416839119e90142f8a2d32 (patch) | |
tree | b86e34ea9d9039a11473bc4e59af2f7678a629f0 | |
parent | 4840459d5fa8029fddfc428ec342331f9e37b123 (diff) |
Fixed ZamCompX2 led bars
Signed-off-by: Damien Zammit <damien@zamaudio.com>
-rw-r--r-- | plugins/ZamCompX2/ZamCompX2Plugin.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/plugins/ZamCompX2/ZamCompX2Plugin.cpp b/plugins/ZamCompX2/ZamCompX2Plugin.cpp index 6d2e27e..63b202b 100644 --- a/plugins/ZamCompX2/ZamCompX2Plugin.cpp +++ b/plugins/ZamCompX2/ZamCompX2Plugin.cpp @@ -278,7 +278,9 @@ void ZamCompX2Plugin::d_run(const float** inputs, float** outputs, uint32_t fram int slew; float slewfactor = 1.f + knee/2.f; float max = 0.f; - float Lgain = 1.f; + float lgaininp = 0.f; + float rgaininp = 0.f; + float Lgain = 1.f; float Rgain = 1.f; float Lxg, Lxl, Lyg, Lyl, Ly1; float Rxg, Rxl, Ryg, Ryl, Ry1; @@ -352,13 +354,13 @@ void ZamCompX2Plugin::d_run(const float** inputs, float** outputs, uint32_t fram cdb = -Ryl; Rgain = from_dB(cdb); - outputs[0][i] = inputs[0][i]; - outputs[0][i] *= Lgain * from_dB(makeup); - outputs[1][i] = inputs[1][i]; - outputs[1][i] *= Rgain * from_dB(makeup); + lgaininp = inputs[0][i] * Lgain; + rgaininp = inputs[1][i] * Rgain; + outputs[0][i] = lgaininp * from_dB(makeup); + outputs[1][i] = rgaininp * from_dB(makeup); - max = (fabsf(outputs[0][i]) > max) ? fabsf(outputs[0][i]) : sanitize_denormal(max); - max = (fabsf(outputs[1][i]) > max) ? fabsf(outputs[1][i]) : sanitize_denormal(max); + max = (fabsf(lgaininp) > max) ? fabsf(lgaininp) : sanitize_denormal(max); + max = (fabsf(rgaininp) > max) ? fabsf(rgaininp) : sanitize_denormal(max); oldL_yl = Lyl; oldR_yl = Ryl; @@ -367,7 +369,7 @@ void ZamCompX2Plugin::d_run(const float** inputs, float** outputs, uint32_t fram oldL_yg = Lyg; oldR_yg = Ryg; } - outlevel = (max == 0.f) ? -45.f : to_dB(max); + outlevel = (max == 0.f) ? -45.f : to_dB(max) - thresdb; } // ----------------------------------------------------------------------- |