shithub: leaf

Download patch

ref: 697a53f9c9921991681e2a599af8b163d8dc388a
parent: 382ddd1e8d09ecc06f4bd7e02e274e7fdcda63ee
author: Matthew Wang <mjw7@princeton.edu>
date: Fri Aug 7 12:25:08 EDT 2020

don't allow sampler rate to exceed half the length

--- a/leaf/Src/leaf-sampling.c
+++ b/leaf/Src/leaf-sampling.c
@@ -956,6 +956,7 @@
     j = c->_j;  /* index into buffer _f */
     
     length = end - start;
+    w = fminf((float)length * 0.5f, w);
 
     //a = 0.2 + 0.8 * vco->_port [FILT];
     a = 0.5f; // when a = 1, LPfilter is disabled