mirror of
https://codeberg.org/armin/saftpumpe.git
synced 2026-09-01 04:10:46 +02:00
add bypass parameter and DSP bypass logic
This commit is contained in:
parent
a82649e41e
commit
bd9aa2fa67
2 changed files with 58 additions and 4 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
#include <juce_audio_processors/juce_audio_processors.h>
|
||||
#include <juce_dsp/juce_dsp.h>
|
||||
#include "CompressorDSP.h"
|
||||
|
||||
class SaftpumpeProcessor : public juce::AudioProcessor {
|
||||
|
|
@ -39,6 +40,7 @@ public:
|
|||
static constexpr const char* makeupID = "makeup";
|
||||
static constexpr const char* mixID = "mix";
|
||||
static constexpr const char* autoReleaseID = "autoRelease";
|
||||
static constexpr const char* bypassID = "bypass";
|
||||
|
||||
juce::AudioProcessorValueTreeState parameters;
|
||||
|
||||
|
|
@ -46,11 +48,25 @@ public:
|
|||
float getInputLevel() const { return currentInputLevel; }
|
||||
float getOutputLevel() const { return currentOutputLevel; }
|
||||
|
||||
bool isSpectrumMode() const { return spectrumMode; }
|
||||
void setSpectrumMode(bool on) { spectrumMode = on; }
|
||||
|
||||
static constexpr int scopeSize = 512;
|
||||
std::array<float, scopeSize> inputScope{};
|
||||
std::array<float, scopeSize> outputScope{};
|
||||
int scopeIndex = 0;
|
||||
|
||||
static constexpr int fftOrder = 10;
|
||||
static constexpr int fftSize = 1 << fftOrder;
|
||||
std::array<float, fftSize> fftInput{};
|
||||
std::array<float, fftSize> fftOutput{};
|
||||
int fftIndex = 0;
|
||||
juce::dsp::FFT fft{ fftOrder };
|
||||
juce::dsp::WindowingFunction<float> window{ fftSize, juce::dsp::WindowingFunction<float>::hann, true };
|
||||
std::array<float, fftSize / 2> inputSpectrum{};
|
||||
std::array<float, fftSize / 2> outputSpectrum{};
|
||||
bool spectrumMode = false;
|
||||
|
||||
private:
|
||||
CompressorDSP compressorL;
|
||||
CompressorDSP compressorR;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue