summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2023-10-17 19:28:32 +1100
committerDamien Zammit <damien@zamaudio.com>2023-10-17 19:28:32 +1100
commitb8b2a42d6d27b5673e6087c3e228d631adb46f58 (patch)
treeb50e87bea255569fcf7fc9c5490d20bd0e8386f7
parentd5f04c69bee71e59ca6e372b5d55bc79d1734cba (diff)
ZamTube: Use 20dB max of tube drive and scale output better
-rw-r--r--plugins/ZamTube/ZamTubePlugin.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/ZamTube/ZamTubePlugin.cpp b/plugins/ZamTube/ZamTubePlugin.cpp
index b4dde0f..e39b726 100644
--- a/plugins/ZamTube/ZamTubePlugin.cpp
+++ b/plugins/ZamTube/ZamTubePlugin.cpp
@@ -409,10 +409,10 @@ void ZamTubePlugin::run(const float** inputs, float** outputs, uint32_t frames)
const uint8_t stack = (uint8_t)tonestack > 24 ? 24 : (uint8_t)tonestack;
float tubeout = 0.f;
+ float scaled_drive = (tubedrive - 0.1) / 10.9;
- float cut = 15.;
- float pregain = from_dB(tubedrive*3.6364 - cut + mastergain);
- float postgain = from_dB(cut + 42. * (1. - log1p(tubedrive/11.)));
+ float pregain = from_dB(scaled_drive * 20.);
+ float postgain = from_dB(mastergain - 6.) * 0.01;
if ((tonestackold != stack) || (bassold != bass) ||
(middleold != middle) || (trebleold != treble)) {
@@ -435,7 +435,7 @@ void ZamTubePlugin::run(const float** inputs, float** outputs, uint32_t frames)
//Step 1: read input sample as voltage for the source
float in = inputs[0][i] * pregain;
- tubeout = ckt.run(in) * postgain / 10000.;
+ tubeout = ckt.run(in) * postgain;
//Tone Stack (post tube)
fRec0[0] = ((float)tubeout - (fSlow31 * (((fSlow30 * fRec0[1]) + (fSlow29 * fRec0[2])) + (fSlow27 * fRec0[3])))) + 1e-20f;