From 494a07a361fe4ee0e54f77468a976b1a77818770 Mon Sep 17 00:00:00 2001 From: Tom Schouten Date: Fri, 12 Sep 2003 22:26:57 +0000 Subject: creb 0.9.0 svn path=/trunk/externals/creb/; revision=956 --- modules/statwav.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'modules/statwav.c') 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; -- cgit v1.2.1