changeset 14623:108fcc2e5d01

using af_softclip
author alex
date Mon, 31 Jan 2005 11:43:36 +0000
parents 637fbaa8f56c
children 7b7c94b5e78a
files libaf/af_volume.c
diffstat 1 files changed, 2 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libaf/af_volume.c	Mon Jan 31 11:43:08 2005 +0000
+++ b/libaf/af_volume.c	Mon Jan 31 11:43:36 2005 +0000
@@ -177,14 +177,8 @@
 	    s->pow[ch] = t*s->pow[ch] + pow*s->time; // LP filter
 	  /* Soft clipping, the sound of a dream, thanks to Jon Wattes
 	     post to Musicdsp.org */
-	  if(s->soft){
-	    if (x >=  M_PI/2)
-	      x = 1.0;
-	    else if(x <= -M_PI/2)
-	      x = -1.0;
-	    else
-	      x = sin(x);
-	  }
+	  if(s->soft)
+	    x=af_softclip(x);
 	  // Hard clipping
 	  else
 	    x=clamp(x,-1.0,1.0);