diff options
| author | Mick Grierson <mickgrierson@gmail.com> | 2011-11-11 17:28:08 +0000 |
|---|---|---|
| committer | Mick Grierson <mickgrierson@gmail.com> | 2011-11-11 17:28:08 +0000 |
| commit | 8a070a5939f3efddb5d719a3a9e787eb3a4862e4 (patch) | |
| tree | 8e6b8123f41b95b807af508e4b3ceef035f894e9 | |
| parent | 8f41c4ec048a97de3ef9840b66795f41c628851d (diff) | |
rewrote the delay line
4 files changed, 15 insertions, 12 deletions
diff --git a/maximilian.cpp b/maximilian.cpp index 40ff0f1..d731311 100644 --- a/maximilian.cpp +++ b/maximilian.cpp @@ -227,9 +227,9 @@ double maxiDelayline::dl(double input, int size, double feedback) { if ( phase >=size ) { phase = 0; } + output=memory[phase]; memory[phase]=(memory[phase]*feedback)+(input*feedback)*0.5; phase+=1; - output=memory[phase]; return(output); } @@ -237,9 +237,9 @@ double maxiDelayline::dl(double input, int size, double feedback) { double maxiDelayline::dl(double input, int size, double feedback, int position) { if ( phase >=size ) phase = 0; if ( position >=size ) position = 0; - memory[phase]=(memory[phase]*feedback)+(input*feedback)*chandiv; + output=memory[position]; + memory[phase]=(memory[phase]*feedback)+(input*feedback)*chandiv; phase+=1; - output=memory[position]; return(output); } diff --git a/ofxMaxim/ofxMaxim/libs/maximilian.cpp b/ofxMaxim/ofxMaxim/libs/maximilian.cpp index b5bf5ed..fe046f2 100644 --- a/ofxMaxim/ofxMaxim/libs/maximilian.cpp +++ b/ofxMaxim/ofxMaxim/libs/maximilian.cpp @@ -228,9 +228,9 @@ double maxiDelayline::dl(double input, int size, double feedback) { if ( phase >=size ) { phase = 0; } + output=memory[phase]; memory[phase]=(memory[phase]*feedback)+(input*feedback)*0.5; phase+=1; - output=memory[phase]; return(output); } @@ -238,13 +238,14 @@ double maxiDelayline::dl(double input, int size, double feedback) { double maxiDelayline::dl(double input, int size, double feedback, int position) { if ( phase >=size ) phase = 0; if ( position >=size ) position = 0; - memory[phase]=(memory[phase]*feedback)+(input*feedback)*chandiv; + output=memory[position]; + memory[phase]=(memory[phase]*feedback)+(input*feedback)*chandiv; phase+=1; - output=memory[position]; return(output); } + //I particularly like these. cutoff between 0 and 1 double maxiFilter::lopass(double input, double cutoff) { output=outputs[0] + cutoff*(input-outputs[0]); diff --git a/ofxMaxim/ofxMaximExamples007OSX/ofMaximExample007OSX/ofxMaxim/libs/maximilian.cpp b/ofxMaxim/ofxMaximExamples007OSX/ofMaximExample007OSX/ofxMaxim/libs/maximilian.cpp index e75ddf5..102ef15 100644 --- a/ofxMaxim/ofxMaximExamples007OSX/ofMaximExample007OSX/ofxMaxim/libs/maximilian.cpp +++ b/ofxMaxim/ofxMaximExamples007OSX/ofMaximExample007OSX/ofxMaxim/libs/maximilian.cpp @@ -228,9 +228,9 @@ double maxiDelayline::dl(double input, int size, double feedback) { if ( phase >=size ) { phase = 0; } + output=memory[phase]; memory[phase]=(memory[phase]*feedback)+(input*feedback)*0.5; phase+=1; - output=memory[phase]; return(output); } @@ -238,13 +238,14 @@ double maxiDelayline::dl(double input, int size, double feedback) { double maxiDelayline::dl(double input, int size, double feedback, int position) { if ( phase >=size ) phase = 0; if ( position >=size ) position = 0; - memory[phase]=(memory[phase]*feedback)+(input*feedback)*chandiv; + output=memory[position]; + memory[phase]=(memory[phase]*feedback)+(input*feedback)*chandiv; phase+=1; - output=memory[position]; return(output); } + //I particularly like these. cutoff between 0 and 1 double maxiFilter::lopass(double input, double cutoff) { output=outputs[0] + cutoff*(input-outputs[0]); diff --git a/ofxMaxim/ofxMaximiPhone0062Example/ofxMaxim/libs/maximilian.cpp b/ofxMaxim/ofxMaximiPhone0062Example/ofxMaxim/libs/maximilian.cpp index e75ddf5..102ef15 100644 --- a/ofxMaxim/ofxMaximiPhone0062Example/ofxMaxim/libs/maximilian.cpp +++ b/ofxMaxim/ofxMaximiPhone0062Example/ofxMaxim/libs/maximilian.cpp @@ -228,9 +228,9 @@ double maxiDelayline::dl(double input, int size, double feedback) { if ( phase >=size ) { phase = 0; } + output=memory[phase]; memory[phase]=(memory[phase]*feedback)+(input*feedback)*0.5; phase+=1; - output=memory[phase]; return(output); } @@ -238,13 +238,14 @@ double maxiDelayline::dl(double input, int size, double feedback) { double maxiDelayline::dl(double input, int size, double feedback, int position) { if ( phase >=size ) phase = 0; if ( position >=size ) position = 0; - memory[phase]=(memory[phase]*feedback)+(input*feedback)*chandiv; + output=memory[position]; + memory[phase]=(memory[phase]*feedback)+(input*feedback)*chandiv; phase+=1; - output=memory[position]; return(output); } + //I particularly like these. cutoff between 0 and 1 double maxiFilter::lopass(double input, double cutoff) { output=outputs[0] + cutoff*(input-outputs[0]); |
