diff options
author | Damien Zammit <damien@zamaudio.com> | 2018-12-30 10:43:26 +1100 |
---|---|---|
committer | Damien Zammit <damien@zamaudio.com> | 2018-12-30 12:12:50 +1100 |
commit | 14c1f3f52666d37922f044049d50b4acb31b4e1c (patch) | |
tree | 4e43e56fda9a74ca14ca64fc973f392952ce70f0 | |
parent | 6959349dcfa902dc575b9d273e23f77d593413aa (diff) |
Cleanest scope output at low gain so far!
-rw-r--r-- | plugins/ZamTube/ZamTubePlugin.cpp | 6 | ||||
-rw-r--r-- | plugins/ZamTube/wdfcircuits.h | 22 |
2 files changed, 14 insertions, 14 deletions
diff --git a/plugins/ZamTube/ZamTubePlugin.cpp b/plugins/ZamTube/ZamTubePlugin.cpp index b3009b6..0016166 100644 --- a/plugins/ZamTube/ZamTubePlugin.cpp +++ b/plugins/ZamTube/ZamTubePlugin.cpp @@ -233,7 +233,7 @@ void ZamTubePlugin::activate() v.cg2 = 11.99; v.ig02 = 3.917e-8; - ckt.updateRValues(ci, ck, co, e, rp, rg, ri, rk, ro, 10000.0, Fs, v); + ckt.updateRValues(ci, ck, co, e, rp, rg, ri, rk, ro, 1000.0, Fs, v); ckt.warmup_tubes(); fSamplingFreq = Fs; @@ -950,8 +950,8 @@ void ZamTubePlugin::run(const float** inputs, float** outputs, uint32_t frames) // protect against overflowing circuit in = fabs(in) < DANGER ? in : 0.f; - double ViE = in*from_dB(tubedrive); - tubeout = 10. * ckt.advanc(ViE) * from_dB(30. - tubedrive); + double ViE = in*from_dB(tubedrive - 30.); + tubeout = 30.*ckt.advanc(ViE) * from_dB(60. - tubedrive); if (!ckt.on) { tubeout = 0.0; } else { diff --git a/plugins/ZamTube/wdfcircuits.h b/plugins/ZamTube/wdfcircuits.h index 8b64d6a..34031dd 100644 --- a/plugins/ZamTube/wdfcircuits.h +++ b/plugins/ZamTube/wdfcircuits.h @@ -65,7 +65,7 @@ public: void warmup_tubes(void) { int i; on = false; - for (i = 0; i < 1000; i++) { + for (i = 0; i < 8000; i++) { advanc(0.0); } on = true; @@ -77,11 +77,11 @@ public: Real I3_3b3 = I3_3Gamma1 * Ckb; Real Cib = Cia; Real S0_3b3 = Cib + ViE; - Real P0_3b3 = S0_3b3 + P0_3Gamma1*(S0_3b3); - Real S1_3b3 = P0_3b3; + Real P0_3b3 = -S0_3b3 + P0_3Gamma1*(-S0_3b3); + Real S1_3b3 = P0_3b3 + S1_3Gamma1*(P0_3b3); Real Cob = Coa; Real S2_3b3 = Cob; - Real P2_3b3 = E250E + P2_3Gamma1*(S2_3b3); + Real P2_3b3 = -S2_3b3 + E250E + P2_3Gamma1*(-S2_3b3); //Tube: K G P //printf("K=%f G=%f P=%f\n", I3_3b3,-S1_3b3,P2_3b3); t.compute(I3_3b3,-S1_3b3,P2_3b3); @@ -89,16 +89,16 @@ public: Real b2 = t.getG(); Real b3 = t.getP(); //Set As - Real I3_3b1 = (b1 + Ckb - I3_3Gamma1*(Ckb)); + Real I3_3b1 = (b1 - I3_3Gamma1*(Ckb)); Cka = I3_3b1; - Real S1_3b2 = ((-b2) + P0_3b3 - S1_3Gamma1*(P0_3b3 + (-b2))); - Real P0_3b1 = (S1_3b2 + (S0_3b3) - P0_3Gamma1*(S1_3b2 + S0_3b3)); - Real S0_3b1 = (ViE + P0_3b1 - S0_3Gamma1*(Cib + P0_3b1)); + Real S1_3b2 = ((-b2) + P0_3b3 - S1_3Gamma1*(P0_3b3) - b2); + Real P0_3b1 = (S1_3b2 + (-S0_3b3) - P0_3Gamma1*(S1_3b2 - S0_3b3)); + Real S0_3b1 = (Cib + ViE - P0_3b1 - S0_3Gamma1*(Cib + ViE - P0_3b1)); Cia = S0_3b1; - Real P2_3b1 = (b3 + E250E + (S2_3b3) - P2_3Gamma1*(b3 + S2_3b3)); - Real S2_3b1 = (Cob - S2_3Gamma1*(Cob + P2_3b1)); + Real P2_3b1 = (E250E - P2_3Gamma1*(b3 - S2_3b3)); + Real S2_3b1 = (Cob - S2_3Gamma1*(Cob - P2_3b1)); Coa = S2_3b1; - Real S2_3b2 = (Cob + P2_3b1 - S2_3Gamma1*(Cob + P2_3b1)); + Real S2_3b2 = (Cob - P2_3b1 - S2_3Gamma1*(Cob - P2_3b1)); Real Roa = S2_3b2; return -Roa; } |