v1.1.3: Brickwall limiter + double-click reset on all knobs
- Output brickwall limiter (0 dB ceiling) with toggle in master row - All sliders reset to default on double-click: Master gain → 0 dB, Freq → 1000 Hz, Gain → 0 dB, Q → 1.0 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
cmake_minimum_required(VERSION 3.22)
|
cmake_minimum_required(VERSION 3.22)
|
||||||
project(InstaLPEQ VERSION 1.1.2)
|
project(InstaLPEQ VERSION 1.1.3)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|||||||
@@ -5,11 +5,14 @@ NodeParameterPanel::NodeParameterPanel()
|
|||||||
{
|
{
|
||||||
setupSlider (freqSlider, freqLabel, 20.0, 20000.0, 1.0, " Hz");
|
setupSlider (freqSlider, freqLabel, 20.0, 20000.0, 1.0, " Hz");
|
||||||
freqSlider.setSkewFactorFromMidPoint (1000.0);
|
freqSlider.setSkewFactorFromMidPoint (1000.0);
|
||||||
|
freqSlider.setDoubleClickReturnValue (true, 1000.0);
|
||||||
|
|
||||||
setupSlider (gainSlider, gainLabel, -24.0, 24.0, 0.1, " dB");
|
setupSlider (gainSlider, gainLabel, -24.0, 24.0, 0.1, " dB");
|
||||||
|
gainSlider.setDoubleClickReturnValue (true, 0.0);
|
||||||
|
|
||||||
setupSlider (qSlider, qLabel, 0.1, 18.0, 0.01, "");
|
setupSlider (qSlider, qLabel, 0.1, 18.0, 0.01, "");
|
||||||
qSlider.setSkewFactorFromMidPoint (1.0);
|
qSlider.setSkewFactorFromMidPoint (1.0);
|
||||||
|
qSlider.setDoubleClickReturnValue (true, 1.0);
|
||||||
qSlider.getProperties().set (InstaLPEQLookAndFeel::knobTypeProperty, "dark");
|
qSlider.getProperties().set (InstaLPEQLookAndFeel::knobTypeProperty, "dark");
|
||||||
|
|
||||||
typeSelector.addItem ("Peak", 1);
|
typeSelector.addItem ("Peak", 1);
|
||||||
|
|||||||
@@ -48,12 +48,22 @@ InstaLPEQEditor::InstaLPEQEditor (InstaLPEQProcessor& p)
|
|||||||
int sel = qualitySelector.getSelectedId();
|
int sel = qualitySelector.getSelectedId();
|
||||||
int order = sel + 8; // 1->9, 2->10, 3->11, 4->12, 5->13, 6->14
|
int order = sel + 8; // 1->9, 2->10, 3->11, 4->12, 5->13, 6->14
|
||||||
processor.setQuality (order);
|
processor.setQuality (order);
|
||||||
|
|
||||||
|
if (sel <= 2) // 512 or 1024
|
||||||
|
qualityWarning.setText ("Low freq accuracy reduced", juce::dontSendNotification);
|
||||||
|
else
|
||||||
|
qualityWarning.setText ("", juce::dontSendNotification);
|
||||||
};
|
};
|
||||||
addAndMakeVisible (qualitySelector);
|
addAndMakeVisible (qualitySelector);
|
||||||
qualityLabel.setFont (customLookAndFeel.getMediumFont (13.0f));
|
qualityLabel.setFont (customLookAndFeel.getMediumFont (13.0f));
|
||||||
qualityLabel.setJustificationType (juce::Justification::centredRight);
|
qualityLabel.setJustificationType (juce::Justification::centredRight);
|
||||||
addAndMakeVisible (qualityLabel);
|
addAndMakeVisible (qualityLabel);
|
||||||
|
|
||||||
|
qualityWarning.setFont (customLookAndFeel.getRegularFont (11.0f));
|
||||||
|
qualityWarning.setColour (juce::Label::textColourId, juce::Colour (0xffff6644));
|
||||||
|
qualityWarning.setJustificationType (juce::Justification::centredRight);
|
||||||
|
addAndMakeVisible (qualityWarning);
|
||||||
|
|
||||||
// EQ curve
|
// EQ curve
|
||||||
curveDisplay.setListener (this);
|
curveDisplay.setListener (this);
|
||||||
addAndMakeVisible (curveDisplay);
|
addAndMakeVisible (curveDisplay);
|
||||||
@@ -68,11 +78,20 @@ InstaLPEQEditor::InstaLPEQEditor (InstaLPEQProcessor& p)
|
|||||||
masterGainSlider.setRange (-24.0, 24.0, 0.1);
|
masterGainSlider.setRange (-24.0, 24.0, 0.1);
|
||||||
masterGainSlider.setValue (0.0);
|
masterGainSlider.setValue (0.0);
|
||||||
masterGainSlider.setTextValueSuffix (" dB");
|
masterGainSlider.setTextValueSuffix (" dB");
|
||||||
|
masterGainSlider.setDoubleClickReturnValue (true, 0.0);
|
||||||
addAndMakeVisible (masterGainSlider);
|
addAndMakeVisible (masterGainSlider);
|
||||||
masterGainLabel.setFont (customLookAndFeel.getMediumFont (13.0f));
|
masterGainLabel.setFont (customLookAndFeel.getMediumFont (13.0f));
|
||||||
masterGainLabel.setJustificationType (juce::Justification::centred);
|
masterGainLabel.setJustificationType (juce::Justification::centred);
|
||||||
addAndMakeVisible (masterGainLabel);
|
addAndMakeVisible (masterGainLabel);
|
||||||
|
|
||||||
|
// Limiter toggle
|
||||||
|
limiterToggle.setToggleState (processor.limiterEnabled.load(), juce::dontSendNotification);
|
||||||
|
addAndMakeVisible (limiterToggle);
|
||||||
|
limiterLabel.setFont (customLookAndFeel.getMediumFont (13.0f));
|
||||||
|
limiterLabel.setColour (juce::Label::textColourId, InstaLPEQLookAndFeel::textSecondary);
|
||||||
|
limiterLabel.setJustificationType (juce::Justification::centred);
|
||||||
|
addAndMakeVisible (limiterLabel);
|
||||||
|
|
||||||
// Sizing
|
// Sizing
|
||||||
constrainer.setMinimumSize (700, 450);
|
constrainer.setMinimumSize (700, 450);
|
||||||
constrainer.setMaximumSize (1920, 1080);
|
constrainer.setMaximumSize (1920, 1080);
|
||||||
@@ -144,11 +163,18 @@ void InstaLPEQEditor::resized()
|
|||||||
masterGainLabel.setBounds (labelArea);
|
masterGainLabel.setBounds (labelArea);
|
||||||
masterGainSlider.setBounds (masterArea.removeFromLeft (masterH));
|
masterGainSlider.setBounds (masterArea.removeFromLeft (masterH));
|
||||||
|
|
||||||
|
// Limiter toggle next to master gain
|
||||||
|
limiterLabel.setFont (customLookAndFeel.getMediumFont (std::max (11.0f, 14.0f * scale)));
|
||||||
|
limiterLabel.setBounds (masterArea.removeFromLeft (55));
|
||||||
|
limiterToggle.setBounds (masterArea.removeFromLeft (40));
|
||||||
|
|
||||||
// Quality selector on the right side of master row
|
// Quality selector on the right side of master row
|
||||||
qualityLabel.setFont (customLookAndFeel.getMediumFont (std::max (11.0f, 14.0f * scale)));
|
qualityLabel.setFont (customLookAndFeel.getMediumFont (std::max (11.0f, 14.0f * scale)));
|
||||||
auto qLabelArea = masterArea.removeFromRight (30);
|
auto qLabelArea = masterArea.removeFromRight (30);
|
||||||
qualityLabel.setBounds (qLabelArea);
|
qualityLabel.setBounds (qLabelArea);
|
||||||
qualitySelector.setBounds (masterArea.removeFromRight ((int) (130 * scale)).reduced (2, (masterH - 24) / 2));
|
qualitySelector.setBounds (masterArea.removeFromRight ((int) (130 * scale)).reduced (2, (masterH - 24) / 2));
|
||||||
|
qualityWarning.setFont (customLookAndFeel.getRegularFont (std::max (9.0f, 11.0f * scale)));
|
||||||
|
qualityWarning.setBounds (masterArea.removeFromRight ((int) (170 * scale)));
|
||||||
|
|
||||||
// Node parameter panel (15% of remaining height)
|
// Node parameter panel (15% of remaining height)
|
||||||
int nodePanelH = (int) (bounds.getHeight() * 0.18f);
|
int nodePanelH = (int) (bounds.getHeight() * 0.18f);
|
||||||
@@ -162,9 +188,10 @@ void InstaLPEQEditor::resized()
|
|||||||
|
|
||||||
void InstaLPEQEditor::timerCallback()
|
void InstaLPEQEditor::timerCallback()
|
||||||
{
|
{
|
||||||
// Sync bypass
|
// Sync bypass & limiter
|
||||||
processor.bypassed.store (bypassToggle.getToggleState());
|
processor.bypassed.store (bypassToggle.getToggleState());
|
||||||
processor.masterGainDb.store ((float) masterGainSlider.getValue());
|
processor.masterGainDb.store ((float) masterGainSlider.getValue());
|
||||||
|
processor.limiterEnabled.store (limiterToggle.getToggleState());
|
||||||
|
|
||||||
// Update display with latest magnitude response
|
// Update display with latest magnitude response
|
||||||
auto magDb = processor.getFIREngine().getMagnitudeResponseDb();
|
auto magDb = processor.getFIREngine().getMagnitudeResponseDb();
|
||||||
|
|||||||
@@ -39,16 +39,19 @@ private:
|
|||||||
NodeParameterPanel nodePanel;
|
NodeParameterPanel nodePanel;
|
||||||
|
|
||||||
juce::Label titleLabel { {}, "INSTALPEQ" };
|
juce::Label titleLabel { {}, "INSTALPEQ" };
|
||||||
juce::Label versionLabel { {}, "v1.1.2" };
|
juce::Label versionLabel { {}, "v1.1.3" };
|
||||||
juce::ToggleButton bypassToggle;
|
juce::ToggleButton bypassToggle;
|
||||||
juce::Label bypassLabel { {}, "BYPASS" };
|
juce::Label bypassLabel { {}, "BYPASS" };
|
||||||
|
|
||||||
juce::TextButton newBandButton { "NEW BAND" };
|
juce::TextButton newBandButton { "NEW BAND" };
|
||||||
juce::ComboBox qualitySelector;
|
juce::ComboBox qualitySelector;
|
||||||
juce::Label qualityLabel { {}, "FIR" };
|
juce::Label qualityLabel { {}, "FIR" };
|
||||||
|
juce::Label qualityWarning { {}, "" };
|
||||||
|
|
||||||
juce::Slider masterGainSlider;
|
juce::Slider masterGainSlider;
|
||||||
juce::Label masterGainLabel { {}, "MASTER" };
|
juce::Label masterGainLabel { {}, "MASTER" };
|
||||||
|
juce::ToggleButton limiterToggle;
|
||||||
|
juce::Label limiterLabel { {}, "LIMITER" };
|
||||||
|
|
||||||
juce::ComponentBoundsConstrainer constrainer;
|
juce::ComponentBoundsConstrainer constrainer;
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,9 @@ void InstaLPEQProcessor::prepareToPlay (double sampleRate, int samplesPerBlock)
|
|||||||
|
|
||||||
juce::dsp::ProcessSpec spec { sampleRate, (juce::uint32) samplesPerBlock, 2 };
|
juce::dsp::ProcessSpec spec { sampleRate, (juce::uint32) samplesPerBlock, 2 };
|
||||||
convolution.prepare (spec);
|
convolution.prepare (spec);
|
||||||
|
limiter.prepare (spec);
|
||||||
|
limiter.setThreshold (0.0f);
|
||||||
|
limiter.setRelease (50.0f);
|
||||||
|
|
||||||
firEngine.start (sampleRate);
|
firEngine.start (sampleRate);
|
||||||
updateFIR();
|
updateFIR();
|
||||||
@@ -67,6 +70,14 @@ void InstaLPEQProcessor::processBlock (juce::AudioBuffer<float>& buffer, juce::M
|
|||||||
float gain = juce::Decibels::decibelsToGain (masterGainDb.load());
|
float gain = juce::Decibels::decibelsToGain (masterGainDb.load());
|
||||||
if (std::abs (gain - 1.0f) > 0.001f)
|
if (std::abs (gain - 1.0f) > 0.001f)
|
||||||
buffer.applyGain (gain);
|
buffer.applyGain (gain);
|
||||||
|
|
||||||
|
// Brickwall limiter (0 dB ceiling)
|
||||||
|
if (limiterEnabled.load())
|
||||||
|
{
|
||||||
|
juce::dsp::AudioBlock<float> limBlock (buffer);
|
||||||
|
juce::dsp::ProcessContextReplacing<float> limContext (limBlock);
|
||||||
|
limiter.process (limContext);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============================================================
|
// ============================================================
|
||||||
@@ -141,6 +152,7 @@ void InstaLPEQProcessor::getStateInformation (juce::MemoryBlock& destData)
|
|||||||
juce::XmlElement xml ("InstaLPEQ");
|
juce::XmlElement xml ("InstaLPEQ");
|
||||||
xml.setAttribute ("bypass", bypassed.load());
|
xml.setAttribute ("bypass", bypassed.load());
|
||||||
xml.setAttribute ("masterGain", (double) masterGainDb.load());
|
xml.setAttribute ("masterGain", (double) masterGainDb.load());
|
||||||
|
xml.setAttribute ("limiter", limiterEnabled.load());
|
||||||
|
|
||||||
auto currentBands = getBands();
|
auto currentBands = getBands();
|
||||||
for (int i = 0; i < (int) currentBands.size(); ++i)
|
for (int i = 0; i < (int) currentBands.size(); ++i)
|
||||||
@@ -164,6 +176,7 @@ void InstaLPEQProcessor::setStateInformation (const void* data, int sizeInBytes)
|
|||||||
|
|
||||||
bypassed.store (xml->getBoolAttribute ("bypass", false));
|
bypassed.store (xml->getBoolAttribute ("bypass", false));
|
||||||
masterGainDb.store ((float) xml->getDoubleAttribute ("masterGain", 0.0));
|
masterGainDb.store ((float) xml->getDoubleAttribute ("masterGain", 0.0));
|
||||||
|
limiterEnabled.store (xml->getBoolAttribute ("limiter", true));
|
||||||
|
|
||||||
std::vector<EQBand> loadedBands;
|
std::vector<EQBand> loadedBands;
|
||||||
for (auto* bandXml : xml->getChildIterator())
|
for (auto* bandXml : xml->getChildIterator())
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ public:
|
|||||||
// Settings
|
// Settings
|
||||||
std::atomic<bool> bypassed { false };
|
std::atomic<bool> bypassed { false };
|
||||||
std::atomic<float> masterGainDb { 0.0f };
|
std::atomic<float> masterGainDb { 0.0f };
|
||||||
|
std::atomic<bool> limiterEnabled { true };
|
||||||
|
|
||||||
void setQuality (int fftOrder);
|
void setQuality (int fftOrder);
|
||||||
|
|
||||||
@@ -55,6 +56,7 @@ private:
|
|||||||
|
|
||||||
FIREngine firEngine;
|
FIREngine firEngine;
|
||||||
juce::dsp::Convolution convolution;
|
juce::dsp::Convolution convolution;
|
||||||
|
juce::dsp::Limiter<float> limiter;
|
||||||
|
|
||||||
double currentSampleRate = 44100.0;
|
double currentSampleRate = 44100.0;
|
||||||
int currentBlockSize = 512;
|
int currentBlockSize = 512;
|
||||||
|
|||||||
Reference in New Issue
Block a user