commit ded4f8698994d0015319a3c8ed834867b48b2631
parent d20a96228371dbda65f04c02b5f6c206c687a74f
Author: Keith <[email protected]>
Date: Thu, 13 Oct 2022 06:56:08 -0500
Added dc blocker, lowered master volume, added vol ramp on loading
Diffstat:
3 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
@@ -1,15 +1,15 @@
cmake_minimum_required(VERSION 3.15)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12" CACHE STRING "Minimum OS X deployment target")
-project(Proteus VERSION 1.0.0)
+project(Proteus VERSION 1.1.0)
set(CMAKE_CXX_STANDARD 17)
add_subdirectory(modules)
include_directories(modules)
-#juce_set_aax_sdk_path(C:/SDKs/AAX_SDK/)
+juce_set_aax_sdk_path(C:/SDKs/AAX_SDK/)
-set(JUCE_FORMATS AU VST3 Standalone)
+set(JUCE_FORMATS AU VST3)
# Build LV2 only on Linux
if(UNIX AND NOT APPLE)
diff --git a/src/PluginProcessor.cpp b/src/PluginProcessor.cpp
@@ -31,6 +31,12 @@ ProteusAudioProcessor::ProteusAudioProcessor()
{
driveParam = treeState.getRawParameterValue (GAIN_ID);
masterParam = treeState.getRawParameterValue (MASTER_ID);
+
+ pauseVolume = 3;
+
+ // Check if this works to load without GUI -> This doesnt work
+ //if (auto* editor = dynamic_cast<ProteusAudioProcessorEditor*> (getActiveEditor()))
+ // editor->loadFromFolder();
}
ProteusAudioProcessor::~ProteusAudioProcessor()
@@ -105,6 +111,8 @@ void ProteusAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBloc
// Use this method as the place to do any pre-playback
// initialisation that you need..
+ *dcBlocker.state = *dsp::IIR::Coefficients<float>::makeHighPass (sampleRate, 35.0f);
+
// prepare resampler for target sample rate: 44.1 kHz
constexpr double targetSampleRate = 44100.0;
//resampler.prepareWithTargetSampleRate ({ sampleRate, (uint32) samplesPerBlock, 1 }, targetSampleRate);
@@ -114,6 +122,8 @@ void ProteusAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBloc
dsp::ProcessSpec specMono { sampleRate, static_cast<uint32> (samplesPerBlock), 1 };
dsp::ProcessSpec spec{ sampleRate, static_cast<uint32> (samplesPerBlock), 2 };
+ dcBlocker.prepare (spec);
+
LSTM.reset();
LSTM2.reset();
@@ -162,6 +172,7 @@ void ProteusAudioProcessor::processBlock (AudioBuffer<float>& buffer, MidiBuffer
const int numInputChannels = getTotalNumInputChannels();
dsp::AudioBlock<float> block(buffer);
+ dsp::ProcessContextReplacing<float> context(block);
// Overdrive Pedal ==================================================================
if (fw_state == 1) {
@@ -207,16 +218,16 @@ void ProteusAudioProcessor::processBlock (AudioBuffer<float>& buffer, MidiBuffer
resampler.processOut(block44k, block);
}
-
+ dcBlocker.process(context);
// Master Volume
// Apply ramped changes for gain smoothing
if (masterValue == previousMasterValue)
{
- buffer.applyGain(masterValue*1.2);
+ buffer.applyGain(masterValue);
}
else {
- buffer.applyGainRamp(0, (int) buffer.getNumSamples(), previousMasterValue * 1.2, masterValue * 1.2);
+ buffer.applyGainRamp(0, (int) buffer.getNumSamples(), previousMasterValue, masterValue);
previousMasterValue = masterValue;
}
@@ -225,9 +236,9 @@ void ProteusAudioProcessor::processBlock (AudioBuffer<float>& buffer, MidiBuffer
if (pauseVolume > 2)
buffer.applyGain(0.0);
else if (pauseVolume == 2)
- buffer.applyGainRamp(0, (int)buffer.getNumSamples(), 0, masterValue * 1.2 / 2);
+ buffer.applyGainRamp(0, (int)buffer.getNumSamples(), 0, masterValue / 2);
else
- buffer.applyGainRamp(0, (int)buffer.getNumSamples(), masterValue * 1.2 / 2, masterValue * 1.2);
+ buffer.applyGainRamp(0, (int)buffer.getNumSamples(), masterValue / 2, masterValue);
pauseVolume -= 1;
}
}
diff --git a/src/PluginProcessor.h b/src/PluginProcessor.h
@@ -99,6 +99,8 @@ private:
RT_LSTM LSTM;
RT_LSTM LSTM2;
+ dsp::ProcessorDuplicator<dsp::IIR::Filter<float>, dsp::IIR::Coefficients<float>> dcBlocker;
+
chowdsp::ResampledProcess<chowdsp::ResamplingTypes::SRCResampler<>> resampler;
//==============================================================================