Lade till visuella mätare på Gate och Kompressor

This commit is contained in:
crille committed 2026-11-21 14:02:18 +01:00
1 parent 5b1d22c745
commit f0570b1313
4 files changed
+300 -43

No files matched your search

+13
View File
@@ -1,5 +1,6 @@
#pragma once
#include <JuceHeader.h>
#include <atomic>
class CrilleBassStripAudioProcessor final : public juce::AudioProcessor
{
@@ -30,12 +31,24 @@ public:
juce::AudioProcessorValueTreeState apvts;
static juce::AudioProcessorValueTreeState::ParameterLayout createParameterLayout();
float getGateInputLevelDb() const noexcept { return gateInputLevelDb.load(); }
float getCompressorInputLevelDb() const noexcept { return compressorInputLevelDb.load(); }
float getCompressorGainReductionDb() const noexcept { return compressorGainReductionDb.load(); }
private:
using Filter = juce::dsp::IIR::Filter<float>;
juce::dsp::Compressor<float> compressor;
juce::dsp::ProcessorDuplicator<Filter, juce::dsp::IIR::Coefficients<float>> lowShelf, lowMid, mid, highShelf;
double currentSampleRate = 44100.0;
std::vector<float> gateEnvelope;
std::atomic<float> gateInputLevelDb { -80.0f };
std::atomic<float> compressorInputLevelDb { -80.0f };
std::atomic<float> compressorGainReductionDb { 0.0f };
void updateFilters();
static float getBufferPeak(const juce::AudioBuffer<float>& buffer) noexcept;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CrilleBassStripAudioProcessor)
};