aboutsummaryrefslogtreecommitdiffstats
path: root/src/mdaOverdrive.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-05-13 16:04:14 +0000
committerDavid Robillard <d@drobilla.net>2009-05-13 16:04:14 +0000
commite39cbfb9dcf0c00133945eab186072274b45358a (patch)
tree646d496e9bb964ead2ec493e976b01f4de115590 /src/mdaOverdrive.cpp
parentc74440a8ae0169010167befafd80d44e23805f6b (diff)
downloadmda.lv2-e39cbfb9dcf0c00133945eab186072274b45358a.tar.gz
mda.lv2-e39cbfb9dcf0c00133945eab186072274b45358a.tar.bz2
mda.lv2-e39cbfb9dcf0c00133945eab186072274b45358a.zip
Strip trailing whitespace.
git-svn-id: http://svn.drobilla.net/lad/trunk/mda-lv2@1999 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/mdaOverdrive.cpp')
-rw-r--r--src/mdaOverdrive.cpp50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/mdaOverdrive.cpp b/src/mdaOverdrive.cpp
index 280e88c..2abe56d 100644
--- a/src/mdaOverdrive.cpp
+++ b/src/mdaOverdrive.cpp
@@ -1,5 +1,5 @@
#include "mdaOverdrive.h"
-
+
#include <math.h>
@@ -10,16 +10,16 @@ AudioEffect *createEffectInstance(audioMasterCallback audioMaster)
mdaOverdrive::mdaOverdrive(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, 1, 3) // 1 program, 3 parameters
{
- fParam1 = 0.0f;
+ fParam1 = 0.0f;
fParam2 = 0.0f;
fParam3 = 0.5f;
- setNumInputs(2);
- setNumOutputs(2);
+ setNumInputs(2);
+ setNumOutputs(2);
setUniqueID("mdaOverdrive"); // identify
- DECLARE_LVZ_DEPRECATED(canMono) ();
- canProcessReplacing();
- strcpy(programName, "Soft Overdrive");
+ DECLARE_LVZ_DEPRECATED(canMono) ();
+ canProcessReplacing();
+ strcpy(programName, "Soft Overdrive");
filt1 = filt2 = 0.0f;
setParameter(0, 0.0f);
@@ -90,7 +90,7 @@ void mdaOverdrive::getParameterDisplay(LvzInt32 index, char *text)
case 1: long2string((long)(100 * fParam2 ), text); break;
case 2: long2string((long)( 40 * fParam3 - 20), text); break;
}
-
+
}
void mdaOverdrive::getParameterLabel(LvzInt32 index, char *label)
@@ -99,7 +99,7 @@ void mdaOverdrive::getParameterLabel(LvzInt32 index, char *label)
{
case 0: strcpy(label, "%"); break;
case 1: strcpy(label, "%"); break;
- case 2: strcpy(label, "dB"); break;
+ case 2: strcpy(label, "dB"); break;
}
}
@@ -116,7 +116,7 @@ void mdaOverdrive::process(float **inputs, float **outputs, LvzInt32 sampleFrame
float i=fParam1, g=gain, aa, bb;
float f=filt, fa=filt1, fb=filt2;
- --in1;
+ --in1;
--in2;
--out1;
--out2;
@@ -124,19 +124,19 @@ void mdaOverdrive::process(float **inputs, float **outputs, LvzInt32 sampleFrame
{
a = *++in1;
b = *++in2;
-
+
c = out1[1];
d = out2[1];
aa = (a>0.0f)? (float)sqrt(a) : (float)-sqrt(-a); //overdrive
- bb = (b>0.0f)? (float)sqrt(b) : (float)-sqrt(-b);
+ bb = (b>0.0f)? (float)sqrt(b) : (float)-sqrt(-b);
- fa = fa + f * (i*(aa-a) + a - fa); //filter
- fb = fb + f * (i*(bb-b) + b - fb);
+ fa = fa + f * (i*(aa-a) + a - fa); //filter
+ fb = fb + f * (i*(bb-b) + b - fb);
- c += fa * g;
+ c += fa * g;
d += fb * g;
-
+
*++out1 = c;
*++out2 = d;
}
@@ -153,26 +153,26 @@ void mdaOverdrive::processReplacing(float **inputs, float **outputs, LvzInt32 sa
float a, b, c, d;
float i=fParam1, g=gain, aa, bb;
float f=filt, fa=filt1, fb=filt2;
-
- --in1;
+
+ --in1;
--in2;
--out1;
--out2;
while(--sampleFrames >= 0)
{
- a = *++in1;
+ a = *++in1;
b = *++in2;
-
+
aa = (a>0.0f)? (float)sqrt(a) : (float)-sqrt(-a); //overdrive
- bb = (b>0.0f)? (float)sqrt(b) : (float)-sqrt(-b);
+ bb = (b>0.0f)? (float)sqrt(b) : (float)-sqrt(-b);
- fa = fa + f * (i*(aa-a) + a - fa); //filter
- fb = fb + f * (i*(bb-b) + b - fb);
+ fa = fa + f * (i*(aa-a) + a - fa); //filter
+ fb = fb + f * (i*(bb-b) + b - fb);
- c = fa * g;
+ c = fa * g;
d = fb * g;
- *++out1 = c;
+ *++out1 = c;
*++out2 = d;
}
if(fabs(fa)>1.0e-10) filt1 = fa; else filt1 = 0.0f; //catch denormals