From 6c399125930609645c6aabd055aa6ea8fe54a2ed Mon Sep 17 00:00:00 2001 From: Mick Grierson Date: Wed, 19 Oct 2011 14:32:48 +0100 Subject: fixed compressor --- main.cpp | 6 ++---- maximilian.cpp | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/main.cpp b/main.cpp index 7cece7b..d3b57d9 100755 --- a/main.cpp +++ b/main.cpp @@ -13,16 +13,14 @@ void setup() {//some inits void play(double *output) {//this is where the magic happens. Very slow magic. - out=compressor.compressor(beats.play(),1,0.02,0.0005,0.9995);//just play the file. Looping is default for all play functions. + out=compressor.compressor(beats.play(),30,0.5,0.0005,0.995);//just play the file. Looping is default for all play functions. - output[0]=out; output[1]=out; // *output=beats.play(0.69);//play the file with a speed setting. 1. is normal speed. // *output=beats.play(0.5,0,44100);//linear interpolationplay with a frequency input, start point and end point. Useful for syncing. // *output=beats.play4(0.5,0,44100);//cubic interpolation play with a frequency input, start point and end point. Useful for syncing. - - + } diff --git a/maximilian.cpp b/maximilian.cpp index ccf4e5f..f0fd10b 100644 --- a/maximilian.cpp +++ b/maximilian.cpp @@ -896,12 +896,12 @@ double maxiDyn::compressor(double input, double ratio, double threshold, double } if (input>0.) { - output = ((input-threshold)/1.+currentRatio)+threshold; + output = input/(1.+currentRatio); } else { - output = ((input+threshold)/1.+currentRatio)-threshold; + output = input/(1.+currentRatio); } - return output; + return output*ratio; } -- cgit v1.3