From 274ff10b2f686b3f450103477cd5818860398c8a Mon Sep 17 00:00:00 2001 From: Ed Kelly Date: Sat, 15 Aug 2009 00:34:35 +0000 Subject: Didn't work: try again! svn path=/trunk/externals/bsaylor/; revision=11917 --- svf~.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'svf~.c') diff --git a/svf~.c b/svf~.c index 43930f0..8df5a7a 100644 --- a/svf~.c +++ b/svf~.c @@ -18,7 +18,7 @@ #define F_R 3 // Denormalise floats, only actually needed for PIII and very recent PowerPC -//#define FLUSH_TO_ZERO(fv) (((*(unsigned int*)&(fv))&0x7f800000)==0)?0.0f:(fv) +#define FLUSH_TO_ZERO(fv) (((*(unsigned int*)&(fv))&0x7f800000)==0)?0.0f:(fv) /* pd's samplerate */ float fs; @@ -56,8 +56,12 @@ static inline float run_svf(t_svf *sv, float in) { in = sv->qnrm * in ; for (i=0; i < F_R; i++) { // only needed for pentium chips - in = ((int)in & 0x7f800000)==0?0.0f:in; - sv->l = ((int)sv->l & 0x7f800000)==0?0.0f:sv->l; + // OLD VERSION + in = FLUSH_TO_ZERO(in); + sv->l = FLUSH_TO_ZERO(sv->l); + // new versions, thanks to Damon Chaplin, inserted by Ed Kelly, not yet working!!! + //in = ((int)in & 0x7f800000)==0?0.0f:in; + //sv->l = ((int)sv->l & 0x7f800000)==0?0.0f:sv->l; // very slight waveshape for extra stability sv->b = sv->b - sv->b * sv->b * sv->b * 0.001f; -- cgit v1.2.1