From d9ad7afbbd74f68e3c1a90dec21ef1ac593e7399 Mon Sep 17 00:00:00 2001 From: Damien Zammit Date: Sun, 20 Dec 2020 14:29:27 +1100 Subject: ZamTube: Fix tonestack controls not updating --- plugins/ZamTube/ZamTubePlugin.cpp | 9 ++++++++- plugins/ZamTube/ZamTubePlugin.hpp | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/ZamTube/ZamTubePlugin.cpp b/plugins/ZamTube/ZamTubePlugin.cpp index 7c39886..4587b03 100644 --- a/plugins/ZamTube/ZamTubePlugin.cpp +++ b/plugins/ZamTube/ZamTubePlugin.cpp @@ -284,6 +284,9 @@ void ZamTubePlugin::loadProgram(uint32_t index) insane = 0.0f; insaneold = 0.0f; tonestackold = 0.0f; + bassold = 5.f; + middleold = 5.f; + trebleold = 5.f; /* Default variable values */ @@ -411,8 +414,12 @@ void ZamTubePlugin::run(const float** inputs, float** outputs, uint32_t frames) float pregain = from_dB(tubedrive*3.6364 - cut + mastergain); float postgain = from_dB(cut + 42. * (1. - log1p(tubedrive/11.))); - if (tonestackold != stack) { + if ((tonestackold != stack) || (bassold != bass) || + (middleold != middle) || (trebleold != treble)) { tonestackold = stack; + bassold = bass; + middleold = middle; + trebleold = treble; ZamTubePlugin::TonestackRecompute(stack); } diff --git a/plugins/ZamTube/ZamTubePlugin.hpp b/plugins/ZamTube/ZamTubePlugin.hpp index 6b2c9dc..617fc11 100644 --- a/plugins/ZamTube/ZamTubePlugin.hpp +++ b/plugins/ZamTube/ZamTubePlugin.hpp @@ -160,6 +160,7 @@ Wave digital filter physical model of a triode tube amplifier stage, with modell private: float tubedrive,bass,middle,treble,tonestack,mastergain,insane; //parameters int insaneold, tonestackold; + float bassold, middleold, trebleold; float ts[25][7]; float fSlow27, fSlow29, fSlow30, fSlow31, fSlow41, fSlow43, fSlow45, fSlow46; -- cgit v1.2.3