diff options
Diffstat (limited to 'src/mdaBandisto.cpp')
-rw-r--r-- | src/mdaBandisto.cpp | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/src/mdaBandisto.cpp b/src/mdaBandisto.cpp index 2da3d9a..c4e4cee 100644 --- a/src/mdaBandisto.cpp +++ b/src/mdaBandisto.cpp @@ -23,11 +23,11 @@ mdaBandisto::mdaBandisto(audioMasterCallback audioMaster) : AudioEffectX(audioMa fParam9 = (float)0.50; //H trim fParam10 = (float)0.4; //transistor/valve - setNumInputs(2); - setNumOutputs(2); + setNumInputs(2); + setNumOutputs(2); setUniqueID("mdaBand"); // identify here - DECLARE_LVZ_DEPRECATED(canMono) (); - canProcessReplacing(); + DECLARE_LVZ_DEPRECATED(canMono) (); + canProcessReplacing(); strcpy(programName, "Multi-Band Distortion"); //calcs here! @@ -36,17 +36,17 @@ mdaBandisto::mdaBandisto(audioMasterCallback audioMaster) : AudioEffectX(audioMa driv3 = (float)pow(10.0,(6.0 * fParam6 *fParam6) - 1.0); valve = int(1.99 * fParam10); - if(valve) + if(valve) { - trim1 = (float)(0.5); - trim2 = (float)(0.5); - trim3 = (float)(0.5); + trim1 = (float)(0.5); + trim2 = (float)(0.5); + trim3 = (float)(0.5); } else { - trim1 = 0.3f*(float)pow(10.0,(4.0 * pow(fParam4,3.f)));//(0.5 + 500.0 * pow(fParam4,6.0)); - trim2 = 0.3f*(float)pow(10.0,(4.0 * pow(fParam5,3.f))); - trim3 = 0.3f*(float)pow(10.0,(4.0 * pow(fParam6,3.f))); + trim1 = 0.3f*(float)pow(10.0,(4.0 * pow(fParam4,3.f)));//(0.5 + 500.0 * pow(fParam4,6.0)); + trim2 = 0.3f*(float)pow(10.0,(4.0 * pow(fParam5,3.f))); + trim3 = 0.3f*(float)pow(10.0,(4.0 * pow(fParam6,3.f))); } trim1 = (float)(trim1 * pow(10.0, 2.0 * fParam7 - 1.0)); trim2 = (float)(trim2 * pow(10.0, 2.0 * fParam8 - 1.0)); @@ -65,7 +65,7 @@ mdaBandisto::mdaBandisto(audioMasterCallback audioMaster) : AudioEffectX(audioMa mdaBandisto::~mdaBandisto() { - + } bool mdaBandisto::getProductString(char* text) { strcpy(text, "MDA Bandisto"); return true; } @@ -103,17 +103,17 @@ void mdaBandisto::setParameter(LvzInt32 index, float value) driv3 = (float)pow(10.0,(6.0 * fParam6 *fParam6) - 1.0); valve = int(1.99 * fParam10); - if(valve) + if(valve) { - trim1 = (float)(0.5); - trim2 = (float)(0.5); - trim3 = (float)(0.5); + trim1 = (float)(0.5); + trim2 = (float)(0.5); + trim3 = (float)(0.5); } else { - trim1 = 0.3f*(float)pow(10.0,(4.0 * pow(fParam4,3.f)));//(0.5 + 500.0 * pow(fParam4,6.0)); - trim2 = 0.3f*(float)pow(10.0,(4.0 * pow(fParam5,3.f))); - trim3 = 0.3f*(float)pow(10.0,(4.0 * pow(fParam6,3.f))); + trim1 = 0.3f*(float)pow(10.0,(4.0 * pow(fParam4,3.f)));//(0.5 + 500.0 * pow(fParam4,6.0)); + trim2 = 0.3f*(float)pow(10.0,(4.0 * pow(fParam5,3.f))); + trim3 = 0.3f*(float)pow(10.0,(4.0 * pow(fParam6,3.f))); } trim1 = (float)(trim1 * pow(10.0, 2.0 * fParam7 - 1.0)); trim2 = (float)(trim2 * pow(10.0, 2.0 * fParam8 - 1.0)); @@ -174,7 +174,7 @@ void mdaBandisto::getParameterDisplay(LvzInt32 index, char *text) case 0: switch(int(fParam1*5.0)) { case 0: strcpy(text, "Low"); break; case 1: strcpy(text, "Mid"); break; - case 2: strcpy(text, "High"); break; + case 2: strcpy(text, "High"); break; default: strcpy(text, "Output"); break; } break; case 1: sprintf(text, "%.0f", getSampleRate() * fi1 * (0.098 + 0.09*fi1 + 0.5*pow(fi1,8.2f))); break; case 2: sprintf(text, "%.0f", getSampleRate() * fi2 * (0.015 + 0.15*fi2 + 0.9*pow(fi2,8.2f))); break; @@ -184,7 +184,7 @@ void mdaBandisto::getParameterDisplay(LvzInt32 index, char *text) case 6: sprintf(text, "%.0f", 40.0 * fParam7 - 20.0); break; case 7: sprintf(text, "%.0f", 40.0 * fParam8 - 20.0); break; case 8: sprintf(text, "%.0f", 40.0 * fParam9 - 20.0); break; - case 9: if(fParam10>0.5) { strcpy(text, "Unipolar"); } + case 9: if(fParam10>0.5) { strcpy(text, "Unipolar"); } else { strcpy(text, "Bipolar"); } break; } } @@ -195,14 +195,14 @@ void mdaBandisto::getParameterLabel(LvzInt32 index, char *label) { case 0: strcpy(label, ""); break; case 1: strcpy(label, "Hz"); break; - case 2: strcpy(label, "Hz"); break; - case 3: strcpy(label, "dB"); break; - case 4: strcpy(label, "dB"); break; - case 5: strcpy(label, "dB"); break; - case 6: strcpy(label, "dB"); break; - case 7: strcpy(label, "dB"); break; - case 8: strcpy(label, "dB"); break; - case 9: strcpy(label, ""); break; + case 2: strcpy(label, "Hz"); break; + case 3: strcpy(label, "dB"); break; + case 4: strcpy(label, "dB"); break; + case 5: strcpy(label, "dB"); break; + case 6: strcpy(label, "dB"); break; + case 7: strcpy(label, "dB"); break; + case 8: strcpy(label, "dB"); break; + case 9: strcpy(label, ""); break; } } @@ -215,28 +215,28 @@ void mdaBandisto::process(float **inputs, float **outputs, LvzInt32 sampleFrames float *in2 = inputs[1]; float *out1 = outputs[0]; float *out2 = outputs[1]; - float a, b, c, d, g, l=fb3, m, h, s, sl=slev; + float a, b, c, d, g, l=fb3, m, h, s, sl=slev; float f1i=fi1, f1o=fo1, f2i=fi2, f2o=fo2, b1=fb1, b2=fb2; float g1, d1=driv1, t1=trim1; float g2, d2=driv2, t2=trim2; float g3, d3=driv3, t3=trim3; int v=valve; - --in1; - --in2; + --in1; + --in2; --out1; --out2; while(--sampleFrames >= 0) { - a = *++in1; + a = *++in1; b = *++in2; c = out1[1]; d = out2[1]; //process from here... s = (a - b) * sl; //keep stereo component for later - a += (float)(b + 0.00002); //dope filter at low level + a += (float)(b + 0.00002); //dope filter at low level b2 = (f2i * a) + (f2o * b2); //crossovers - b1 = (f1i * b2) + (f1o * b1); + b1 = (f1i * b2) + (f1o * b1); l = (f1i * b1) + (f1o * l); m=b2-l; h=a-b2; @@ -257,8 +257,8 @@ void mdaBandisto::process(float **inputs, float **outputs, LvzInt32 sampleFrames a = (l*g1*t1) + (m*g2*t2) + (h*g3*t3); c += a + s; // output d += a - s; - - *++out1 = c; + + *++out1 = c; *++out2 = d; } fb1=b1; fb2=b2, fb3=l; @@ -270,26 +270,26 @@ void mdaBandisto::processReplacing(float **inputs, float **outputs, LvzInt32 sam float *in2 = inputs[1]; float *out1 = outputs[0]; float *out2 = outputs[1]; - float a, b, c, d, g, l=fb3, m, h, s, sl=slev; + float a, b, c, d, g, l=fb3, m, h, s, sl=slev; float f1i=fi1, f1o=fo1, f2i=fi2, f2o=fo2, b1=fb1, b2=fb2; float g1, d1=driv1, t1=trim1; float g2, d2=driv2, t2=trim2; float g3, d3=driv3, t3=trim3; int v=valve; - --in1; - --in2; + --in1; + --in2; --out1; --out2; while(--sampleFrames >= 0) { - a = *++in1; + a = *++in1; b = *++in2; //process from here... - + s = (a - b) * sl; //keep stereo component for later a += (float)(b + 0.00002); //dope filter at low level b2 = (f2i * a) + (f2o * b2); //crossovers - b1 = (f1i * b2) + (f1o * b1); + b1 = (f1i * b2) + (f1o * b1); l = (f1i * b1) + (f1o * l); m=b2-l; h=a-b2; @@ -310,7 +310,7 @@ void mdaBandisto::processReplacing(float **inputs, float **outputs, LvzInt32 sam a = (l*g1*t1) + (m*g2*t2) + (h*g3*t3); c = a + s; // output d = a - s; - + *++out1 = c; *++out2 = d; } |