Skip to content

Commit

Permalink
ZamEQ2: Adjust ranges on controls to be similar to SSL 9000 strip
Browse files Browse the repository at this point in the history
  • Loading branch information
zamaudio committed Apr 28, 2024
1 parent f087f9f commit 3be5519
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 55 deletions.
80 changes: 40 additions & 40 deletions plugins/ZamEQ2/ZamEQ2Plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,61 +41,61 @@ void ZamEQ2Plugin::initParameter(uint32_t index, Parameter& parameter)
parameter.symbol = "boost1";
parameter.unit = "dB";
parameter.ranges.def = 0.0f;
parameter.ranges.min = -50.0f;
parameter.ranges.min = -20.0f;
parameter.ranges.max = 20.0f;
break;
case paramQ1:
parameter.hints = kParameterIsAutomatable | kParameterIsLogarithmic;
parameter.name = "Bandwidth 1";
parameter.symbol = "bw1";
parameter.unit = " ";
parameter.ranges.def = 1.0f;
parameter.ranges.min = 0.1f;
parameter.ranges.max = 6.0f;
parameter.ranges.def = 1.5f;
parameter.ranges.min = 0.7f;
parameter.ranges.max = 2.5f;
break;
case paramFreq1:
parameter.hints = kParameterIsAutomatable | kParameterIsLogarithmic;
parameter.name = "Frequency 1";
parameter.symbol = "f1";
parameter.unit = "Hz";
parameter.ranges.def = 500.0f;
parameter.ranges.min = 20.0f;
parameter.ranges.max = 14000.0f;
parameter.ranges.def = 200.0f;
parameter.ranges.min = 1000.0f;
parameter.ranges.max = 2500.0f;
break;
case paramGain2:
parameter.hints = kParameterIsAutomatable;
parameter.name = "Boost/Cut 2";
parameter.symbol = "boost2";
parameter.unit = "dB";
parameter.ranges.def = 0.0f;
parameter.ranges.min = -50.0f;
parameter.ranges.min = -20.0f;
parameter.ranges.max = 20.0f;
break;
case paramQ2:
parameter.hints = kParameterIsAutomatable | kParameterIsLogarithmic;
parameter.name = "Bandwidth 2";
parameter.symbol = "bw2";
parameter.unit = " ";
parameter.ranges.def = 1.0f;
parameter.ranges.min = 0.1f;
parameter.ranges.max = 6.0f;
parameter.ranges.def = 1.5f;
parameter.ranges.min = 0.7f;
parameter.ranges.max = 2.5f;
break;
case paramFreq2:
parameter.hints = kParameterIsAutomatable | kParameterIsLogarithmic;
parameter.name = "Frequency 2";
parameter.symbol = "f2";
parameter.unit = "Hz";
parameter.ranges.def = 3000.0f;
parameter.ranges.min = 20.0f;
parameter.ranges.max = 14000.0f;
parameter.ranges.min = 600.0f;
parameter.ranges.max = 7000.0f;
break;
case paramGainL:
parameter.hints = kParameterIsAutomatable;
parameter.name = "Boost/Cut L";
parameter.symbol = "boostl";
parameter.unit = "dB";
parameter.ranges.def = 0.0f;
parameter.ranges.min = -50.0f;
parameter.ranges.min = -20.0f;
parameter.ranges.max = 20.0f;
break;
case paramFreqL:
Expand All @@ -104,16 +104,16 @@ void ZamEQ2Plugin::initParameter(uint32_t index, Parameter& parameter)
parameter.symbol = "fl";
parameter.unit = "Hz";
parameter.ranges.def = 250.0f;
parameter.ranges.min = 20.0f;
parameter.ranges.max = 14000.0f;
parameter.ranges.min = 40.0f;
parameter.ranges.max = 600.0f;
break;
case paramGainH:
parameter.hints = kParameterIsAutomatable;
parameter.name = "Boost/Cut H";
parameter.symbol = "boosth";
parameter.unit = "dB";
parameter.ranges.def = 0.0f;
parameter.ranges.min = -50.0f;
parameter.ranges.min = -20.0f;
parameter.ranges.max = 20.0f;
break;
case paramFreqH:
Expand All @@ -122,26 +122,26 @@ void ZamEQ2Plugin::initParameter(uint32_t index, Parameter& parameter)
parameter.symbol = "fh";
parameter.unit = "Hz";
parameter.ranges.def = 8000.0f;
parameter.ranges.min = 20.0f;
parameter.ranges.max = 14000.0f;
parameter.ranges.min = 1500.0f;
parameter.ranges.max = 22000.0f;
break;
case paramMaster:
parameter.hints = kParameterIsAutomatable;
parameter.name = "Master Gain";
parameter.symbol = "master";
parameter.name = "Output gain";
parameter.symbol = "outputgain";
parameter.unit = "dB";
parameter.ranges.def = 0.0f;
parameter.ranges.min = -12.0f;
parameter.ranges.max = 12.0f;
parameter.ranges.min = -10.0f;
parameter.ranges.max = 10.0f;
break;
case paramTogglePeaks:
parameter.hints = kParameterIsAutomatable | kParameterIsBoolean;
parameter.name = "Peaks ON";
parameter.symbol = "peaks";
case paramInputGain:
parameter.hints = kParameterIsAutomatable;
parameter.name = "Input gain";
parameter.symbol = "inputgain";
parameter.unit = " ";
parameter.ranges.def = 0.0f;
parameter.ranges.min = 0.0f;
parameter.ranges.max = 1.0f;
parameter.ranges.min = -10.0f;
parameter.ranges.max = 10.0f;
break;
}
}
Expand Down Expand Up @@ -179,7 +179,7 @@ void ZamEQ2Plugin::loadProgram(uint32_t index)
gainh = 0.0;
freqh = 8000.0;
master = 0.0;
togglepeaks = 0.0;
inputgain = 0.0;
break;
case 1:
gain1 = 0.0;
Expand All @@ -193,7 +193,7 @@ void ZamEQ2Plugin::loadProgram(uint32_t index)
gainh = 0.0;
freqh = 8000.0;
master = -6.0;
togglepeaks = 0.0;
inputgain = 0.0;
break;
case 2:
gain1 = 5.6;
Expand All @@ -207,7 +207,7 @@ void ZamEQ2Plugin::loadProgram(uint32_t index)
gainh = 0.0;
freqh = 8000.0;
master = -6.0;
togglepeaks = 0.0;
inputgain = 0.0;
break;
case 3:
gain1 = 0.0;
Expand All @@ -221,7 +221,7 @@ void ZamEQ2Plugin::loadProgram(uint32_t index)
gainh = 6.0;
freqh = 330.0;
master = -12.0;
togglepeaks = 0.0;
inputgain = 0.0;
break;
}
/* reset filter values */
Expand Down Expand Up @@ -268,8 +268,8 @@ float ZamEQ2Plugin::getParameterValue(uint32_t index) const
case paramMaster:
return master;
break;
case paramTogglePeaks:
return togglepeaks;
case paramInputGain:
return inputgain;
break;
default:
return 0.0f;
Expand Down Expand Up @@ -313,8 +313,8 @@ void ZamEQ2Plugin::setParameterValue(uint32_t index, float value)
case paramMaster:
master = value;
break;
case paramTogglePeaks:
togglepeaks = value;
case paramInputGain:
inputgain = value;
break;
}
}
Expand Down Expand Up @@ -457,7 +457,7 @@ void ZamEQ2Plugin::run(const float** inputs, float** outputs, uint32_t frames)

for (uint32_t i = 0; i < frames; i++) {
double tmp,tmpl, tmph;
double in = inputs[0][i];
double in = inputs[0][i] * from_dB(inputgain);
x1 = sanitize_denormal(x1);
x2 = sanitize_denormal(x2);
y1 = sanitize_denormal(y1);
Expand Down Expand Up @@ -511,8 +511,8 @@ void ZamEQ2Plugin::run(const float** inputs, float** outputs, uint32_t frames)
y2a = y1a;
x1a = tmp;
y1a = outputs[0][i];

outputs[0][i] *= from_dB(master);
outputs[0][i] *= from_dB(master);
}
}

Expand Down
4 changes: 2 additions & 2 deletions plugins/ZamEQ2/ZamEQ2Plugin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ZamEQ2Plugin : public Plugin
paramGainH,
paramFreqH,
paramMaster,
paramTogglePeaks,
paramInputGain,
paramCount
};

Expand Down Expand Up @@ -134,7 +134,7 @@ class ZamEQ2Plugin : public Plugin
// -------------------------------------------------------------------

private:
float gain1,q1,freq1,gain2,q2,freq2,gainl,freql,gainh,freqh,master,togglepeaks; //parameters
float gain1,q1,freq1,gain2,q2,freq2,gainl,freql,gainh,freqh,master,inputgain; //parameters
double x1,x2,y1,y2;
double x1a,x2a,y1a,y2a;
double zln1,zln2,zld1,zld2;
Expand Down
26 changes: 13 additions & 13 deletions plugins/ZamEQ2/ZamEQ2UI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ZamEQ2UI::ZamEQ2UI()
// knob
fKnobGain1 = new ZamKnob(this, knobImage);
fKnobGain1->setAbsolutePos(91, 172);
fKnobGain1->setRange(-50.f, 20.0f);
fKnobGain1->setRange(-20.f, 20.0f);
fKnobGain1->setLabel(true);
fKnobGain1->setScrollStep(1.0f);
fKnobGain1->setRotationAngle(240);
Expand All @@ -47,26 +47,26 @@ ZamEQ2UI::ZamEQ2UI()

fKnobQ1 = new ZamKnob(this, knobImage);
fKnobQ1->setAbsolutePos(91, 122);
fKnobQ1->setRange(0.1f, 6.0f);
fKnobQ1->setRange(0.7f, 2.5f);
fKnobQ1->setLabel(true);
fKnobQ1->setScrollStep(0.1f);
fKnobQ1->setRotationAngle(240);
fKnobQ1->setDefault(1.0f);
fKnobQ1->setDefault(1.5f);
fKnobQ1->setCallback(this);

fKnobFreq1 = new ZamKnob(this, knobImage);
fKnobFreq1->setAbsolutePos(23, 144);
fKnobFreq1->setUsingLogScale(true);
fKnobFreq1->setRange(20.f, 14000.0f);
fKnobFreq1->setRange(200.f, 2500.0f);
fKnobFreq1->setLabel(true);
fKnobFreq1->setScrollStep(10.f);
fKnobFreq1->setRotationAngle(240);
fKnobFreq1->setDefault(500.0f);
fKnobFreq1->setDefault(1000.0f);
fKnobFreq1->setCallback(this);

fKnobGain2 = new ZamKnob(this, knobImage);
fKnobGain2->setAbsolutePos(567, 172);
fKnobGain2->setRange(-50.f, 20.0f);
fKnobGain2->setRange(-20.f, 20.0f);
fKnobGain2->setLabel(true);
fKnobGain2->setScrollStep(1.f);
fKnobGain2->setRotationAngle(240);
Expand All @@ -75,17 +75,17 @@ ZamEQ2UI::ZamEQ2UI()

fKnobQ2 = new ZamKnob(this, knobImage);
fKnobQ2->setAbsolutePos(567, 122);
fKnobQ2->setRange(0.1f, 6.0f);
fKnobQ2->setRange(0.7f, 2.5f);
fKnobQ2->setLabel(true);
fKnobQ2->setScrollStep(0.1f);
fKnobQ2->setRotationAngle(240);
fKnobQ2->setDefault(1.0f);
fKnobQ2->setDefault(1.5f);
fKnobQ2->setCallback(this);

fKnobFreq2 = new ZamKnob(this, knobImage);
fKnobFreq2->setAbsolutePos(499, 144);
fKnobFreq2->setUsingLogScale(true);
fKnobFreq2->setRange(20.f, 14000.0f);
fKnobFreq2->setRange(600.f, 7000.0f);
fKnobFreq2->setLabel(true);
fKnobFreq2->setScrollStep(10.f);
fKnobFreq2->setRotationAngle(240);
Expand All @@ -94,7 +94,7 @@ ZamEQ2UI::ZamEQ2UI()

fKnobGainL = new ZamKnob(this, knobImage);
fKnobGainL->setAbsolutePos(91, 52);
fKnobGainL->setRange(-50.f, 20.0f);
fKnobGainL->setRange(-20.f, 20.0f);
fKnobGainL->setLabel(true);
fKnobGainL->setScrollStep(1.f);
fKnobGainL->setRotationAngle(240);
Expand All @@ -104,7 +104,7 @@ ZamEQ2UI::ZamEQ2UI()
fKnobFreqL = new ZamKnob(this, knobImage);
fKnobFreqL->setAbsolutePos(23, 23);
fKnobFreqL->setUsingLogScale(true);
fKnobFreqL->setRange(20.f, 14000.0f);
fKnobFreqL->setRange(40.f, 600.0f);
fKnobFreqL->setLabel(true);
fKnobFreqL->setScrollStep(10.f);
fKnobFreqL->setRotationAngle(240);
Expand All @@ -113,7 +113,7 @@ ZamEQ2UI::ZamEQ2UI()

fKnobGainH = new ZamKnob(this, knobImage);
fKnobGainH->setAbsolutePos(567, 53);
fKnobGainH->setRange(-50.f, 20.0f);
fKnobGainH->setRange(-20.f, 20.0f);
fKnobGainH->setLabel(true);
fKnobGainH->setScrollStep(1.f);
fKnobGainH->setRotationAngle(240);
Expand All @@ -123,7 +123,7 @@ ZamEQ2UI::ZamEQ2UI()
fKnobFreqH = new ZamKnob(this, knobImage);
fKnobFreqH->setAbsolutePos(499, 24);
fKnobFreqH->setUsingLogScale(true);
fKnobFreqH->setRange(20.f, 14000.0f);
fKnobFreqH->setRange(1500.f, 22000.0f);
fKnobFreqH->setLabel(true);
fKnobFreqH->setScrollStep(10.f);
fKnobFreqH->setRotationAngle(240);
Expand Down

0 comments on commit 3be5519

Please sign in to comment.