summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2023-10-21 21:24:39 +1100
committerDamien Zammit <damien@zamaudio.com>2023-10-21 21:24:39 +1100
commit887356bd3fb4d4dbca5d6efbd1cacb73e9969906 (patch)
tree359b87e78aeaff58ca0e8ce4132e577090697169
parent462c82ac500c92e94162a9e6523c137210e42254 (diff)
ZamTube: Make insane mode less harsh, adds more bass by fixing gridleak
-rw-r--r--plugins/ZamTube/ZamTubePlugin.cpp4
-rw-r--r--plugins/ZamTube/wdfcircuits.h17
2 files changed, 13 insertions, 8 deletions
diff --git a/plugins/ZamTube/ZamTubePlugin.cpp b/plugins/ZamTube/ZamTubePlugin.cpp
index 337bcb5..9f07955 100644
--- a/plugins/ZamTube/ZamTubePlugin.cpp
+++ b/plugins/ZamTube/ZamTubePlugin.cpp
@@ -334,10 +334,10 @@ void ZamTubePlugin::activate()
ro[0] = 100e+3;
*/
- ckt[0].updateRValues(ci[0], ck[0], co[0], e[0], er[0], rg[0], 800e+3, rk[0], 1e+3, ro[0], Fs);
- ckt[1].updateRValues(ci[0], ck[0], co[0], e[0], er[0], rg[0], 800e+3, rk[0], 1e+3, ro[0], Fs);
ckt[0].set_mode(ckt[0].TUBE_MODE_SIXTIES);
ckt[1].set_mode(ckt[1].TUBE_MODE_SIXTIES);
+ ckt[0].updateRValues(ci[0], ck[0], co[0], e[0], er[0], rg[0], 800e+3, rk[0], 1e+3, ro[0], Fs);
+ ckt[1].updateRValues(ci[0], ck[0], co[0], e[0], er[0], rg[0], 800e+3, rk[0], 1e+3, ro[0], Fs);
fSamplingFreq = Fs;
diff --git a/plugins/ZamTube/wdfcircuits.h b/plugins/ZamTube/wdfcircuits.h
index 55fddb7..602e536 100644
--- a/plugins/ZamTube/wdfcircuits.h
+++ b/plugins/ZamTube/wdfcircuits.h
@@ -137,6 +137,7 @@ public:
}
Real advanc_gridleak(Real ViE) {
+ ViE *= 0.05;
//Get Bs
//S2_3GetB
//P2_3GetB
@@ -180,10 +181,10 @@ public:
//RkGetB
//P1_2SetA
//Call tube model
- Vg = (S1_3b3);
- Real Vd = Vk+Vg;
+ Vg = (-S1_3b3);
+ Real Vd = (Vk+Vg);
Real Rd = (Vd > 0.) ? 2.7e+3 : 100e+9;
- Real b = t.compute(S2_3b3, S2_3Gamma1, Vg, Vk);
+ Real b = -t.compute(S2_3b3, S2_3Gamma1, Vg, Vk);
Vk = -(P1_3b3 + Vd * S1_3Gamma1 / Rd);
//Set As
//S2_3SetA
@@ -243,14 +244,15 @@ public:
//S1_1SetA
//P0_3GetB
//S0_3GetB
- //Real Cib = Cia;
+ Real Cib = Cia;
//S0_1SetA
//ViGetB
//S0_2SetA
+ Real S0_3b3 = -(Cib + ViE);
//P0_1SetA
//RiGetB
//P0_2SetA
- Real P0_3b3 = -P0_3Gamma1*ViE;
+ Real P0_3b3 = -P0_3Gamma1*(-S0_3b3);
//S1_2SetA
Real S1_3b3 = -(P0_3b3);
//P1_3GetB
@@ -279,9 +281,12 @@ public:
//RkSetA
//S1_3SetA
//RgSetA
+ Real S1_3b2 = Vg - S1_3Gamma1*(P0_3b3 + Vg);
//P0_3SetA
+ Real P0_3b1 = S1_3b2 - S0_3b3 - P0_3Gamma1*(-S0_3b3);
//S0_3SetA
- //Cia = S0_3b1;
+ Real S0_3b1 = Cib - S0_3Gamma1*(Cib + ViE + P0_3b1);
+ Cia = S0_3b1;
//RiSetA
//printf("Vk=%f Vg=%f Vpk=%f in=%f out=%f\n", Vk,Vg,S2_3b3, ViE,Roa);
//printf("SIXTIES: Vk=%f Vg=%f Cia=%f Coa=%f Cka=%f\n", Vk,Vg,Cia,Coa,Cka);