commit 2f8efc4f678657d388064910be83b2c932f5cea1
parent 1daec264f11641b074cbf4be36f690b0cd2715f5
Author: jatinchowdhury18 <[email protected]>
Date: Thu, 14 Jan 2021 19:19:47 -0800
Fix gain staging bug in Renoise (#122)
Co-authored-by: jatinchowdhury18 <[email protected]>
Diffstat:
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/Plugin/Source/PluginProcessor.cpp b/Plugin/Source/PluginProcessor.cpp
@@ -48,6 +48,12 @@ ChowtapeModelAudioProcessor::ChowtapeModelAudioProcessor()
flutter.initialisePlots (magicState);
LookAndFeel::setDefaultLookAndFeel (&myLNF);
+
+ PluginHostType hostType;
+ if (hostType.isRenoise()) // Renoise has different gain staging, so we handle that here
+ toneControl.setDBScale (12.0f);
+ else
+ toneControl.setDBScale (18.0f);
}
ChowtapeModelAudioProcessor::~ChowtapeModelAudioProcessor()
diff --git a/Plugin/Source/Processors/Hysteresis/ToneControl.cpp b/Plugin/Source/Processors/Hysteresis/ToneControl.cpp
@@ -4,7 +4,6 @@ namespace
{
constexpr double slewTime = 0.05;
constexpr float transFreq = 500.0f;
- constexpr float dbScale = 18.0f;
}
ToneStage::ToneStage()
diff --git a/Plugin/Source/Processors/Hysteresis/ToneControl.h b/Plugin/Source/Processors/Hysteresis/ToneControl.h
@@ -27,6 +27,7 @@ public:
static void createParameterLayout (std::vector<std::unique_ptr<RangedAudioParameter>>& params);
void prepare (double sampleRate);
+ void setDBScale (float newDBScale) { dbScale = newDBScale; };
void processBlockIn (AudioBuffer<float>& buffer);
void processBlockOut (AudioBuffer<float>& buffer);
@@ -39,6 +40,8 @@ private:
std::atomic<float>* trebleParam = nullptr;
std::atomic<float>* tFreqParam = nullptr;
+ float dbScale = 1.0f;
+
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ToneControl)
};