shithub: leaf

Download patch

ref: dba875129b0d0aabbc90d8affcf782e2b8a116a4
parent: 579b819f8416248abe1bda1eb27d14cda3c91b7e
author: mulshine <mulshine@princeton.edu>
date: Mon Apr 8 06:58:02 EDT 2019

tTapeDelay fixes.

--- a/LEAF/Inc/leaf-mempool.h
+++ b/LEAF/Inc/leaf-mempool.h
@@ -50,7 +50,7 @@
     
 //==============================================================================
 
-#define MPOOL_POOL_SIZE   3000000
+#define MPOOL_POOL_SIZE   500000
 #define MPOOL_ALIGN_SIZE (8)
 
 //#define size_t unsigned long
--- a/LEAF/Src/leaf-delay.c
+++ b/LEAF/Src/leaf-delay.c
@@ -413,8 +413,6 @@
 void   tTapeDelay_init (tTapeDelay* const d, float delay, uint32_t maxDelay)
 {
     d->maxDelay = maxDelay;
-    
-    d->delay = LEAF_clip(1.f, delay, d->maxDelay);
 
     d->buff = (float*) leaf_alloc(sizeof(float) * maxDelay);
     
@@ -427,7 +425,7 @@
     d->inc = 1.0f;
     d->inPoint = 0;
     
-    tTapeDelay_setDelay(d, 1.f);
+    tTapeDelay_setDelay(d, delay);
 }
 
 void tTapeDelay_free(tTapeDelay* const d)
@@ -438,7 +436,7 @@
 
 int count = 0;
 
-#define SMOOTH_FACTOR 10.f
+//#define SMOOTH_FACTOR 10.f
 
 float   tTapeDelay_tick (tTapeDelay* const d, float input)
 {
@@ -459,11 +457,11 @@
     float diff = (d->inPoint - d->idx);
     while (diff < 0.f) diff += d->maxDelay;
     
-    d->inc = 1.0f + (diff - d->delay) / d->delay * SMOOTH_FACTOR;
+    d->inc = 1.0f + (diff - d->delay) / d->delay; //* SMOOTH_FACTOR;
 
     d->idx += d->inc;
     
-    if (d->idx >= d->maxDelay) d->idx = 0.f;
+    if (d->idx >= d->maxDelay) d->idx = 0.0f;
 
     return d->lastOut;
 }