diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2020-09-02 21:35:47 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2020-09-02 21:42:47 +0200 |
commit | cccd83938fd33631c36dd5e22ea2364a12fe5305 (patch) | |
tree | eac0433654c31ea6b31c295c74088b60dc7bf607 /plugins/LV2/src/ADClip7/ADClip7.cpp | |
parent | 529eff1742ef8e62bc8ccb402fcaa21eba7e2ff7 (diff) | |
download | airwindows-lv2-port-cccd83938fd33631c36dd5e22ea2364a12fe5305.tar.gz airwindows-lv2-port-cccd83938fd33631c36dd5e22ea2364a12fe5305.tar.bz2 airwindows-lv2-port-cccd83938fd33631c36dd5e22ea2364a12fe5305.zip |
LV2: Reset state on activate.
This makes sure all internal parameters are initializet to sane values
before processing starts. The VST version does this on construction, but
it seems better (at least for LV2) to do this as part of the activate
callback.
This should fix noise on the start of the audio processing with the
plugins.
Diffstat (limited to 'plugins/LV2/src/ADClip7/ADClip7.cpp')
-rw-r--r-- | plugins/LV2/src/ADClip7/ADClip7.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/plugins/LV2/src/ADClip7/ADClip7.cpp b/plugins/LV2/src/ADClip7/ADClip7.cpp index e568a30..5d5ad0d 100644 --- a/plugins/LV2/src/ADClip7/ADClip7.cpp +++ b/plugins/LV2/src/ADClip7/ADClip7.cpp @@ -5,11 +5,33 @@ ADClip7::ADClip7(double rate) : LV2Plugin(rate) - , refclipL(0.99) - , refclipR(0.99) { } +void ADClip7::activate() +{ + lastSampleL = 0.0; + lastSampleR = 0.0; + + for(int count = 0; count < 22199; count++) { + bL[count] = 0; + bR[count] = 0; + } + + gcount = 0; + lowsL = 0; + lowsR = 0; + refclipL = 0.99; + refclipR = 0.99; + iirLowsAL = 0.0; + iirLowsAR = 0.0; + iirLowsBL = 0.0; + iirLowsBR = 0.0; + + fpNShapeL = 0.0; + fpNShapeR = 0.0; +} + void ADClip7::run(uint32_t num_samples) { A = *params[0]; |