summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2015-11-10 20:34:10 +1100
committerDamien Zammit <damien@zamaudio.com>2015-11-10 20:34:10 +1100
commit74ef67337bbb4a134ca49617ca1e62b4778aa6fc (patch)
tree28e116fbfb3c0a16f7fd0fa7eb335542de494f81
parentd6cd4a1641a2d79f80c75d4f1d422dbbd7225899 (diff)
Fix smoothness on delay and LPF
Signed-off-by: Damien Zammit <damien@zamaudio.com>
-rw-r--r--plugins/ZamDelay/ZamDelayPlugin.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/plugins/ZamDelay/ZamDelayPlugin.cpp b/plugins/ZamDelay/ZamDelayPlugin.cpp
index 9d1a6cb..e76519f 100644
--- a/plugins/ZamDelay/ZamDelayPlugin.cpp
+++ b/plugins/ZamDelay/ZamDelayPlugin.cpp
@@ -327,7 +327,6 @@ void ZamDelayPlugin::run(const float** inputs, float** outputs, uint32_t frames)
if (lpf != lpfold) {
lpfRbj(lpf, srate);
- recalc = 1;
}
if (divisor != divisorold) {
recalc = 1;
@@ -363,17 +362,17 @@ void ZamDelayPlugin::run(const float** inputs, float** outputs, uint32_t frames)
out = 0.f;
int p = posz - tap[active]; // active line
if (p<0) p += MAX_DELAY;
- out += runfilter(z[p]);
+ out += z[p];
if (recalc) {
xfade += 1.0f / (float)frames;
out *= (1.-xfade);
int p = posz - tap[next]; // next line
if (p<0) p += MAX_DELAY;
- out += runfilter(z[p]) * xfade;
+ out += z[p] * xfade;
}
- fbstate = from_dB(gain) * (((1. - drywet) * in) + drywet * -inv * out);
- outputs[0][i] = fbstate;
+ fbstate = ((1. - drywet) * in) + drywet * -inv * runfilter(out);
+ outputs[0][i] = from_dB(gain) * fbstate;
if (++posz >= MAX_DELAY) {
posz = 0;
}