diff options
author | Damien Zammit <damien@zamaudio.com> | 2019-01-27 19:45:32 +1100 |
---|---|---|
committer | Damien Zammit <damien@zamaudio.com> | 2019-01-27 19:45:32 +1100 |
commit | 7288da797ca8751df64d8dca7778c66078f40f0b (patch) | |
tree | d6f9d52064a8470b3377526d26f7b4d896ca1164 /plugins/ZamTube/ZamTubePlugin.cpp | |
parent | 0ec51df8c4b102b7ffa9146d5dcb8fef5b38b9d9 (diff) |
Adjust gain so switching tonestack models balance out at 1kHz
Diffstat (limited to 'plugins/ZamTube/ZamTubePlugin.cpp')
-rw-r--r-- | plugins/ZamTube/ZamTubePlugin.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/ZamTube/ZamTubePlugin.cpp b/plugins/ZamTube/ZamTubePlugin.cpp index 408c51b..03b6f80 100644 --- a/plugins/ZamTube/ZamTubePlugin.cpp +++ b/plugins/ZamTube/ZamTubePlugin.cpp @@ -301,7 +301,8 @@ void ZamTubePlugin::deactivate() void ZamTubePlugin::run(const float** inputs, float** outputs, uint32_t frames) { - uint8_t stack = (uint8_t)tonestack > 24 ? 24 : (uint8_t)tonestack; + const uint8_t stack = (uint8_t)tonestack > 24 ? 24 : (uint8_t)tonestack; + const float adjustdb = Tonestacks::adjustdb[stack]; float fSlow0 = float(ts[stack][R4]); float fSlow1 = float(ts[stack][R3]); @@ -355,7 +356,7 @@ void ZamTubePlugin::run(const float** inputs, float** outputs, uint32_t frames) float cut = insane ? 0. : 15.; float pregain = from_dB(tubedrive*3.6364 - cut); - float postgain = from_dB(mastergain + cut + 5. + 42. * (1. - log1p(tubedrive/11.))); + float postgain = from_dB(mastergain + cut + adjustdb + 5. + 42. * (1. - log1p(tubedrive/11.))); for (uint32_t i = 0; i < frames; ++i) { |