mirror of
https://codeberg.org/armin/gelyk.git
synced 2026-10-11 17:01:53 +02:00
Add per-band frequency control and static EQ curve overlay
This commit is contained in:
parent
10feb7a7fe
commit
8e9eb733cb
5 changed files with 172 additions and 11 deletions
|
|
@ -23,6 +23,13 @@ juce::AudioProcessorValueTreeState::ParameterLayout createParameterLayout()
|
|||
id, name, juce::NormalisableRange<float>(0.1f, 6.0f, 0.01f), def));
|
||||
};
|
||||
|
||||
auto addFreq = [&](juce::String id, juce::String name, float def)
|
||||
{
|
||||
auto range = juce::NormalisableRange<float>(20.0f, 20000.0f, 0.5f);
|
||||
range.setSkewForCentre(1000.0f);
|
||||
layout.add(std::make_unique<juce::AudioParameterFloat>(id, name, range, def));
|
||||
};
|
||||
|
||||
addGain("gain0", "Low Shelf Gain", 0.0f);
|
||||
addGain("gain1", "Low Gain", 0.0f);
|
||||
addGain("gain2", "Low-Mid Gain", 0.0f);
|
||||
|
|
@ -39,6 +46,14 @@ juce::AudioProcessorValueTreeState::ParameterLayout createParameterLayout()
|
|||
addQ("q5", "High Q", 1.0f);
|
||||
addQ("q6", "High Shelf Q", 0.71f);
|
||||
|
||||
addFreq("freq0", "Low Shelf Freq", 60.0f);
|
||||
addFreq("freq1", "Low Freq", 160.0f);
|
||||
addFreq("freq2", "Low-Mid Freq", 400.0f);
|
||||
addFreq("freq3", "Mid Freq", 800.0f);
|
||||
addFreq("freq4", "High-Mid Freq", 1600.0f);
|
||||
addFreq("freq5", "High Freq", 4000.0f);
|
||||
addFreq("freq6", "High Shelf Freq", 10000.0f);
|
||||
|
||||
layout.add(std::make_unique<juce::AudioParameterFloat>(
|
||||
"master", "Master", juce::NormalisableRange<float>(-24.0f, 24.0f, 0.01f), 0.0f));
|
||||
|
||||
|
|
@ -125,10 +140,14 @@ void GelykEQAudioProcessor::processBlock(juce::AudioBuffer<float>& buffer, juce:
|
|||
{
|
||||
float gain = apvts.getRawParameterValue("gain" + juce::String(i))->load();
|
||||
float q = apvts.getRawParameterValue("q" + juce::String(i))->load();
|
||||
if (std::abs(gain - bands[i].gainDb) > 0.001f || std::abs(q - bands[i].q) > 0.001f)
|
||||
float freq = apvts.getRawParameterValue("freq" + juce::String(i))->load();
|
||||
if (std::abs(gain - bands[i].gainDb) > 0.001f ||
|
||||
std::abs(q - bands[i].q) > 0.001f ||
|
||||
std::abs(freq - bands[i].freq) > 0.5f)
|
||||
{
|
||||
bands[i].gainDb = gain;
|
||||
bands[i].q = q;
|
||||
bands[i].freq = freq;
|
||||
bands[i].prepare(currentSampleRate, numSamples);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue