mirror of
https://codeberg.org/armin/chromaflock.git
synced 2026-09-01 04:10:47 +02:00
Filter cutoff: range 50-20000 Hz, 0.1 step for smooth knob, default 8000 Hz
This commit is contained in:
parent
68e023d08d
commit
1a7ef69d34
3 changed files with 4 additions and 4 deletions
|
|
@ -21,7 +21,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void setCoefficients(float cutoff, float res, FilterType type) {
|
void setCoefficients(float cutoff, float res, FilterType type) {
|
||||||
cutoff = std::clamp(cutoff, 20.0f, static_cast<float>(sampleRate * 0.49));
|
cutoff = std::clamp(cutoff, 50.0f, static_cast<float>(sampleRate * 0.49));
|
||||||
resonance = std::clamp(res, 0.0f, 1.0f);
|
resonance = std::clamp(res, 0.0f, 1.0f);
|
||||||
filterType = type;
|
filterType = type;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ public:
|
||||||
if (lfo2Depth > 0.001f && lfo2Dest == LFODest::FilterCutoff)
|
if (lfo2Depth > 0.001f && lfo2Dest == LFODest::FilterCutoff)
|
||||||
modCutoff *= std::pow(2.0f, lfo2Out * 4.0f);
|
modCutoff *= std::pow(2.0f, lfo2Out * 4.0f);
|
||||||
|
|
||||||
modCutoff = std::clamp(modCutoff, 20.0f, static_cast<float>(getSampleRate() * 0.49));
|
modCutoff = std::clamp(modCutoff, 50.0f, static_cast<float>(getSampleRate() * 0.49));
|
||||||
|
|
||||||
filter.setCoefficients(modCutoff, filterResonance, filterType);
|
filter.setCoefficients(modCutoff, filterResonance, filterType);
|
||||||
filterR.setCoefficients(modCutoff, filterResonance, filterType);
|
filterR.setCoefficients(modCutoff, filterResonance, filterType);
|
||||||
|
|
@ -211,7 +211,7 @@ private:
|
||||||
float semitone1 = 0.0f, semitone2 = 0.0f;
|
float semitone1 = 0.0f, semitone2 = 0.0f;
|
||||||
float fineTune1 = 0.0f, fineTune2 = 7.0f;
|
float fineTune1 = 0.0f, fineTune2 = 7.0f;
|
||||||
float phaseOffset2 = 0.5f;
|
float phaseOffset2 = 0.5f;
|
||||||
float filterCutoff = 800.0f;
|
float filterCutoff = 8000.0f;
|
||||||
float filterResonance = 0.7f;
|
float filterResonance = 0.7f;
|
||||||
FilterType filterType = FilterType::LowPass12;
|
FilterType filterType = FilterType::LowPass12;
|
||||||
float filterEnvAmount = 0.0f;
|
float filterEnvAmount = 0.0f;
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ juce::AudioProcessorValueTreeState::ParameterLayout ChromaFlockProcessor::create
|
||||||
juce::StringArray{"LP 12dB", "LP 24dB", "Band Pass", "High Pass", "Notch"}, 0));
|
juce::StringArray{"LP 12dB", "LP 24dB", "Band Pass", "High Pass", "Notch"}, 0));
|
||||||
layout.add(std::make_unique<juce::AudioParameterFloat>(
|
layout.add(std::make_unique<juce::AudioParameterFloat>(
|
||||||
juce::ParameterID{"filterCutoff", 1}, "Filter Cutoff",
|
juce::ParameterID{"filterCutoff", 1}, "Filter Cutoff",
|
||||||
juce::NormalisableRange<float>(25.0f, 1200.0f, 1.0f, 0.25f), 800.0f));
|
juce::NormalisableRange<float>(50.0f, 20000.0f, 0.1f, 0.25f), 8000.0f));
|
||||||
layout.add(std::make_unique<juce::AudioParameterFloat>(
|
layout.add(std::make_unique<juce::AudioParameterFloat>(
|
||||||
juce::ParameterID{"filterRes", 1}, "Filter Resonance", zeroOne, 0.7f));
|
juce::ParameterID{"filterRes", 1}, "Filter Resonance", zeroOne, 0.7f));
|
||||||
layout.add(std::make_unique<juce::AudioParameterFloat>(
|
layout.add(std::make_unique<juce::AudioParameterFloat>(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue