ref: ee1acb645d0683b97bbd1f65a2e708a8aadea34d
parent: 730c142fc22aad6d78c2f299ba3d64d85b7d90c6
author: Matthew Wang <Matthew@nat-oitwireless-inside-vapornet100-10-9-53-29.princeton.edu>
date: Wed Dec 11 06:53:04 EST 2019
fix sampler clicks when using short loop/high rate
--- a/LEAF/Src/leaf-sampling.c
+++ b/LEAF/Src/leaf-sampling.c
@@ -174,7 +174,7 @@
if (p->active == 0) return 0.f;
- if ((p->inc == 0.0f) || (p->len < 4))
+ if ((p->inc == 0.0f) || (p->len < 1))
{
return p->last;
}
@@ -218,7 +218,7 @@
int i4 = (idx+2) % p->len;
sample = LEAF_interpolate_hermite (buff[i1],
- buff[idx],
+ buff[idx%p->len],
buff[i3],
buff[i4],
alpha);
@@ -258,7 +258,7 @@
int i4 = ((idx-2) + p->len) % p->len;
sample = LEAF_interpolate_hermite (buff[i1],
- buff[idx],
+ buff[idx%p->len],
buff[i3],
buff[i4],
1.0f-alpha);