diff options
author | Damien Zammit <damien@zamaudio.com> | 2019-01-14 23:56:10 +1100 |
---|---|---|
committer | Damien Zammit <damien@zamaudio.com> | 2019-01-14 23:56:10 +1100 |
commit | 54bc96b04622c6c85bebd1e6af1fcd2f7eb748c9 (patch) | |
tree | 09a1126317d8e8543294e1c1713e5f95d7b9f7f2 /plugins/ZamTube/ZamTubePlugin.cpp | |
parent | 05d152183a5432813dd4a73fc77393a1a85d1c96 (diff) |
Introduce taylor expansion to reduce load by > 300x
Diffstat (limited to 'plugins/ZamTube/ZamTubePlugin.cpp')
-rw-r--r-- | plugins/ZamTube/ZamTubePlugin.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/plugins/ZamTube/ZamTubePlugin.cpp b/plugins/ZamTube/ZamTubePlugin.cpp index 1eb1328..719a2ae 100644 --- a/plugins/ZamTube/ZamTubePlugin.cpp +++ b/plugins/ZamTube/ZamTubePlugin.cpp @@ -251,7 +251,7 @@ void ZamTubePlugin::activate() co[0] = 10e-9; ro[0] = 1e+6; - /* Matt's preamp + /* Matt's preamp */ ci[1] = 100e-9; rg[1] = 1.; rk[1] = 820.; @@ -260,9 +260,8 @@ void ZamTubePlugin::activate() er[1] = 120e+3; co[1] = 4.7e-9; ro[1] = 470e+3; - */ - /* CLA's preamp (not good with all tonestacks) + /* CLA's preamp ci[1] = 1.0e-7; rg[1] = 5.6e+3; rk[1] = 1.5e+3; @@ -340,11 +339,13 @@ void ZamTubePlugin::run(const float** inputs, float** outputs, uint32_t frames) float tubeout = 0.f; - if (insaneold != insane) { - ckt.t.insane = insane; + if (insane != insaneold) { + ckt.reset_tubes(); + ckt.warmup_tubes(); + fRec0[3] = fRec0[2] = fRec0[1] = fRec0[0] = 0.f; insaneold = insane; } - int pre = 0; + int pre = insane < 0.5 ? 0 : 1; float volumepot = tubedrive / 11. * 1e+6; ckt.updateRValues(ci[pre], ck[pre], co[pre], e[pre], er[pre], rg[pre], volumepot, rk[pre], 136e+3, ro[pre], getSampleRate(), v); |