aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMick Grierson <mickgrierson@strangebook.lan>2011-10-20 18:03:32 +0100
committerMick Grierson <mickgrierson@strangebook.lan>2011-10-20 18:03:32 +0100
commit2b01058183bdbab5ddf50905d34db2138946e276 (patch)
tree8333fa67ef14a05cb62c04e614fd5509e1bd2d54
parent06a73f45dcb6830777239ae86aacf019898e7a77 (diff)
autogain compensation for the compression
-rwxr-xr-xmain.cpp5
-rw-r--r--maximilian.cpp7
2 files changed, 6 insertions, 6 deletions
diff --git a/main.cpp b/main.cpp
index 54b0063..797f185 100755
--- a/main.cpp
+++ b/main.cpp
@@ -6,7 +6,7 @@ double out;
void setup() {//some inits
- beats.load("/Users/mick/Desktop/schub.wav");//load in your samples. Provide the full path to a wav file.
+ beats.load("/Users/mickgrierson/Documents/audio/audio2/orbital1.wav");//load in your samples. Provide the full path to a wav file.
printf("Summary:\n%s", beats.getSummary());//get info on samples if you like.
}
@@ -16,7 +16,8 @@ void play(double *output) {//this is where the magic happens. Very slow magic.
//here, we're just compressing the file in real-time
//arguments are input,ratio,threshold,attack,release. a long attack is something like 0.0001 and a long release is like 0.9999.
- out=compressor.compressor(beats.play(),20,0.25,0.0005,0.9999);
+
+ out=compressor.compressor(beats.play(),10,0.1,0.2,0.9995);
output[0]=out;
output[1]=out;
diff --git a/maximilian.cpp b/maximilian.cpp
index bbc36de..c7396e1 100644
--- a/maximilian.cpp
+++ b/maximilian.cpp
@@ -881,7 +881,7 @@ double maxiDyn::compressor(double input, double ratio, double threshold, double
holdcount=0;
releasephase=0;
attackphase=1;
- if(currentRatio==0) currentRatio=0.01;
+ if(currentRatio==0) currentRatio=ratio;
}
if (attackphase==1 && currentRatio<ratio-1) {
@@ -894,8 +894,7 @@ double maxiDyn::compressor(double input, double ratio, double threshold, double
}
if (releasephase==1 && currentRatio>0.) {
- currentRatio*=release;
-
+ currentRatio*=release;
}
if (input>0.) {
@@ -904,7 +903,7 @@ double maxiDyn::compressor(double input, double ratio, double threshold, double
output = input/(1.+currentRatio);
}
- return output*ratio;
+ return output*(1+log(ratio));
}