shithub: leaf

Download patch

ref: 54e3a79a43f57c37f5756dc87fe8d6f4f53980e5
parent: 3eaa22b1fa6fafffdb6961c7dda791f3df59d885
author: Matthew Wang <mjw7@princeton.edu>
date: Mon Mar 1 11:29:12 EST 2021

fix expsmooth base factor init

--- a/leaf/Src/leaf-envelopes.c
+++ b/leaf/Src/leaf-envelopes.c
@@ -1318,6 +1318,7 @@
     smooth->dest = val;
     if (factor < 0) factor = 0;
     if (factor > 1) factor = 1;
+    smooth->baseFactor = factor;
     smooth->factor = factor;
     smooth->oneminusfactor = 1.0f - factor;
     smooth->invSampleRate = smooth->mempool->leaf->invSampleRate;
@@ -1363,7 +1364,7 @@
 float   tExpSmooth_tick(tExpSmooth* const expsmooth)
 {
     _tExpSmooth* smooth = *expsmooth;
-    smooth->curr = smooth->factor*smooth->dest+smooth->oneminusfactor*smooth->curr;
+    smooth->curr = smooth->factor * smooth->dest + smooth->oneminusfactor * smooth->curr;
     return smooth->curr;
 }