aboutsummaryrefslogtreecommitdiff
path: root/modules/statwav.c
diff options
context:
space:
mode:
Diffstat (limited to 'modules/statwav.c')
-rw-r--r--modules/statwav.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/statwav.c b/modules/statwav.c
index 52c6a0b..13d9c9f 100644
--- a/modules/statwav.c
+++ b/modules/statwav.c
@@ -67,11 +67,15 @@ static t_int *statwav_tilde_perform(t_int *w)
{
float phase = *in++;
float modphase = phase - (int)phase;
- float findex = modphase * maxindex;
- int index = findex;
+ float findex;
+ int index;
int ia, ib, ic, id;
float frac, a, b, c, d, cminusb;
static int count;
+
+ if (modphase < 0.0f) modphase += 1.0f;
+ findex = modphase * maxindex;
+ index = findex;
frac = findex - index;