shithub: sox

Download patch

ref: a5c1cc0792714826785832d1a75cff260b73670e
parent: 814486a2149e672dd9dac281992f28800445cd19
author: robs <robs>
date: Mon Mar 23 05:20:24 EDT 2009

bring pink noise into line w.r.t. random

--- a/src/synth.c
+++ b/src/synth.c
@@ -100,7 +100,6 @@
   long newRandom;
   long sum;
   float output;
-  static int32_t r;
 
   /* Increment and mask index. */
   pink->pink_Index = (pink->pink_Index + 1) & pink->pink_IndexMask;
@@ -122,13 +121,13 @@
      * values together. Only one changes each time.
      */
     pink->pink_RunningSum -= pink->pink_Rows[numZeros];
-    newRandom = ranqd1(r) >> PINK_RANDOM_SHIFT;
+    newRandom = RANQD1 >> PINK_RANDOM_SHIFT;
     pink->pink_RunningSum += newRandom;
     pink->pink_Rows[numZeros] = newRandom;
   }
 
   /* Add extra white noise value. */
-  newRandom = ranqd1(r) >> PINK_RANDOM_SHIFT;
+  newRandom = RANQD1 >> PINK_RANDOM_SHIFT;
   sum = pink->pink_RunningSum + newRandom;
 
   /* Scale to range of -1 to 0.9999. */