summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2019-12-15 18:57:30 +1100
committerDamien Zammit <damien@zamaudio.com>2019-12-15 18:57:30 +1100
commit97b8f376ef41adfac7b7c11f11fd0a8bdab36973 (patch)
treed66ff2b62ccf70198305387d3078a950c2534d26
parentd211bff779cd6dd2d24a8106bea944da4d1bd195 (diff)
ZamTube: Fix uninitialised bugs
-rw-r--r--plugins/ZamTube/ZamTubePlugin.cpp2
-rw-r--r--plugins/ZamTube/ZamTubePlugin.hpp1
-rw-r--r--plugins/ZamTube/wdfcircuits.h14
3 files changed, 12 insertions, 5 deletions
diff --git a/plugins/ZamTube/ZamTubePlugin.cpp b/plugins/ZamTube/ZamTubePlugin.cpp
index 66eb7b6..3ddb4d8 100644
--- a/plugins/ZamTube/ZamTubePlugin.cpp
+++ b/plugins/ZamTube/ZamTubePlugin.cpp
@@ -276,7 +276,7 @@ void ZamTubePlugin::activate()
int pre = 0;
float volumepot = 1e+6;
ckt.on = false;
- ckt.updateRValues(ci[pre], ck[pre], co[pre], e[pre], er[pre], rg[pre], volumepot, rk[pre], 136e+3, ro[pre], Fs, v);
+ ckt.updateRValues(ci[pre], ck[pre], co[pre], e[pre], er[pre], rg[pre], volumepot, rk[pre], 136e+3, ro[pre], Fs);
ckt.warmup_tubes();
fSamplingFreq = Fs;
diff --git a/plugins/ZamTube/ZamTubePlugin.hpp b/plugins/ZamTube/ZamTubePlugin.hpp
index f817ac7..0e6eaba 100644
--- a/plugins/ZamTube/ZamTubePlugin.hpp
+++ b/plugins/ZamTube/ZamTubePlugin.hpp
@@ -47,7 +47,6 @@ typedef long double quad;
class ZamTubePlugin : public Plugin
{
public:
- Triode v;
TubeStageCircuit ckt;
T ci[2];
T ck[2];
diff --git a/plugins/ZamTube/wdfcircuits.h b/plugins/ZamTube/wdfcircuits.h
index aab382f..4670160 100644
--- a/plugins/ZamTube/wdfcircuits.h
+++ b/plugins/ZamTube/wdfcircuits.h
@@ -11,7 +11,6 @@ public:
TubeStageCircuit() {
reset_tubes();
- warmup_tubes();
}
void warmup_tubes(void) {
@@ -29,10 +28,19 @@ public:
Coa = 0.0;
Vg = 0.0;
Vk = 0.0;
+ P3_3Gamma1 = 1.;
+ P0_3Gamma1 = 1.;
+ S1_3Gamma1 = 1.;
+ S3_3Gamma1 = 1.;
+ P1_3Gamma1 = 1.;
+ ViE = 0.;
+ S0_3Gamma1 = 1.;
+ S2_3Gamma1 = 1.;
+ P2_3Gamma1 = 1.;
+ E500E = 0.;
}
- void updateRValues(Real C_Ci, Real C_Ck, Real C_Co, Real E_E500, Real R_E500, Real R_Rg, Real R_Ri, Real R_Rk, Real R_Vi, Real R_Ro, Real sampleRate, Triode& tube) {
- t = tube;
+ void updateRValues(Real C_Ci, Real C_Ck, Real C_Co, Real E_E500, Real R_E500, Real R_Rg, Real R_Ri, Real R_Rk, Real R_Vi, Real R_Ro, Real sampleRate) {
Real ViR = R_Vi;
Real CiR = 1.0 / (2.0*C_Ci*sampleRate);
Real RiR = R_Ri;