diff options
author | David Robillard <d@drobilla.net> | 2012-04-21 22:35:41 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-04-21 22:35:41 +0000 |
commit | 337a13119180bf7fa6996d6c23962c31ea53db54 (patch) | |
tree | 7427f9be36a29978712c17399f7418e8f9d18425 /src/mdaMultiBand.cpp | |
parent | 3ff557d9e3ea5b36f0ca6eccfc587dc335ed5e8d (diff) | |
download | mda.lv2-337a13119180bf7fa6996d6c23962c31ea53db54.tar.gz mda.lv2-337a13119180bf7fa6996d6c23962c31ea53db54.tar.bz2 mda.lv2-337a13119180bf7fa6996d6c23962c31ea53db54.zip |
MDA-LV2 1.0.0v1.0.0
git-svn-id: http://svn.drobilla.net/lad/tags/mda-lv2-1.0.0@4223 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/mdaMultiBand.cpp')
-rw-r--r-- | src/mdaMultiBand.cpp | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/mdaMultiBand.cpp b/src/mdaMultiBand.cpp index 9998148..984e3b4 100644 --- a/src/mdaMultiBand.cpp +++ b/src/mdaMultiBand.cpp @@ -41,7 +41,7 @@ mdaMultiBand::mdaMultiBand(audioMasterCallback audioMaster) : AudioEffectX(audio fParam10 = (float)0.22; //attack (3) fParam11 = (float)0.602; //release (4) fParam12 = (float)0.55; //width - fParam13 = (float)0.40; //MS swap + fParam13 = (float)0.00; //MS swap /* fParam1 = (float)1.00; //Listen: L/M/H/out fParam2 = (float)0.50; //xover1 fParam3 = (float)0.50; //xover2 @@ -85,17 +85,16 @@ mdaMultiBand::mdaMultiBand(audioMasterCallback audioMaster) : AudioEffectX(audio att3 = (float)pow(10.0, -0.05 -(1.5 * fParam10)); rel3 = (float)pow(10.0, -2.0 - (2.5 * fParam11)); - switch(int(fParam1*10.0)) + switch(int(fParam1*3.9)) { case 0: trim2=0.0; trim3=0.0; slev=0.0; break; - case 1: - case 2: trim1=0.0; trim3=0.0; slev=0.0; break; - case 3: - case 4: trim1=0.0; trim2=0.0; slev=0.0; break; + case 1: trim1=0.0; trim3=0.0; slev=0.0; break; + case 2: trim1=0.0; trim2=0.0; slev=0.0; break; default: slev=fParam12; break; } fi1 = (float)pow(10.0,fParam2 - 1.70); fo1=(float)(1.0 - fi1); fi2 = (float)pow(10.0,fParam3 - 1.05); fo2=(float)(1.0 - fi2); + fb1 = fb2 = fb3 = 0.0f; mswap = 0; } @@ -165,19 +164,17 @@ void mdaMultiBand::setParameter(int32_t index, float value) att3 = (float)pow(10.0, -0.05 -(1.5 * fParam10)); rel3 = (float)pow(10.0, -2.0 - (2.5 * fParam11)); - switch(int(fParam1*10.0)) + switch(int(fParam1*3.9)) { case 0: trim2=0.0; trim3=0.0; slev=0.0; break; - case 1: - case 2: trim1=0.0; trim3=0.0; slev=0.0; break; - case 3: - case 4: trim1=0.0; trim2=0.0; slev=0.0; break; + case 1: trim1=0.0; trim3=0.0; slev=0.0; break; + case 2: trim1=0.0; trim2=0.0; slev=0.0; break; default: slev=fParam12; break; } fi1 = (float)pow(10.0,fParam2 - 1.70); fo1=(float)(1.0 - fi1); fi2 = (float)pow(10.0,fParam3 - 1.05); fo2=(float)(1.0 - fi2); - if(fParam13>0.5) mswap=1; else mswap=0; + if(fParam13>0.0) mswap=1; else mswap=0; } float mdaMultiBand::getParameter(int32_t index) @@ -230,10 +227,10 @@ void mdaMultiBand::getParameterDisplay(int32_t index, char *text) { switch(index) { - case 0: switch(int(fParam1*10.0)) + case 0: switch(int(fParam1*3.9)) { case 0: strcpy(text, "Low"); break; - case 1: case 2: strcpy(text, "Mid"); break; - case 3: case 4: strcpy(text, "High"); break; + case 1: strcpy(text, "Mid"); break; + case 2: strcpy(text, "High"); break; default: strcpy(text, "Output"); break; } break; case 1: int2strng((int32_t)(getSampleRate() * fi1 * (0.098 + 0.09*fi1 + 0.5*(float)pow(fi1,8.2f))), text); break; case 2: int2strng((int32_t)(getSampleRate() * fi2 * (0.015 + 0.15*fi2 + 0.9*(float)pow(fi2,8.2f))), text); break; |