Dan Allegre / 401_reverb

Dependencies:   mbed

Revision:
1:a4ce08417c60
Parent:
0:c12e968e5b60
Child:
2:1b50325e256f
--- a/main.cpp	Tue Jun 23 06:22:47 2015 +0000
+++ b/main.cpp	Sat Jul 30 02:21:09 2016 +0000
@@ -18,7 +18,8 @@
 #define SAMPLINGFREQ    22          //roughly the smapling frequency in KHz.  options are 22,29,44,88 for 22khz,29khz,etc..
 
 #include "mbed.h"
-#include "dsp.h" 
+#include "dsp.h"
+#include "allpass.h"
 #include "codec.h"
  
 SPI spi(SPI_MOSI,SPI_MISO,SPI_SCK);
@@ -42,8 +43,8 @@
 OnePoleHp audioFilterHP;
 OnePoleLp feedbackFilter;
 OnePoleLp lengthFilter;
-Delay delayLeft;
-Delay delayRight;
+AllPass delayLeft;
+AllPass delayRight;
 
 void I2S_send(void){
     cs.write(0);                                //0 for left output
@@ -64,28 +65,10 @@
     measf3 *= (DELAYLEN);                       //convert to delay index normalization
 
     //process audio
-    ///*
-    //*/
-    left_out_f = delayLeft.process(left_in_f,audioFeedbackRight*feedback3,measf3);
-    right_out_f = delayRight.process(left_in_f,audioFeedbackLeft*feedback3,measf3+offset);     //add an offset in just for shits.
+    left_out_f = delayLeft.process(left_in_f,feedback3,measf3);
+    right_out_f = delayRight.process(left_in_f,feedback3,measf3+offset);     //add an offset in just for shits.
     left_out_u = satAdd(left_in_f,left_out_f);
     right_out_u = satAdd(left_in_f,right_out_f);
-    
-    //a little damping of the feedback
-    audioFeedbackRight =  audioFilter.process(right_out_f);
-    for(int i = 0; i < LPdampingPoles - 1; i++){
-        audioFeedbackRight =  audioFilter.process(audioFeedbackRight);
-    }
-    for(int i = 0; i < HPdampingPoles; i++){
-        audioFeedbackRight =  audioFilterHP.process(audioFeedbackRight);
-    }
-    audioFeedbackLeft =   audioFilter.process(left_out_f);
-    for(int i = 0; i < LPdampingPoles - 1; i++){    
-        audioFeedbackLeft =   audioFilter.process(audioFeedbackLeft);
-    }
-    for(int i = 0; i < HPdampingPoles; i++){    
-        audioFeedbackLeft =  audioFilterHP.process(audioFeedbackLeft);
-    }
 
     /////////////////////////////////////////end of dsp part/////////////////////////////////////////////////////////////////