diff options
author | Damien Zammit <damien@zamaudio.com> | 2023-10-15 21:20:50 +1100 |
---|---|---|
committer | Damien Zammit <damien@zamaudio.com> | 2023-10-15 21:20:50 +1100 |
commit | d5f04c69bee71e59ca6e372b5d55bc79d1734cba (patch) | |
tree | b5dfdaa58860c15e9fb26a27a913c73edfcb03ac | |
parent | 2ef55cf37524ef1356e9a295887a71f0bc0b2c15 (diff) |
ZamTube: Move tonestack post tube again, shapes wave better.
-rw-r--r-- | plugins/ZamTube/ZamTubePlugin.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/ZamTube/ZamTubePlugin.cpp b/plugins/ZamTube/ZamTubePlugin.cpp index e3e7ad6..b4dde0f 100644 --- a/plugins/ZamTube/ZamTubePlugin.cpp +++ b/plugins/ZamTube/ZamTubePlugin.cpp @@ -408,7 +408,7 @@ void ZamTubePlugin::run(const float** inputs, float** outputs, uint32_t frames) { const uint8_t stack = (uint8_t)tonestack > 24 ? 24 : (uint8_t)tonestack; - float toneout = 0.f; + float tubeout = 0.f; float cut = 15.; float pregain = from_dB(tubedrive*3.6364 - cut + mastergain); @@ -435,11 +435,11 @@ 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; - //Tone Stack (pre tube) - fRec0[0] = (in - (fSlow31 * (((fSlow30 * fRec0[1]) + (fSlow29 * fRec0[2])) + (fSlow27 * fRec0[3])))) + 1e-20f; - toneout = sanitize_denormal((float)(fSlow31 * ((((fSlow46 * fRec0[0]) + (fSlow45 * fRec0[1])) + (fSlow43 * fRec0[2])) + (fSlow41 * fRec0[3])))); + tubeout = ckt.run(in) * postgain / 10000.; - outputs[0][i] = ckt.run(toneout) * postgain / 10000.; + //Tone Stack (post tube) + fRec0[0] = ((float)tubeout - (fSlow31 * (((fSlow30 * fRec0[1]) + (fSlow29 * fRec0[2])) + (fSlow27 * fRec0[3])))) + 1e-20f; + outputs[0][i] = sanitize_denormal((float)(fSlow31 * ((((fSlow46 * fRec0[0]) + (fSlow45 * fRec0[1])) + (fSlow43 * fRec0[2])) + (fSlow41 * fRec0[3])))); // update filter states fRec0[3] = fRec0[2]; |