Dan Allegre / 401_reverb

Dependencies:   mbed

Revision:
1:a4ce08417c60
Parent:
0:c12e968e5b60
diff -r c12e968e5b60 -r a4ce08417c60 dsp.h
--- a/dsp.h	Tue Jun 23 06:22:47 2015 +0000
+++ b/dsp.h	Sat Jul 30 02:21:09 2016 +0000
@@ -101,14 +101,12 @@
 class Delay {
 public:
     Delay() {
-        //buffer[DELAYLEN] = {0};
         index1 = 0;
         index2 = DELAYLEN*.99;
         for(int i = 0; i <= DELAYLEN; i++){
             buffer[i] = 0;
         }
     };
-    //~Delay();
     void setLength(float length);
     float process(float in, float fbin, float length);
 protected:
@@ -117,7 +115,6 @@
     float fraclength, out;
 };
 inline float Delay::process(float in, float fbin, float length){
-    
     //update index values
     index1++;
     index2++;
@@ -136,7 +133,7 @@
         index2 = index1 + intlength - DELAYLEN;
      
     //write to delay buffer   
-    buffer[index1] = satSubtract(in,fbin);
+    buffer[index1] = satAdd(in,fbin);
 
     //read the delays out of the delay array.  do some crazy interpolation stuff.
     if(index2+1 < DELAYLEN){
@@ -145,4 +142,4 @@
         out = buffer[index2];                                                    //probably just want to take the output of the delay and not the dry.
     }
     return out;
-}
+}
\ No newline at end of file