Fix rotary knob fader curve mapping functions, lower highpass frequency

in DSP
This commit is contained in:
Armin 2026-07-17 15:26:06 +02:00
commit 8c0f55f1e7
4 changed files with 9 additions and 3 deletions

View file

@ -21,7 +21,7 @@ public:
}
void setCoefficients(float cutoff, float res, FilterType type) {
cutoff = std::clamp(cutoff, 50.0f, static_cast<float>(sampleRate * 0.49));
cutoff = std::clamp(cutoff, 20.0f, static_cast<float>(sampleRate * 0.49));
resonance = std::clamp(res, 0.0f, 1.0f);
filterType = type;

View file

@ -139,7 +139,7 @@ public:
if (lfo2Depth > 0.001f && lfo2Dest == LFODest::FilterCutoff)
modCutoff *= std::pow(2.0f, lfo2Out * 4.0f);
modCutoff = std::clamp(modCutoff, 50.0f, static_cast<float>(getSampleRate() * 0.49));
modCutoff = std::clamp(modCutoff, 20.0f, static_cast<float>(getSampleRate() * 0.49));
filter.setCoefficients(modCutoff, filterResonance, filterType);
filterR.setCoefficients(modCutoff, filterResonance, filterType);

View file

@ -513,6 +513,7 @@ MainContentComponent::MainContentComponent(ChromaFlockProcessor& p)
setupLabel(filterLabel, "FILTER");
setupCB(filterTypeBox, filterTypeAttach, "filterType", {"LP 12dB", "LP 24dB", "Band Pass", "High Pass", "Notch"});
setupParam(filterCutoffKnob, filterCutoffAttach, "filterCutoff", "CUTOFF");
filterCutoffKnob.setNumDecimalPlacesToDisplay(1);
setupParam(filterResKnob, filterResAttach, "filterRes", "RES");
setupParam(filterEnvAmtKnob, filterEnvAmtAttach, "filterEnvAmt", "ENV AMT");
setupParam(keyTrackKnob, keyTrackAttach, "keyTrack", "KEY TRK");

View file

@ -94,7 +94,12 @@ juce::AudioProcessorValueTreeState::ParameterLayout ChromaFlockProcessor::create
juce::StringArray{"LP 12dB", "LP 24dB", "Band Pass", "High Pass", "Notch"}, 0));
layout.add(std::make_unique<juce::AudioParameterFloat>(
juce::ParameterID{"filterCutoff", 1}, "Filter Cutoff",
juce::NormalisableRange<float>(50.0f, 20000.0f, 0.1f, 0.25f), 8000.0f));
juce::NormalisableRange<float>(
20.0f, 20000.0f,
[](float start, float end, float n) { return start * std::pow(end / start, n); },
[](float start, float end, float v) { return std::log(v / start) / std::log(end / start); },
[](float, float, float v) { return v; }),
8000.0f));
layout.add(std::make_unique<juce::AudioParameterFloat>(
juce::ParameterID{"filterRes", 1}, "Filter Resonance", zeroOne, 0.2f));
layout.add(std::make_unique<juce::AudioParameterFloat>(