From c4f77845fc7cdfe6d1a1dcb01cecd2c3768e4d52 Mon Sep 17 00:00:00 2001 From: Jeff Learman Date: Mon, 4 May 2026 12:03:36 -0400 Subject: [PATCH 1/5] Update to VS2026 and fix warnings revert JUCE location --- Source/PluginEditor.cpp | 4 +-- Source/PluginProcessor.cpp | 54 +++++++++++++++++++------------------- coneko.jucer | 11 +++++--- 3 files changed, 36 insertions(+), 33 deletions(-) diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index dbe896e..f4b363d 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -20,8 +20,8 @@ ConekoAudioProcessorEditor::ConekoAudioProcessorEditor(ConekoAudioProcessor &p) // set AudioFormatManager for reading IR file formatManager.registerBasicFormats(); - const auto sliderStyle = juce::Slider::RotaryHorizontalVerticalDrag; - const auto sliderLabelJustification = juce::Justification::centred; + // const auto sliderStyle = juce::Slider::RotaryHorizontalVerticalDrag; + // const auto sliderLabelJustification = juce::Justification::centred; addAndMakeVisible(openIRFileButton); openIRFileButton.setButtonText("Open IR File..."); diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 86ca491..a4e7979 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -71,14 +71,14 @@ int ConekoAudioProcessor::getNumPrograms() { int ConekoAudioProcessor::getCurrentProgram() { return 0; } -void ConekoAudioProcessor::setCurrentProgram(int index) {} +void ConekoAudioProcessor::setCurrentProgram(int /*index*/) {} -const juce::String ConekoAudioProcessor::getProgramName(int index) { +const juce::String ConekoAudioProcessor::getProgramName(int /*oindex*/) { return {}; } -void ConekoAudioProcessor::changeProgramName(int index, - const juce::String &newName) {} +void ConekoAudioProcessor::changeProgramName(int /*index*/, + const juce::String &/*newName*/) { } //============================================================================== void ConekoAudioProcessor::prepareToPlay(double sampleRate, @@ -89,7 +89,7 @@ void ConekoAudioProcessor::prepareToPlay(double sampleRate, spec.numChannels = getTotalNumOutputChannels(); spec.maximumBlockSize = samplesPerBlock; - soundtouch.setSampleRate(sampleRate); + soundtouch.setSampleRate((uint)sampleRate); soundtouch.setChannels(1); inputGainer.prepare(spec); @@ -99,7 +99,7 @@ void ConekoAudioProcessor::prepareToPlay(double sampleRate, dryWetMixer.prepare(spec); dryWetMixer.reset(); delay.prepare(spec); - delay.setMaximumDelayInSamples(sampleRate); + delay.setMaximumDelayInSamples((int)sampleRate); delay.reset(); convolver.prepare(spec); convolver.reset(); @@ -142,7 +142,7 @@ bool ConekoAudioProcessor::isBusesLayoutSupported( #endif void ConekoAudioProcessor::processBlock(juce::AudioBuffer &buffer, - juce::MidiBuffer &midiMessages) { + juce::MidiBuffer &/*midiMessages*/) { juce::ScopedNoDenormals noDenormals; auto totalNumInputChannels = getTotalNumInputChannels(); auto totalNumOutputChannels = getTotalNumOutputChannels(); @@ -165,14 +165,14 @@ void ConekoAudioProcessor::processBlock(juce::AudioBuffer &buffer, auto isBypassed = apvts.getRawParameterValue("Bypassed"); updateFilterParameters(); - if (isBypassed->load() == true) { + if (isBypassed->load() != 0.0) { return; } inputGainer.setGainDecibels(inputGainValue->load()); outputGainer.setGainDecibels(outputGainValue->load()); dryWetMixer.setWetMixProportion(dryWetMixValue->load() / 100.0f); - delay.setDelay(preDelayTimeValue->load() / 1000.0 * this->getSampleRate()); + delay.setDelay(preDelayTimeValue->load() / 1000.0f * static_cast(this->getSampleRate())); auto block = juce::dsp::AudioBlock(buffer); auto context = juce::dsp::ProcessContextReplacing(block); @@ -183,7 +183,7 @@ void ConekoAudioProcessor::processBlock(juce::AudioBuffer &buffer, // set stereo width using mid/side technique if (context.getInputBlock().getNumChannels() == 2) { - const float width = stereoWidthValue->load() / 100.0; + const float width = static_cast(stereoWidthValue->load()) / 100.0f; for (int sample = 0; sample < context.getInputBlock().getNumSamples(); ++sample) { float left = context.getInputBlock().getSample(0, sample); @@ -212,14 +212,14 @@ juce::AudioProcessorEditor *ConekoAudioProcessor::createEditor() { } //============================================================================== -void ConekoAudioProcessor::getStateInformation(juce::MemoryBlock &destData) { +void ConekoAudioProcessor::getStateInformation(juce::MemoryBlock &/*destData*/) { // You should use this method to store your parameters in the memory block. // You could do that either as raw data, or use the XML or ValueTree classes // as intermediaries to make it easy to save and load complex data. } -void ConekoAudioProcessor::setStateInformation(const void *data, - int sizeInBytes) { +void ConekoAudioProcessor::setStateInformation(const void */*data*/, + int /*sizeInBytes*/) { // You should use this method to restore your parameters from this memory // block, whose contents will have been created by the getStateInformation() // call. @@ -246,17 +246,17 @@ void ConekoAudioProcessor::loadImpulseResponse() { // normalized IR signal float globalMaxMagnitude = originalIRBuffer.getMagnitude(0, originalIRBuffer.getNumSamples()); - originalIRBuffer.applyGain(1.0f / (globalMaxMagnitude + 0.01)); + originalIRBuffer.applyGain(1.0f / (globalMaxMagnitude + 0.01f)); // trim IR signal int numSamples = originalIRBuffer.getNumSamples(); - int blockSize = static_cast(std::floor(this->getSampleRate()) / 100); + int blkSize = static_cast(std::floor(this->getSampleRate()) / 100); int startBlockNum = 0; - int endBlockNum = numSamples / blockSize; + int endBlockNum = numSamples / blkSize; float localMaxMagnitude = 0.0f; - while ((startBlockNum + 1) * blockSize < numSamples) { + while ((startBlockNum + 1) * blkSize < numSamples) { localMaxMagnitude = - originalIRBuffer.getMagnitude(startBlockNum * blockSize, blockSize); + originalIRBuffer.getMagnitude(startBlockNum * blkSize, blkSize); // find the start position of IR if (localMaxMagnitude > 0.001) { break; @@ -264,10 +264,10 @@ void ConekoAudioProcessor::loadImpulseResponse() { ++startBlockNum; } localMaxMagnitude = 0.0f; - while ((endBlockNum - 1) * blockSize > 0) { + while ((endBlockNum - 1) * blkSize > 0) { --endBlockNum; localMaxMagnitude = - originalIRBuffer.getMagnitude(endBlockNum * blockSize, blockSize); + originalIRBuffer.getMagnitude(endBlockNum * blkSize, blkSize); // find the time to decay by 60 dB (T60) if (localMaxMagnitude > 0.001) { break; @@ -275,10 +275,10 @@ void ConekoAudioProcessor::loadImpulseResponse() { } int trimmedNumSamples; - if (endBlockNum * blockSize < numSamples) { - trimmedNumSamples = (endBlockNum - startBlockNum) * blockSize - 1; + if (endBlockNum * blkSize < numSamples) { + trimmedNumSamples = (endBlockNum - startBlockNum) * blkSize - 1; } else { - trimmedNumSamples = numSamples - startBlockNum * blockSize; + trimmedNumSamples = numSamples - startBlockNum * blkSize; } modifiedIRBuffer.setSize(originalIRBuffer.getNumChannels(), trimmedNumSamples, false, true, false); @@ -288,7 +288,7 @@ void ConekoAudioProcessor::loadImpulseResponse() { modifiedIRBuffer.setSample( channel, sample, originalIRBuffer.getSample(channel, - sample + startBlockNum * blockSize)); + sample + startBlockNum * blkSize)); } } @@ -299,7 +299,7 @@ void ConekoAudioProcessor::loadImpulseResponse() { static_cast(trimmedNumSamples) / this->getSampleRate(); decayTimeParam->beginChangeGesture(); decayTimeParam->setValueNotifyingHost( - decayTimeParam->convertTo0to1(decayTime)); + decayTimeParam->convertTo0to1(static_cast(decayTime))); decayTimeParam->endChangeGesture(); updateImpulseResponse(modifiedIRBuffer); @@ -354,7 +354,7 @@ void ConekoAudioProcessor::updateIRParameters() { // reverse of the IR auto isReversed = apvts.getRawParameterValue("Reversed"); - if (isReversed->load() == true) { + if (isReversed->load() != 0.0) { modifiedIRBuffer.reverse(0, modifiedIRBuffer.getNumSamples()); } @@ -362,7 +362,7 @@ void ConekoAudioProcessor::updateIRParameters() { } void ConekoAudioProcessor::updateFilterParameters() { - const float sampleRate = this->getSampleRate(); + const float sampleRate = static_cast(this->getSampleRate()); auto lowShelfFreqValue = apvts.getRawParameterValue("LowShelfFreq"); auto lowShelfGainValue = apvts.getRawParameterValue("LowShelfGain"); diff --git a/coneko.jucer b/coneko.jucer index 0cdbba1..4d7b920 100644 --- a/coneko.jucer +++ b/coneko.jucer @@ -73,10 +73,10 @@ - + - - + + @@ -84,6 +84,7 @@ + @@ -93,7 +94,7 @@ - + @@ -102,6 +103,8 @@ + From e5b69e33c53b5f8c3867a5a709dc7a5443b6f477 Mon Sep 17 00:00:00 2001 From: Jeff Learman Date: Mon, 4 May 2026 16:06:41 -0400 Subject: [PATCH 2/5] widgets removed --- Source/PluginEditor.cpp | 12 ++++++++++-- Source/PluginEditor.h | 22 ++++++++++----------- Source/PluginProcessor.cpp | 40 ++++++++++++++++++++++---------------- Source/PluginProcessor.h | 6 +++--- 4 files changed, 47 insertions(+), 33 deletions(-) diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index f4b363d..cc2b0c1 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -30,6 +30,7 @@ ConekoAudioProcessorEditor::ConekoAudioProcessorEditor(ConekoAudioProcessor &p) irFileLabel.setText("", juce::dontSendNotification); irFileLabel.setJustificationType(juce::Justification::centredLeft); +#if 0 addAndMakeVisible(reverseButton); reverseButton.setButtonText("Reverse IR"); reverseButton.setEnabled(enableIRParameters); @@ -40,6 +41,7 @@ ConekoAudioProcessorEditor::ConekoAudioProcessorEditor(ConekoAudioProcessor &p) }; reverseButtonAttachment = std::make_unique( audioProcessor.apvts, "Reversed", reverseButton); +#endif addAndMakeVisible(bypassButton); bypassButton.setButtonText("Bypass"); @@ -61,6 +63,7 @@ ConekoAudioProcessorEditor::ConekoAudioProcessorEditor(ConekoAudioProcessor &p) dryWetMixSliderAttachment = std::make_unique( audioProcessor.apvts, "DryWetMix", dryWetMixSlider); +#if 0 createSlider(decayTimeSlider, " s"); decayTimeSlider.setEnabled(enableIRParameters); decayTimeSlider.onDragEnd = [this] { @@ -86,6 +89,7 @@ ConekoAudioProcessorEditor::ConekoAudioProcessorEditor(ConekoAudioProcessor &p) createLabel(stereoWidthLabel, "Width", &stereoWidthSlider); stereoWidthSliderAttachment = std::make_unique( audioProcessor.apvts, "StereoWidth", stereoWidthSlider); +#endif createSlider(lowShelfFreqSlider, " Hz"); createLabel(lowShelfFreqLabel, "LowFreq", &lowShelfFreqSlider); @@ -173,8 +177,10 @@ void ConekoAudioProcessorEditor::resized() { 40); irFileLabel.setBounds(leftRightMargin, topBottomMargin + 45, dialWidth * 3, 20); +#if 0 reverseButton.setBounds(leftRightMargin + dialWidth * 2, topBottomMargin + 40, dialWidth, 30); +#endif bypassButton.setBounds(getWidth() - leftRightMargin - dialWidth * 3, topBottomMargin, dialWidth, 20); inputGainSlider.setBounds(leftRightMargin, @@ -186,6 +192,7 @@ void ConekoAudioProcessorEditor::resized() { dryWetMixSlider.setBounds(leftRightMargin + dialWidth * 2, getHeight() - topBottomMargin - dialHeight, dialWidth, dialHeight); +#if 0 decayTimeSlider.setBounds(leftRightMargin + dialWidth * 3, getHeight() - topBottomMargin - dialHeight * 3 + 30, dialWidth * 3, dialHeight * 3 - 30); @@ -195,6 +202,7 @@ void ConekoAudioProcessorEditor::resized() { stereoWidthSlider.setBounds(getWidth() - leftRightMargin - dialWidth * 3, getHeight() - topBottomMargin - dialHeight, dialWidth, dialHeight); +#endif lowShelfFreqSlider.setBounds(getWidth() - leftRightMargin - dialWidth * 2, topBottomMargin + dialHeight / 3 * 2, dialWidth, dialHeight); @@ -233,8 +241,8 @@ void ConekoAudioProcessorEditor::openButtonClicked() { shouldPaintWaveform = true; enableIRParameters = true; - reverseButton.setEnabled(enableIRParameters); - decayTimeSlider.setEnabled(enableIRParameters); + // reverseButton.setEnabled(enableIRParameters); + // decayTimeSlider.setEnabled(enableIRParameters); repaint(); } } diff --git a/Source/PluginEditor.h b/Source/PluginEditor.h index f3529f5..71d0b79 100644 --- a/Source/PluginEditor.h +++ b/Source/PluginEditor.h @@ -42,8 +42,8 @@ class ConekoAudioProcessorEditor : public juce::AudioProcessorEditor { juce::TextButton openIRFileButton; juce::Label irFileLabel; - juce::ToggleButton reverseButton; - std::unique_ptr reverseButtonAttachment; + // juce::ToggleButton reverseButton; + // std::unique_ptr reverseButtonAttachment; juce::ToggleButton bypassButton; std::unique_ptr bypassButtonAttachment; juce::Slider inputGainSlider; @@ -55,15 +55,15 @@ class ConekoAudioProcessorEditor : public juce::AudioProcessorEditor { juce::Slider dryWetMixSlider; juce::Label dryWetMixLabel; std::unique_ptr dryWetMixSliderAttachment; - juce::Slider decayTimeSlider; - juce::Label decayTimeLabel; - std::unique_ptr decayTimeSliderAttachment; - juce::Slider preDelayTimeSlider; - juce::Label preDelayTimeLabel; - std::unique_ptr preDelayTimeSliderAttachment; - juce::Slider stereoWidthSlider; - juce::Label stereoWidthLabel; - std::unique_ptr stereoWidthSliderAttachment; + // juce::Slider decayTimeSlider; + // juce::Label decayTimeLabel; + // std::unique_ptr decayTimeSliderAttachment; + // juce::Slider preDelayTimeSlider; + // juce::Label preDelayTimeLabel; + // std::unique_ptr preDelayTimeSliderAttachment; + // juce::Slider stereoWidthSlider; + // juce::Label stereoWidthLabel; + // std::unique_ptr stereoWidthSliderAttachment; juce::Slider lowShelfFreqSlider; juce::Label lowShelfFreqLabel; std::unique_ptr lowShelfFreqSliderAttachment; diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index a4e7979..34d3d01 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -89,8 +89,8 @@ void ConekoAudioProcessor::prepareToPlay(double sampleRate, spec.numChannels = getTotalNumOutputChannels(); spec.maximumBlockSize = samplesPerBlock; - soundtouch.setSampleRate((uint)sampleRate); - soundtouch.setChannels(1); + // soundtouch.setSampleRate((uint)sampleRate); + // soundtouch.setChannels(1); inputGainer.prepare(spec); inputGainer.reset(); @@ -98,9 +98,9 @@ void ConekoAudioProcessor::prepareToPlay(double sampleRate, outputGainer.reset(); dryWetMixer.prepare(spec); dryWetMixer.reset(); - delay.prepare(spec); - delay.setMaximumDelayInSamples((int)sampleRate); - delay.reset(); + // delay.prepare(spec); + // delay.setMaximumDelayInSamples((int)sampleRate); + // delay.reset(); convolver.prepare(spec); convolver.reset(); @@ -172,15 +172,16 @@ void ConekoAudioProcessor::processBlock(juce::AudioBuffer &buffer, inputGainer.setGainDecibels(inputGainValue->load()); outputGainer.setGainDecibels(outputGainValue->load()); dryWetMixer.setWetMixProportion(dryWetMixValue->load() / 100.0f); - delay.setDelay(preDelayTimeValue->load() / 1000.0f * static_cast(this->getSampleRate())); + // delay.setDelay(preDelayTimeValue->load() / 1000.0f * static_cast(this->getSampleRate())); auto block = juce::dsp::AudioBlock(buffer); auto context = juce::dsp::ProcessContextReplacing(block); inputGainer.process(context); dryWetMixer.pushDrySamples(block); convolver.process(context); - delay.process(context); + // delay.process(context); +#if 0 // set stereo width using mid/side technique if (context.getInputBlock().getNumChannels() == 2) { const float width = static_cast(stereoWidthValue->load()) / 100.0f; @@ -194,6 +195,7 @@ void ConekoAudioProcessor::processBlock(juce::AudioBuffer &buffer, 1, sample, left * (1 - width) / 2 + right * (1 + width) / 2); } } +#endif lowShelfFilter.process(context); highShelfFilter.process(context); @@ -248,6 +250,7 @@ void ConekoAudioProcessor::loadImpulseResponse() { originalIRBuffer.getMagnitude(0, originalIRBuffer.getNumSamples()); originalIRBuffer.applyGain(1.0f / (globalMaxMagnitude + 0.01f)); +#if 0 // trim IR signal int numSamples = originalIRBuffer.getNumSamples(); int blkSize = static_cast(std::floor(this->getSampleRate()) / 100); @@ -301,15 +304,16 @@ void ConekoAudioProcessor::loadImpulseResponse() { decayTimeParam->setValueNotifyingHost( decayTimeParam->convertTo0to1(static_cast(decayTime))); decayTimeParam->endChangeGesture(); +#endif - updateImpulseResponse(modifiedIRBuffer); + updateImpulseResponse(originalIRBuffer); } void ConekoAudioProcessor::updateImpulseResponse( juce::AudioBuffer irBuffer) { convolver.loadImpulseResponse(std::move(irBuffer), this->getSampleRate(), juce::dsp::Convolution::Stereo::yes, - juce::dsp::Convolution::Trim::no, + juce::dsp::Convolution::Trim::yes, juce::dsp::Convolution::Normalise::yes); } @@ -318,15 +322,14 @@ void ConekoAudioProcessor::updateIRParameters() { return; } +#if 0 // stretch IR according to decay time - auto decayTimeValue = apvts.getRawParameterValue("DecayTime"); - int decaySample = static_cast( - std::round(decayTimeValue->load() * this->getSampleRate())); - double stretchRatio = - originalIRBuffer.getNumSamples() / static_cast(decaySample); + // auto decayTimeValue = apvts.getRawParameterValue("DecayTime"); + // int decaySample = static_cast(std::round(decayTimeValue->load() * this->getSampleRate())); + // double stretchRatio = originalIRBuffer.getNumSamples() / static_cast(decaySample); int numChannels = originalIRBuffer.getNumChannels(); - soundtouch.setTempo(stretchRatio); + // soundtouch.setTempo(stretchRatio); modifiedIRBuffer.setSize(numChannels, decaySample, false, true, false); for (int channel = 0; channel < numChannels; ++channel) { soundtouch.putSamples(originalIRBuffer.getReadPointer(channel), @@ -335,6 +338,7 @@ void ConekoAudioProcessor::updateIRParameters() { decaySample); soundtouch.clear(); } +#endif // delay IR according to pre-delay time // auto preDelayTimeValue = apvts.getRawParameterValue("PreDelayTime"); @@ -352,15 +356,17 @@ void ConekoAudioProcessor::updateIRParameters() { // tempBuffer.getNumSamples()); //} +#if 0 // reverse of the IR auto isReversed = apvts.getRawParameterValue("Reversed"); if (isReversed->load() != 0.0) { modifiedIRBuffer.reverse(0, modifiedIRBuffer.getNumSamples()); } - - updateImpulseResponse(modifiedIRBuffer); +#endif + updateImpulseResponse(originalIRBuffer); } + void ConekoAudioProcessor::updateFilterParameters() { const float sampleRate = static_cast(this->getSampleRate()); diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index 96766a4..97380ba 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -8,7 +8,7 @@ #pragma once -#include "../soundtouch/SoundTouch.h" +// #include "../soundtouch/SoundTouch.h" #include //============================================================================== @@ -73,14 +73,14 @@ class ConekoAudioProcessor : public juce::AudioProcessor { juce::AudioBuffer originalIRBuffer; juce::AudioBuffer modifiedIRBuffer; - soundtouch::SoundTouch soundtouch; + // soundtouch::SoundTouch soundtouch; APVTS::ParameterLayout createParameters(); juce::dsp::Gain inputGainer; juce::dsp::Gain outputGainer; juce::dsp::DryWetMixer dryWetMixer; - juce::dsp::DelayLine delay; + // juce::dsp::DelayLine delay; juce::dsp::Convolution convolver; juce::dsp::ProcessorDuplicator, juce::dsp::IIR::Coefficients> From c34657e18229999ab684233aab6169b2d207c951 Mon Sep 17 00:00:00 2001 From: Jeff Learman Date: Mon, 4 May 2026 16:15:33 -0400 Subject: [PATCH 3/5] cleanup ifdefs --- Source/PluginEditor.cpp | 59 ----------------------------------------- Source/PluginEditor.h | 11 -------- 2 files changed, 70 deletions(-) diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index cc2b0c1..c4c52bb 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -20,9 +20,6 @@ ConekoAudioProcessorEditor::ConekoAudioProcessorEditor(ConekoAudioProcessor &p) // set AudioFormatManager for reading IR file formatManager.registerBasicFormats(); - // const auto sliderStyle = juce::Slider::RotaryHorizontalVerticalDrag; - // const auto sliderLabelJustification = juce::Justification::centred; - addAndMakeVisible(openIRFileButton); openIRFileButton.setButtonText("Open IR File..."); openIRFileButton.onClick = [this] { openButtonClicked(); }; @@ -30,19 +27,6 @@ ConekoAudioProcessorEditor::ConekoAudioProcessorEditor(ConekoAudioProcessor &p) irFileLabel.setText("", juce::dontSendNotification); irFileLabel.setJustificationType(juce::Justification::centredLeft); -#if 0 - addAndMakeVisible(reverseButton); - reverseButton.setButtonText("Reverse IR"); - reverseButton.setEnabled(enableIRParameters); - reverseButton.onClick = [this] { - audioProcessor.updateIRParameters(); - shouldPaintWaveform = true; - repaint(); - }; - reverseButtonAttachment = std::make_unique( - audioProcessor.apvts, "Reversed", reverseButton); -#endif - addAndMakeVisible(bypassButton); bypassButton.setButtonText("Bypass"); bypassButtonAttachment = std::make_unique( @@ -63,34 +47,6 @@ ConekoAudioProcessorEditor::ConekoAudioProcessorEditor(ConekoAudioProcessor &p) dryWetMixSliderAttachment = std::make_unique( audioProcessor.apvts, "DryWetMix", dryWetMixSlider); -#if 0 - createSlider(decayTimeSlider, " s"); - decayTimeSlider.setEnabled(enableIRParameters); - decayTimeSlider.onDragEnd = [this] { - audioProcessor.updateIRParameters(); - shouldPaintWaveform = true; - repaint(); - }; - createLabel(decayTimeLabel, "Decay", &decayTimeSlider); - decayTimeSliderAttachment = std::make_unique( - audioProcessor.apvts, "DecayTime", decayTimeSlider); - - createSlider(preDelayTimeSlider, " ms"); - // preDelayTimeSlider.onDragEnd = [this] { - // audioProcessor.updateIRParameters(); - // shouldPaintWaveform = true; - // repaint(); - //}; - createLabel(preDelayTimeLabel, "Pre-delay", &preDelayTimeSlider); - preDelayTimeSliderAttachment = std::make_unique( - audioProcessor.apvts, "PreDelayTime", preDelayTimeSlider); - - createSlider(stereoWidthSlider, " %"); - createLabel(stereoWidthLabel, "Width", &stereoWidthSlider); - stereoWidthSliderAttachment = std::make_unique( - audioProcessor.apvts, "StereoWidth", stereoWidthSlider); -#endif - createSlider(lowShelfFreqSlider, " Hz"); createLabel(lowShelfFreqLabel, "LowFreq", &lowShelfFreqSlider); lowShelfFreqSliderAttachment = std::make_unique( @@ -177,10 +133,6 @@ void ConekoAudioProcessorEditor::resized() { 40); irFileLabel.setBounds(leftRightMargin, topBottomMargin + 45, dialWidth * 3, 20); -#if 0 - reverseButton.setBounds(leftRightMargin + dialWidth * 2, topBottomMargin + 40, - dialWidth, 30); -#endif bypassButton.setBounds(getWidth() - leftRightMargin - dialWidth * 3, topBottomMargin, dialWidth, 20); inputGainSlider.setBounds(leftRightMargin, @@ -192,17 +144,6 @@ void ConekoAudioProcessorEditor::resized() { dryWetMixSlider.setBounds(leftRightMargin + dialWidth * 2, getHeight() - topBottomMargin - dialHeight, dialWidth, dialHeight); -#if 0 - decayTimeSlider.setBounds(leftRightMargin + dialWidth * 3, - getHeight() - topBottomMargin - dialHeight * 3 + 30, - dialWidth * 3, dialHeight * 3 - 30); - preDelayTimeSlider.setBounds(getWidth() - leftRightMargin - dialWidth * 3, - topBottomMargin + dialHeight / 3 * 2, dialWidth, - dialHeight); - stereoWidthSlider.setBounds(getWidth() - leftRightMargin - dialWidth * 3, - getHeight() - topBottomMargin - dialHeight, - dialWidth, dialHeight); -#endif lowShelfFreqSlider.setBounds(getWidth() - leftRightMargin - dialWidth * 2, topBottomMargin + dialHeight / 3 * 2, dialWidth, dialHeight); diff --git a/Source/PluginEditor.h b/Source/PluginEditor.h index 71d0b79..39a193c 100644 --- a/Source/PluginEditor.h +++ b/Source/PluginEditor.h @@ -42,8 +42,6 @@ class ConekoAudioProcessorEditor : public juce::AudioProcessorEditor { juce::TextButton openIRFileButton; juce::Label irFileLabel; - // juce::ToggleButton reverseButton; - // std::unique_ptr reverseButtonAttachment; juce::ToggleButton bypassButton; std::unique_ptr bypassButtonAttachment; juce::Slider inputGainSlider; @@ -55,15 +53,6 @@ class ConekoAudioProcessorEditor : public juce::AudioProcessorEditor { juce::Slider dryWetMixSlider; juce::Label dryWetMixLabel; std::unique_ptr dryWetMixSliderAttachment; - // juce::Slider decayTimeSlider; - // juce::Label decayTimeLabel; - // std::unique_ptr decayTimeSliderAttachment; - // juce::Slider preDelayTimeSlider; - // juce::Label preDelayTimeLabel; - // std::unique_ptr preDelayTimeSliderAttachment; - // juce::Slider stereoWidthSlider; - // juce::Label stereoWidthLabel; - // std::unique_ptr stereoWidthSliderAttachment; juce::Slider lowShelfFreqSlider; juce::Label lowShelfFreqLabel; std::unique_ptr lowShelfFreqSliderAttachment; From 065684e4c3af003200e342112d81f6b448974053 Mon Sep 17 00:00:00 2001 From: Jeff Learman Date: Mon, 4 May 2026 16:18:42 -0400 Subject: [PATCH 4/5] enable FLAC impulse files --- Source/PluginEditor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index c4c52bb..98077f5 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -160,8 +160,8 @@ void ConekoAudioProcessorEditor::resized() { void ConekoAudioProcessorEditor::openButtonClicked() { fileChooser = std::make_unique( - "Choose a support IR File (WAV, AIFF, OGG)...", juce::File(), - "*.wav;*.aif;*.aiff;*.ogg", true, false); + "Choose a support IR File (WAV, AIFF, OGG, FLAC)...", juce::File(), + "*.wav;*.aif;*.aiff;*.ogg;*.flac", true, false); auto chooserFlags = juce::FileBrowserComponent::openMode | juce::FileBrowserComponent::canSelectFiles; fileChooser->launchAsync(chooserFlags, [this](const juce::FileChooser &fc) { From 70168f8d3661794aeb4dc717ac845e627aee00f7 Mon Sep 17 00:00:00 2001 From: Jeff Learman Date: Mon, 4 May 2026 16:25:37 -0400 Subject: [PATCH 5/5] more cleanup --- Source/PluginProcessor.cpp | 122 +------------------------------------ Source/PluginProcessor.h | 1 - 2 files changed, 1 insertion(+), 122 deletions(-) diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 34d3d01..27cdaa2 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -89,18 +89,12 @@ void ConekoAudioProcessor::prepareToPlay(double sampleRate, spec.numChannels = getTotalNumOutputChannels(); spec.maximumBlockSize = samplesPerBlock; - // soundtouch.setSampleRate((uint)sampleRate); - // soundtouch.setChannels(1); - inputGainer.prepare(spec); inputGainer.reset(); outputGainer.prepare(spec); outputGainer.reset(); dryWetMixer.prepare(spec); dryWetMixer.reset(); - // delay.prepare(spec); - // delay.setMaximumDelayInSamples((int)sampleRate); - // delay.reset(); convolver.prepare(spec); convolver.reset(); @@ -172,30 +166,12 @@ void ConekoAudioProcessor::processBlock(juce::AudioBuffer &buffer, inputGainer.setGainDecibels(inputGainValue->load()); outputGainer.setGainDecibels(outputGainValue->load()); dryWetMixer.setWetMixProportion(dryWetMixValue->load() / 100.0f); - // delay.setDelay(preDelayTimeValue->load() / 1000.0f * static_cast(this->getSampleRate())); auto block = juce::dsp::AudioBlock(buffer); auto context = juce::dsp::ProcessContextReplacing(block); inputGainer.process(context); dryWetMixer.pushDrySamples(block); convolver.process(context); - // delay.process(context); - -#if 0 - // set stereo width using mid/side technique - if (context.getInputBlock().getNumChannels() == 2) { - const float width = static_cast(stereoWidthValue->load()) / 100.0f; - for (int sample = 0; sample < context.getInputBlock().getNumSamples(); - ++sample) { - float left = context.getInputBlock().getSample(0, sample); - float right = context.getInputBlock().getSample(1, sample); - context.getOutputBlock().setSample( - 0, sample, left * (1 + width) / 2 + right * (1 - width) / 2); - context.getOutputBlock().setSample( - 1, sample, left * (1 - width) / 2 + right * (1 + width) / 2); - } - } -#endif lowShelfFilter.process(context); highShelfFilter.process(context); @@ -250,62 +226,6 @@ void ConekoAudioProcessor::loadImpulseResponse() { originalIRBuffer.getMagnitude(0, originalIRBuffer.getNumSamples()); originalIRBuffer.applyGain(1.0f / (globalMaxMagnitude + 0.01f)); -#if 0 - // trim IR signal - int numSamples = originalIRBuffer.getNumSamples(); - int blkSize = static_cast(std::floor(this->getSampleRate()) / 100); - int startBlockNum = 0; - int endBlockNum = numSamples / blkSize; - float localMaxMagnitude = 0.0f; - while ((startBlockNum + 1) * blkSize < numSamples) { - localMaxMagnitude = - originalIRBuffer.getMagnitude(startBlockNum * blkSize, blkSize); - // find the start position of IR - if (localMaxMagnitude > 0.001) { - break; - } - ++startBlockNum; - } - localMaxMagnitude = 0.0f; - while ((endBlockNum - 1) * blkSize > 0) { - --endBlockNum; - localMaxMagnitude = - originalIRBuffer.getMagnitude(endBlockNum * blkSize, blkSize); - // find the time to decay by 60 dB (T60) - if (localMaxMagnitude > 0.001) { - break; - } - } - - int trimmedNumSamples; - if (endBlockNum * blkSize < numSamples) { - trimmedNumSamples = (endBlockNum - startBlockNum) * blkSize - 1; - } else { - trimmedNumSamples = numSamples - startBlockNum * blkSize; - } - modifiedIRBuffer.setSize(originalIRBuffer.getNumChannels(), trimmedNumSamples, - false, true, false); - for (int channel = 0; channel < originalIRBuffer.getNumChannels(); - ++channel) { - for (int sample = 0; sample < trimmedNumSamples; ++sample) { - modifiedIRBuffer.setSample( - channel, sample, - originalIRBuffer.getSample(channel, - sample + startBlockNum * blkSize)); - } - } - - originalIRBuffer.makeCopyOf(modifiedIRBuffer); - - auto decayTimeParam = apvts.getParameter("DecayTime"); - double decayTime = - static_cast(trimmedNumSamples) / this->getSampleRate(); - decayTimeParam->beginChangeGesture(); - decayTimeParam->setValueNotifyingHost( - decayTimeParam->convertTo0to1(static_cast(decayTime))); - decayTimeParam->endChangeGesture(); -#endif - updateImpulseResponse(originalIRBuffer); } @@ -317,52 +237,12 @@ void ConekoAudioProcessor::updateImpulseResponse( juce::dsp::Convolution::Normalise::yes); } +// TODO: remove this since there aren't any more IR parameters? void ConekoAudioProcessor::updateIRParameters() { if (originalIRBuffer.getNumSamples() < 1) { return; } -#if 0 - // stretch IR according to decay time - // auto decayTimeValue = apvts.getRawParameterValue("DecayTime"); - // int decaySample = static_cast(std::round(decayTimeValue->load() * this->getSampleRate())); - // double stretchRatio = originalIRBuffer.getNumSamples() / static_cast(decaySample); - - int numChannels = originalIRBuffer.getNumChannels(); - // soundtouch.setTempo(stretchRatio); - modifiedIRBuffer.setSize(numChannels, decaySample, false, true, false); - for (int channel = 0; channel < numChannels; ++channel) { - soundtouch.putSamples(originalIRBuffer.getReadPointer(channel), - originalIRBuffer.getNumSamples()); - soundtouch.receiveSamples(modifiedIRBuffer.getWritePointer(channel), - decaySample); - soundtouch.clear(); - } -#endif - - // delay IR according to pre-delay time - // auto preDelayTimeValue = apvts.getRawParameterValue("PreDelayTime"); - // int preDelaySample = static_cast(std::round(preDelayTimeValue->load()) - // / - // 1000 * this->getSampleRate()); - // juce::AudioBuffer tempBuffer(modifiedIRBuffer); - // modifiedIRBuffer.setSize(numChannels, - // preDelaySample + tempBuffer.getNumSamples(), false, - // false, false); - // modifiedIRBuffer.clear(); - // for (int channel = 0; channel < numChannels; ++channel) { - // modifiedIRBuffer.copyFrom(channel, preDelaySample, - // tempBuffer.getReadPointer(channel), - // tempBuffer.getNumSamples()); - //} - -#if 0 - // reverse of the IR - auto isReversed = apvts.getRawParameterValue("Reversed"); - if (isReversed->load() != 0.0) { - modifiedIRBuffer.reverse(0, modifiedIRBuffer.getNumSamples()); - } -#endif updateImpulseResponse(originalIRBuffer); } diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index 97380ba..b25575d 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -8,7 +8,6 @@ #pragma once -// #include "../soundtouch/SoundTouch.h" #include //==============================================================================