Almost finished
This commit is contained in:
parent
0eb6325e2e
commit
f270e4613e
File diff suppressed because it is too large
Load Diff
@ -11499,7 +11499,7 @@ static const unsigned char temp_binary_data_14[] =
|
||||
"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 32\">\n"
|
||||
" <g id=\"Ebene_6\" data-name=\"Ebene 6\">\n"
|
||||
" <rect x=\"0\" y=\"0\" width=\"64\" height=\"32\" fill=\"#171a1a\"/>\n"
|
||||
" <polygon points=\"0 32 2 30 32 16 62 2 64 0 64 32 0 32\" fill=\"#262b2b\"/>\n"
|
||||
" <polygon points=\"64 0 62 2 32 16 2 30 0 32 0 0 64 0\" fill=\"#262b2b\"/>\n"
|
||||
" </g>\n"
|
||||
" <g id=\"Ebene_2\" data-name=\"Ebene 2\">\n"
|
||||
" <rect x=\"2\" y=\"2\" width=\"60\" height=\"28\" fill=\"#3db7b7\"/>\n"
|
||||
@ -11525,51 +11525,51 @@ static const unsigned char temp_binary_data_14[] =
|
||||
" </g>\n"
|
||||
" </g>\n"
|
||||
" <g id=\"Ebene_3_Kopie\" data-name=\"Ebene 3 Kopie\">\n"
|
||||
" <rect x=\"8\" y=\"8\" width=\"48\" height=\"16\" fill=\"#fffcfc\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"2 30 8 24 56 24 62 30 2 30\" fill=\"#fffcfc\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"62 2 56 8 8 8 2 2 62 2\" fill=\"#fffcfc\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"56 24 56 8 62 2 62 30 56 24\" fill=\"#fffcfc\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"8 8 8 24 2 30 2 2 8 8\" fill=\"#fffcfc\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"8 24 5 27 2 30 2 24 8 24\" fill=\"#d1d1d1\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"2 30 5 27 8 24 8 30 2 30\" fill=\"#fff\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"8 30 8 24 14 27 20 30 8 30\" fill=\"#d1d1d1\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"2 8 5 12 8 16 2 16 2 8\" fill=\"#d1d1d1\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"20 30 26 27 32 24 32 30 20 30\" fill=\"#fff\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"32 24 26 27 20 30 20 24 32 24\" fill=\"#d1d1d1\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"8 16 5 12 2 8 8 8 8 16\" fill=\"#fff\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"8 16 5 20 2 24 2 16 8 16\" fill=\"#d1d1d1\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"20 24 20 30 14 27 8 24 20 24\" fill=\"#fff\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"56 30 56 24 50 27 44 30 56 30\" fill=\"#d1d1d1\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"44 30 38 27 32 24 32 30 44 30\" fill=\"#fff\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"32 24 38 27 44 30 44 24 32 24\" fill=\"#d1d1d1\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"44 24 44 30 50 27 56 24 44 24\" fill=\"#fff\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"32 2 32 8 26 5 20 2 32 2\" fill=\"#fff\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"20 2 14 5 8 8 8 2 20 2\" fill=\"#d1d1d1\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"2 24 5 20 8 16 8 24 2 24\" fill=\"#fff\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"8 8 14 5 20 2 20 8 8 8\" fill=\"#fff\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"8 24 20 20 32 16 32 24 8 24\" fill=\"#fff\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"56 24 44 20 32 16 32 24 56 24\" fill=\"#fff\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"56 8 44 12 32 16 32 8 56 8\" fill=\"#fff\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"8 8 20 12 32 16 32 8 8 8\" fill=\"#fff\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"32 16 20 12 8 8 8 16 32 16\" fill=\"#d1d1d1\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"32 16 44 12 56 8 56 16 32 16\" fill=\"#d1d1d1\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"32 16 20 20 8 24 8 16 32 16\" fill=\"#d1d1d1\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"32 16 44 20 56 24 56 16 32 16\" fill=\"#d1d1d1\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"20 8 20 2 26 5 32 8 20 8\" fill=\"#d1d1d1\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"32 2 32 8 38 5 44 2 32 2\" fill=\"#fff\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"44 2 50 5 56 8 56 2 44 2\" fill=\"#d1d1d1\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"56 8 50 5 44 2 44 8 56 8\" fill=\"#fff\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"44 8 44 2 38 5 32 8 44 8\" fill=\"#d1d1d1\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"8 2 8 8 5 5 2 2 8 2\" fill=\"#fff\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"2 8 2 2 5 5 8 8 2 8\" fill=\"#d1d1d1\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"56 24 59 27 62 30 62 24 56 24\" fill=\"#d1d1d1\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"62 8 59 12 56 16 62 16 62 8\" fill=\"#d1d1d1\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"56 16 59 12 62 8 56 8 56 16\" fill=\"#fff\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"56 16 59 20 62 24 56 24 56 16\" fill=\"#fff\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"62 30 59 27 56 24 56 30 62 30\" fill=\"#fff\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"56 16 59 20 62 24 62 16 56 16\" fill=\"#d1d1d1\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"56 2 56 8 59 5 62 2 56 2\" fill=\"#fff\" opacity=\".21\"/>\n"
|
||||
" <polygon points=\"62 8 62 2 59 5 56 8 62 8\" fill=\"#d1d1d1\" opacity=\".21\"/>\n"
|
||||
" <rect x=\"8\" y=\"8\" width=\"48\" height=\"16\" fill=\"#fffcfc\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"2 30 8 24 56 24 62 30 2 30\" fill=\"#fffcfc\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"62 2 56 8 8 8 2 2 62 2\" fill=\"#fffcfc\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"56 24 56 8 62 2 62 30 56 24\" fill=\"#fffcfc\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"8 8 8 24 2 30 2 2 8 8\" fill=\"#fffcfc\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"8 24 5 27 2 30 2 24 8 24\" fill=\"#d1d1d1\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"2 30 5 27 8 24 8 30 2 30\" fill=\"#fff\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"8 30 8 24 14 27 20 30 8 30\" fill=\"#d1d1d1\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"2 8 5 12 8 16 2 16 2 8\" fill=\"#d1d1d1\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"20 30 26 27 32 24 32 30 20 30\" fill=\"#fff\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"32 24 26 27 20 30 20 24 32 24\" fill=\"#d1d1d1\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"8 16 5 12 2 8 8 8 8 16\" fill=\"#fff\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"8 16 5 20 2 24 2 16 8 16\" fill=\"#d1d1d1\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"20 24 20 30 14 27 8 24 20 24\" fill=\"#fff\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"56 30 56 24 50 27 44 30 56 30\" fill=\"#d1d1d1\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"44 30 38 27 32 24 32 30 44 30\" fill=\"#fff\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"32 24 38 27 44 30 44 24 32 24\" fill=\"#d1d1d1\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"44 24 44 30 50 27 56 24 44 24\" fill=\"#fff\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"32 2 32 8 26 5 20 2 32 2\" fill=\"#fff\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"20 2 14 5 8 8 8 2 20 2\" fill=\"#d1d1d1\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"2 24 5 20 8 16 8 24 2 24\" fill=\"#fff\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"8 8 14 5 20 2 20 8 8 8\" fill=\"#fff\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"8 24 20 20 32 16 32 24 8 24\" fill=\"#fff\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"56 24 44 20 32 16 32 24 56 24\" fill=\"#fff\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"56 8 44 12 32 16 32 8 56 8\" fill=\"#fff\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"8 8 20 12 32 16 32 8 8 8\" fill=\"#fff\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"32 16 20 12 8 8 8 16 32 16\" fill=\"#d1d1d1\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"32 16 44 12 56 8 56 16 32 16\" fill=\"#d1d1d1\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"32 16 20 20 8 24 8 16 32 16\" fill=\"#d1d1d1\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"32 16 44 20 56 24 56 16 32 16\" fill=\"#d1d1d1\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"20 8 20 2 26 5 32 8 20 8\" fill=\"#d1d1d1\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"32 2 32 8 38 5 44 2 32 2\" fill=\"#fff\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"44 2 50 5 56 8 56 2 44 2\" fill=\"#d1d1d1\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"56 8 50 5 44 2 44 8 56 8\" fill=\"#fff\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"44 8 44 2 38 5 32 8 44 8\" fill=\"#d1d1d1\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"8 2 8 8 5 5 2 2 8 2\" fill=\"#fff\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"2 8 2 2 5 5 8 8 2 8\" fill=\"#d1d1d1\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"56 24 59 27 62 30 62 24 56 24\" fill=\"#d1d1d1\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"62 8 59 12 56 16 62 16 62 8\" fill=\"#d1d1d1\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"56 16 59 12 62 8 56 8 56 16\" fill=\"#fff\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"56 16 59 20 62 24 56 24 56 16\" fill=\"#fff\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"62 30 59 27 56 24 56 30 62 30\" fill=\"#fff\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"56 16 59 20 62 24 62 16 56 16\" fill=\"#d1d1d1\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"56 2 56 8 59 5 62 2 56 2\" fill=\"#fff\" opacity=\".17\"/>\n"
|
||||
" <polygon points=\"62 8 62 2 59 5 56 8 62 8\" fill=\"#d1d1d1\" opacity=\".17\"/>\n"
|
||||
" </g>\n"
|
||||
"</svg>";
|
||||
|
||||
@ -11692,7 +11692,7 @@ const char* getNamedResource (const char* resourceNameUTF8, int& numBytes)
|
||||
case 0x31532e06: numBytes = 353; return low_cut_icon_svg;
|
||||
case 0x7e8ca05e: numBytes = 410; return low_shelf_icon_svg;
|
||||
case 0x4df4bf1e: numBytes = 350; return preset_menu_icon_svg;
|
||||
case 0xd842aaab: numBytes = 6343; return crystalize_button_active_icon_svg;
|
||||
case 0xd842aaab: numBytes = 6341; return crystalize_button_active_icon_svg;
|
||||
case 0x885a7642: numBytes = 6279; return crystalize_button_passive_icon_svg;
|
||||
case 0xe49e0f15: numBytes = 406; return bypass_icon_svg;
|
||||
default: break;
|
||||
|
||||
@ -51,7 +51,7 @@ namespace BinaryData
|
||||
const int preset_menu_icon_svgSize = 350;
|
||||
|
||||
extern const char* crystalize_button_active_icon_svg;
|
||||
const int crystalize_button_active_icon_svgSize = 6343;
|
||||
const int crystalize_button_active_icon_svgSize = 6341;
|
||||
|
||||
extern const char* crystalize_button_passive_icon_svg;
|
||||
const int crystalize_button_passive_icon_svgSize = 6279;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -19,9 +19,11 @@
|
||||
using AXIOM::DesignSystem;
|
||||
using Components = DesignSystem::Components;
|
||||
using SliderStyles = Components::SliderStyles;
|
||||
|
||||
class SpectrumAnalyzer {
|
||||
public:
|
||||
SpectrumAnalyzer(AudioFIFO& fifoRef, CrystalizerEQAudioProcessor& processor) : audioFIFO(fifoRef), audioProcessor(processor) {
|
||||
public:
|
||||
SpectrumAnalyzer(AudioFIFO &fifoRef, CrystalizerEQAudioProcessor &processor) : audioFIFO(fifoRef),
|
||||
audioProcessor(processor) {
|
||||
fftData.resize(2 * FFTSIZE);
|
||||
magnitudes.resize(BINS);
|
||||
magnitudesDb.resize(BINS);
|
||||
@ -33,15 +35,14 @@ class SpectrumAnalyzer {
|
||||
peakHoldMagnitudesDb.resize(BINS);
|
||||
DELTAT = static_cast<float>(HOPSIZE) / static_cast<float>(sampleRate);
|
||||
renderValuesDb.resize(BINS);
|
||||
|
||||
|
||||
}
|
||||
|
||||
~SpectrumAnalyzer() = default;
|
||||
|
||||
|
||||
AudioFIFO& audioFIFO;
|
||||
AudioFIFO &audioFIFO;
|
||||
|
||||
CrystalizerEQAudioProcessor& audioProcessor;
|
||||
CrystalizerEQAudioProcessor &audioProcessor;
|
||||
|
||||
static constexpr int FFTSIZE = 4096;
|
||||
|
||||
@ -52,7 +53,7 @@ class SpectrumAnalyzer {
|
||||
juce::Array<float> fftFrame;
|
||||
|
||||
//CHANGE FOR LOWER/HIGHER EMA-SMOOTHING //LOWER VALUE -> MORE SMOOTHING/SLOW RESPONSE -- HIGHER VALUE -> LESS SMOOTHING/FAST RESPONSE //MAX VALUE = 1.f
|
||||
float smoothingFactor = 0.3f;
|
||||
float smoothingFactor = 0.5f;
|
||||
|
||||
|
||||
void processSamples();
|
||||
@ -62,21 +63,20 @@ class SpectrumAnalyzer {
|
||||
void applyWindowOnFftFrame(std::vector<float> &fullFrame);
|
||||
|
||||
juce::dsp::WindowingFunction<float> window
|
||||
{
|
||||
FFTSIZE,
|
||||
juce::dsp::WindowingFunction<float>::hann
|
||||
};
|
||||
{
|
||||
FFTSIZE,
|
||||
juce::dsp::WindowingFunction<float>::hann
|
||||
};
|
||||
|
||||
void processWindowedFrame(std::vector<float> &windowedFrame);
|
||||
|
||||
|
||||
static constexpr int FFTORDER = 12;
|
||||
juce::dsp::FFT fft { FFTORDER };
|
||||
juce::dsp::FFT fft{FFTORDER};
|
||||
|
||||
std::vector<float> fftData;
|
||||
|
||||
|
||||
|
||||
const float MINDB = -90.f;
|
||||
const float MAXDB = 0.f;
|
||||
|
||||
@ -103,7 +103,7 @@ class SpectrumAnalyzer {
|
||||
std::vector<double> freqPerBin;
|
||||
|
||||
//CHANGE FOR FASTER FALLOFF -- VALUE IS IN DB/S
|
||||
const float FALLOFFRATE = 120.f;
|
||||
const float FALLOFFRATE = 240.f;
|
||||
|
||||
float DELTAT = 0.f;
|
||||
|
||||
@ -114,37 +114,43 @@ class SpectrumAnalyzer {
|
||||
const float MAXFREQ = static_cast<float>(sampleRate) / 2;
|
||||
|
||||
void fillFftDataFromFrame(std::vector<float> &windowedFrame);
|
||||
void buildMagnitudeSpectrum();
|
||||
void convertToDb();
|
||||
void applySmoothing();
|
||||
void applyEMA();
|
||||
void applyFreqSmoothing();
|
||||
void applyPeakHoldAndFalloff();
|
||||
std::vector<float> getRenderValues();
|
||||
|
||||
void buildMagnitudeSpectrum();
|
||||
|
||||
void convertToDb();
|
||||
|
||||
void applySmoothing();
|
||||
|
||||
void applyEMA();
|
||||
|
||||
void applyFreqSmoothing();
|
||||
|
||||
void applyPeakHoldAndFalloff();
|
||||
|
||||
std::vector<float> getRenderValues();
|
||||
};
|
||||
|
||||
|
||||
class CrystalizerEQAudioProcessorEditor : public juce::AudioProcessorEditor, private juce::Timer
|
||||
|
||||
{
|
||||
class CrystalizerEQAudioProcessorEditor : public juce::AudioProcessorEditor, private juce::Timer {
|
||||
public:
|
||||
CrystalizerEQAudioProcessorEditor(CrystalizerEQAudioProcessor &);
|
||||
|
||||
CrystalizerEQAudioProcessorEditor (CrystalizerEQAudioProcessor&);
|
||||
~CrystalizerEQAudioProcessorEditor() override;
|
||||
|
||||
void paintAnalyzer(juce::Graphics &g);
|
||||
|
||||
void paintModeBoxBorders(juce::Graphics &g);
|
||||
|
||||
void paintBorderLines(juce::Graphics& g);
|
||||
void paintBorderLines(juce::Graphics &g);
|
||||
|
||||
//===================================================================
|
||||
void timerCallback();
|
||||
void paint (juce::Graphics&) override;
|
||||
|
||||
void paint(juce::Graphics &) override;
|
||||
|
||||
|
||||
void resized() override;
|
||||
|
||||
void resetAllCheckboxes();
|
||||
|
||||
using SliderAttach = juce::AudioProcessorValueTreeState::SliderAttachment;
|
||||
@ -153,15 +159,15 @@ public:
|
||||
|
||||
using ComboBoxAttach = juce::AudioProcessorValueTreeState::ComboBoxAttachment;
|
||||
|
||||
juce::Slider testNoiseSlider,
|
||||
lowBandFreqSlider, lowBandSlopeSlider, lowBandGainSlider, lowBandQSlider,
|
||||
peak1FreqSlider, peak1GainSlider, peak1QSlider,
|
||||
peak2FreqSlider, peak2GainSlider, peak2QSlider,
|
||||
peak3FreqSlider, peak3GainSlider, peak3QSlider,
|
||||
highBandFreqSlider, highBandSlopeSlider, highBandGainSlider, highBandQSlider,
|
||||
inputSlider, outputSlider;
|
||||
juce::Slider
|
||||
lowBandFreqSlider, lowBandSlopeSlider, lowBandGainSlider, lowBandQSlider,
|
||||
peak1FreqSlider, peak1GainSlider, peak1QSlider,
|
||||
peak2FreqSlider, peak2GainSlider, peak2QSlider,
|
||||
peak3FreqSlider, peak3GainSlider, peak3QSlider,
|
||||
highBandFreqSlider, highBandSlopeSlider, highBandGainSlider, highBandQSlider,
|
||||
inputSlider, outputSlider;
|
||||
|
||||
const juce::Array<juce::Slider*> sliders = {
|
||||
const juce::Array<juce::Slider *> sliders = {
|
||||
&lowBandGainSlider, &lowBandFreqSlider, &lowBandQSlider, &lowBandSlopeSlider,
|
||||
&peak1GainSlider, &peak1FreqSlider, &peak1QSlider,
|
||||
&peak2GainSlider, &peak2FreqSlider, &peak2QSlider,
|
||||
@ -170,68 +176,69 @@ public:
|
||||
&inputSlider, &outputSlider
|
||||
};
|
||||
|
||||
std::unique_ptr<SliderAttach> testNoiseAttach,
|
||||
lowBandFreqAttach, lowBandSlopeAttach, lowBandGainAttach, lowBandQAttach,
|
||||
peak1FreqAttach, peak1GainAttach, peak1QAttach,
|
||||
peak2FreqAttach, peak2GainAttach, peak2QAttach,
|
||||
peak3FreqAttach, peak3GainAttach, peak3QAttach,
|
||||
highBandFreqAttach, highBandSlopeAttach, highBandGainAttach, highBandQAttach,
|
||||
inputAttach, outputAttach;
|
||||
std::unique_ptr<SliderAttach>
|
||||
lowBandFreqAttach, lowBandSlopeAttach, lowBandGainAttach, lowBandQAttach,
|
||||
peak1FreqAttach, peak1GainAttach, peak1QAttach,
|
||||
peak2FreqAttach, peak2GainAttach, peak2QAttach,
|
||||
peak3FreqAttach, peak3GainAttach, peak3QAttach,
|
||||
highBandFreqAttach, highBandSlopeAttach, highBandGainAttach, highBandQAttach,
|
||||
inputAttach, outputAttach;
|
||||
|
||||
juce::Label titleLabel, testNoiseLabel,
|
||||
lowBandFreqLabel, lowBandSlopeLabel, lowBandGainLabel, lowBandQLabel, lowBandModeLabel,
|
||||
low12, low24, low36, low48, lowdBOctLabel,
|
||||
peak1FreqLabel, peak1GainLabel, peak1QLabel,
|
||||
peak2FreqLabel, peak2GainLabel, peak2QLabel,
|
||||
peak3FreqLabel, peak3GainLabel, peak3QLabel,
|
||||
highBandFreqLabel, highBandSlopeLabel, highBandGainLabel, highBandQLabel, highBandModeLabel,
|
||||
high12, high24, high36, high48, highdBOctLabel,
|
||||
inputLabel, outputLabel,
|
||||
presetBoxLabel;
|
||||
juce::Label titleLabel,
|
||||
lowBandFreqLabel, lowBandSlopeLabel, lowBandGainLabel, lowBandQLabel, lowBandModeLabel,
|
||||
low12, low24, low36, low48, lowdBOctLabel,
|
||||
peak1FreqLabel, peak1GainLabel, peak1QLabel,
|
||||
peak2FreqLabel, peak2GainLabel, peak2QLabel,
|
||||
peak3FreqLabel, peak3GainLabel, peak3QLabel,
|
||||
highBandFreqLabel, highBandSlopeLabel, highBandGainLabel, highBandQLabel, highBandModeLabel,
|
||||
high12, high24, high36, high48, highdBOctLabel,
|
||||
inputLabel, outputLabel,
|
||||
presetBoxLabel;
|
||||
|
||||
const juce::Array<juce::Label*> sliderLabels = {
|
||||
const juce::Array<juce::Label *> sliderLabels = {
|
||||
&lowBandFreqLabel, &lowBandSlopeLabel, &lowBandGainLabel, &lowBandQLabel, &lowBandModeLabel, &lowdBOctLabel,
|
||||
&peak1FreqLabel, &peak1GainLabel, &peak1QLabel,
|
||||
&peak2FreqLabel, &peak2GainLabel, &peak2QLabel,
|
||||
&peak3FreqLabel, &peak3GainLabel, &peak3QLabel,
|
||||
&highBandFreqLabel, &highBandSlopeLabel, &highBandGainLabel, &highBandQLabel, &highBandModeLabel, &highdBOctLabel,
|
||||
&inputLabel, &outputLabel
|
||||
&peak1FreqLabel, &peak1GainLabel, &peak1QLabel,
|
||||
&peak2FreqLabel, &peak2GainLabel, &peak2QLabel,
|
||||
&peak3FreqLabel, &peak3GainLabel, &peak3QLabel,
|
||||
&highBandFreqLabel, &highBandSlopeLabel, &highBandGainLabel, &highBandQLabel, &highBandModeLabel,
|
||||
&highdBOctLabel,
|
||||
&inputLabel, &outputLabel
|
||||
};
|
||||
const juce::Array<juce::Label*> slopeLabels = {
|
||||
const juce::Array<juce::Label *> slopeLabels = {
|
||||
&low12, &low24, &low36, &low48,
|
||||
&high12, &high24, &high36, &high48
|
||||
};
|
||||
|
||||
|
||||
juce::TextButton resetButton, savePresetButton, deletePresetButton;
|
||||
|
||||
juce::TextButton testNoiseButton, resetButton, savePresetButton, deletePresetButton;
|
||||
juce::ToggleButton masterBypassButton, crystalizeButton, peak1BypassButton, peak2BypassButton, peak3BypassButton,
|
||||
presetMenuButton;
|
||||
|
||||
juce::ToggleButton masterBypassButton, crystalizeButton, peak1BypassButton, peak2BypassButton, peak3BypassButton, presetMenuButton;
|
||||
|
||||
const juce::Array<juce::ToggleButton*> peakBypassButtons = {&peak1BypassButton, &peak2BypassButton, &peak3BypassButton};
|
||||
const juce::Array<juce::ToggleButton *> peakBypassButtons = {
|
||||
&peak1BypassButton, &peak2BypassButton, &peak3BypassButton
|
||||
};
|
||||
|
||||
juce::ComboBox presetBox;
|
||||
|
||||
juce::Component lowBandModeBox, highBandModeBox;
|
||||
|
||||
juce::Array<juce::ToggleButton*> lowBandModeButtons, highBandModeButtons;
|
||||
juce::Array<juce::ToggleButton *> lowBandModeButtons, highBandModeButtons;
|
||||
|
||||
std::array<bool, 4> lowBandBools, highBandBools;
|
||||
|
||||
|
||||
juce::ToggleButton lowBypass, lowCut, lowBell, lowShelf,
|
||||
highBypass, highCut, highBell, highShelf;
|
||||
highBypass, highCut, highBell, highShelf;
|
||||
|
||||
DesignSystem::ClickableTextEditor presetNameInput;
|
||||
|
||||
juce::TextEditor presetNameInput;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// This reference is provided as a quick way for your editor to
|
||||
// access the processor object that created it.
|
||||
CrystalizerEQAudioProcessor& audioProcessor;
|
||||
|
||||
|
||||
CrystalizerEQAudioProcessor &audioProcessor;
|
||||
|
||||
|
||||
void setKnobVisibility();
|
||||
@ -253,9 +260,13 @@ private:
|
||||
void setupToggleButtons();
|
||||
|
||||
void disableLowBand(float target);
|
||||
|
||||
void disableLowMidBand(float target);
|
||||
|
||||
void disableMidBand(float target);
|
||||
|
||||
void disableHighMidBand(float target);
|
||||
|
||||
void disableHighBand(float target);
|
||||
|
||||
void disableEverything(float target);
|
||||
@ -270,6 +281,10 @@ private:
|
||||
|
||||
void initPresetSystem();
|
||||
|
||||
void updateFrequencyRanges();
|
||||
|
||||
void updateModeButtons();
|
||||
|
||||
|
||||
std::unique_ptr<AXIOM::DesignSystem::Components::BaseSliderLookAndFeel> baseLookAndFeel;
|
||||
std::unique_ptr<DesignSystem::Components::GainSliderLookAndFeel> gainLookAndFeel;
|
||||
@ -284,6 +299,7 @@ private:
|
||||
std::unique_ptr<DesignSystem::PresetMenuLookAndFeel> presetMenuLookAndFeel;
|
||||
std::unique_ptr<DesignSystem::PresetButtonsLookAndFeel> presetButtonLookAndFeel;
|
||||
std::unique_ptr<DesignSystem::PresetComboBoxLookAndFeel> presetComboBoxLookAndFeel;
|
||||
std::unique_ptr<DesignSystem::PresetInputLookAndFeel> presetInputLookAndFeel;
|
||||
|
||||
|
||||
//SPECRTRUM ANALYZER
|
||||
@ -308,25 +324,31 @@ private:
|
||||
Component highMidFilterArea;
|
||||
Component highFilterArea;
|
||||
|
||||
const juce::Array<juce::Component*> filterAreas {
|
||||
const juce::Array<juce::Component *> filterAreas{
|
||||
&lowFilterArea, &lowMidFilterArea, &midFilterArea, &highMidFilterArea, &highFilterArea
|
||||
};
|
||||
|
||||
Component globalControlArea;
|
||||
|
||||
|
||||
|
||||
void scalePluginWindow(juce::Rectangle<int> area);
|
||||
|
||||
void setupMainGrid(juce::Rectangle<int> area);
|
||||
|
||||
void setupLowBandLayout();
|
||||
|
||||
void setupLowMidBandLayout();
|
||||
|
||||
void setupMidBandLayout();
|
||||
|
||||
void setupHighMidBandLayout();
|
||||
|
||||
void setupHighBandLayout();
|
||||
|
||||
void setupHeader();
|
||||
|
||||
void setupBody();
|
||||
|
||||
void setupFooter();
|
||||
|
||||
juce::Array<float> getReferenceCell();
|
||||
@ -344,13 +366,17 @@ private:
|
||||
|
||||
std::unique_ptr<juce::Drawable> logoDrawable;
|
||||
|
||||
DesignSystem::PresetMenu* test;
|
||||
juce::Component::SafePointer<DesignSystem::PresetMenu> presetMenuSafePtr;
|
||||
|
||||
bool inputFocused = false;
|
||||
|
||||
float mapFrequencyToX(float freq, float minFreq, float maxFreq, float width);
|
||||
|
||||
int getClosestBinForFrequency(float freq);
|
||||
void drawFrequencyGrid(juce::Graphics& g, const float dbRange);
|
||||
|
||||
void drawFrequencyGrid(juce::Graphics &g, const float dbRange);
|
||||
|
||||
float getInterpolatedDb(float exactBin);
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (CrystalizerEQAudioProcessorEditor)
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CrystalizerEQAudioProcessorEditor)
|
||||
};
|
||||
|
||||
@ -14,11 +14,6 @@ juce::AudioProcessorValueTreeState::ParameterLayout
|
||||
CrystalizerEQAudioProcessor::createParameterLayout() {
|
||||
std::vector<std::unique_ptr<juce::RangedAudioParameter>> params;
|
||||
|
||||
params.push_back (std::make_unique<juce::AudioParameterBool>(
|
||||
"TestNoiseEnabled", "Test Noise Enabled", false));
|
||||
|
||||
params.push_back (std::make_unique<juce::AudioParameterFloat>("TestNoiseLevel", "Test Noise Level", juce::NormalisableRange<float>(-60.f, 0.f, 0.1f), 0.f));
|
||||
|
||||
//LOW-BAND
|
||||
|
||||
params.push_back (std::make_unique<juce::AudioParameterFloat>(
|
||||
@ -429,7 +424,6 @@ void CrystalizerEQAudioProcessor::updateFilters()
|
||||
setCoeffs(rightChain.get<1>(), lowBand);
|
||||
leftChain .setBypassed<1>(false);
|
||||
rightChain.setBypassed<1>(false);
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
@ -512,7 +506,8 @@ void CrystalizerEQAudioProcessor::updateFilters()
|
||||
|
||||
|
||||
|
||||
|
||||
lowCutActive = (lowBandModes == 1);
|
||||
highCutActive = (highBandModes == 1);
|
||||
|
||||
}
|
||||
|
||||
@ -520,13 +515,14 @@ juce::String CrystalizerEQAudioProcessor::savePresetToFile() const {
|
||||
const auto nameInput = getPresetName();
|
||||
|
||||
|
||||
auto desktop = juce::File::getSpecialLocation(juce::File::userDesktopDirectory);
|
||||
auto appData = juce::File::getSpecialLocation(juce::File::userApplicationDataDirectory);
|
||||
|
||||
auto presetFolder = appData.getChildFile("AXIOM")
|
||||
.getChildFile("CrystalizerEQ")
|
||||
.getChildFile("Presets");
|
||||
|
||||
// Unterordner auf dem Desktop anlegen
|
||||
auto presetFolder = desktop.getChildFile("CrystalizerEQ_Presets");
|
||||
presetFolder.createDirectory();
|
||||
|
||||
// Datei vorbereiten
|
||||
auto file = presetFolder.getNonexistentChildFile(nameInput, ".xml");
|
||||
|
||||
juce::ValueTree preset ("Preset");
|
||||
@ -556,15 +552,12 @@ juce::String CrystalizerEQAudioProcessor::savePresetToFile() const {
|
||||
|
||||
void CrystalizerEQAudioProcessor::loadPreset(const juce::String &preset){
|
||||
|
||||
auto desktop = juce::File::getSpecialLocation(juce::File::userDesktopDirectory);
|
||||
auto appData = juce::File::getSpecialLocation(juce::File::userApplicationDataDirectory);
|
||||
auto presetFolder = appData.getChildFile("AXIOM")
|
||||
.getChildFile("CrystalizerEQ")
|
||||
.getChildFile("Presets");
|
||||
|
||||
auto presetFolder = desktop.getChildFile("CrystalizerEQ_Presets");
|
||||
|
||||
juce::Array<juce::File> files = presetFolder.findChildFiles(
|
||||
juce::File::findFiles, // nur Dateien (nicht Ordner)
|
||||
false, // nicht rekursiv (kein Durchsuchen von Unterordnern)
|
||||
"*.xml" // Pattern: alle Dateien
|
||||
);
|
||||
auto files = presetFolder.findChildFiles(juce::File::findFiles, false, "*.xml");
|
||||
|
||||
for (const auto& f : files) {
|
||||
if (f.getFileName() != preset) {
|
||||
@ -601,10 +594,10 @@ void CrystalizerEQAudioProcessor::loadPreset(const juce::String &preset){
|
||||
}
|
||||
|
||||
void CrystalizerEQAudioProcessor::deletePreset(const juce::String &preset) const{
|
||||
auto desktop = juce::File::getSpecialLocation(juce::File::userDesktopDirectory);
|
||||
|
||||
// Unterordner auf dem Desktop anlegen
|
||||
auto presetFolder = desktop.getChildFile("CrystalizerEQ_Presets");
|
||||
auto appData = juce::File::getSpecialLocation(juce::File::userApplicationDataDirectory);
|
||||
auto presetFolder = appData.getChildFile("AXIOM")
|
||||
.getChildFile("CrystalizerEQ")
|
||||
.getChildFile("Presets");
|
||||
|
||||
juce::Array<juce::File> files = presetFolder.findChildFiles(
|
||||
juce::File::findFiles, // nur Dateien (nicht Ordner)
|
||||
@ -644,10 +637,10 @@ void CrystalizerEQAudioProcessor::parameterChanged (const juce::String& id, floa
|
||||
juce::StringArray CrystalizerEQAudioProcessor::getPresetNamesArray() const{
|
||||
|
||||
juce::StringArray presetNames = {"Init"};
|
||||
auto desktop = juce::File::getSpecialLocation(juce::File::userDesktopDirectory);
|
||||
|
||||
// Unterordner auf dem Desktop anlegen
|
||||
auto presetFolder = desktop.getChildFile("CrystalizerEQ_Presets");
|
||||
auto appData = juce::File::getSpecialLocation(juce::File::userApplicationDataDirectory);
|
||||
auto presetFolder = appData.getChildFile("AXIOM")
|
||||
.getChildFile("CrystalizerEQ")
|
||||
.getChildFile("Presets");
|
||||
|
||||
juce::Array<juce::File> files = presetFolder.findChildFiles(
|
||||
juce::File::findFiles, // nur Dateien (nicht Ordner)
|
||||
@ -704,57 +697,11 @@ void CrystalizerEQAudioProcessor::processBlock (juce::AudioBuffer<float>& buffer
|
||||
auto totalNumInputChannels = getTotalNumInputChannels();
|
||||
auto totalNumOutputChannels = getTotalNumOutputChannels();
|
||||
|
||||
|
||||
|
||||
|
||||
// In case we have more outputs than inputs, this code clears any output
|
||||
// channels that didn't contain input data, (because these aren't
|
||||
// guaranteed to be empty - they may contain garbage).
|
||||
// This is here to avoid people getting screaming feedback
|
||||
// when they first compile a plugin, but obviously you don't need to keep
|
||||
// this code if your algorithm always overwrites all the output channels.
|
||||
for (auto i = totalNumInputChannels; i < totalNumOutputChannels; ++i)
|
||||
buffer.clear (i, 0, buffer.getNumSamples());
|
||||
|
||||
juce::AudioBuffer<float> lowBuf, highBuf;
|
||||
|
||||
|
||||
|
||||
// This is the place where you'd normally do the guts of your plugin's
|
||||
// audio processing...
|
||||
// Make sure to reset the state if your inner loop is processing
|
||||
// the samples and the outer loop is handling the channels.
|
||||
// Alternatively, you can process the samples with the channels
|
||||
// interleaved by keeping the same state.
|
||||
// (Einfacher Weg) – pro Block Parameter lesen & Filter updaten
|
||||
|
||||
|
||||
|
||||
const bool testNoiseOn = apvts.getRawParameterValue("TestNoiseEnabled")->load() > 0.5f;
|
||||
|
||||
if (testNoiseOn)
|
||||
{
|
||||
buffer.clear();
|
||||
const float noiseLevelDb = apvts.getRawParameterValue("TestNoiseLevel")->load();
|
||||
const float gain = juce::Decibels::decibelsToGain (noiseLevelDb);
|
||||
|
||||
const int numSamples = buffer.getNumSamples();
|
||||
const int numChannels = buffer.getNumChannels();
|
||||
|
||||
for (int ch = 0; ch < numChannels; ++ch)
|
||||
{
|
||||
auto* write = buffer.getWritePointer (ch);
|
||||
auto& rng = (ch == 0 ? noiseRandL : noiseRandR);
|
||||
|
||||
for (int n = 0; n < numSamples; ++n)
|
||||
{
|
||||
// rng.nextFloat() ∈ [0,1) → in [-1,1)
|
||||
const float white = 2.0f * rng.nextFloat() - 1.0f;
|
||||
write[n] += white * gain; // ERSETZEN des Host-Inputs
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const bool masterBypassed = apvts.getRawParameterValue("MasterBypass")->load() > 0.5f;
|
||||
if (masterBypassed)
|
||||
return;
|
||||
@ -780,6 +727,7 @@ void CrystalizerEQAudioProcessor::processBlock (juce::AudioBuffer<float>& buffer
|
||||
auto leftBlock = block.getSingleChannelBlock (0);
|
||||
auto rightBlock = block.getSingleChannelBlock (1);
|
||||
|
||||
|
||||
juce::dsp::ProcessContextReplacing<float> leftCtx (leftBlock);
|
||||
juce::dsp::ProcessContextReplacing<float> rightCtx(rightBlock);
|
||||
|
||||
|
||||
@ -90,6 +90,9 @@ public:
|
||||
|
||||
void resetAllParameters() const;
|
||||
|
||||
bool lowCutActive = false;
|
||||
bool highCutActive = false;
|
||||
|
||||
AudioFIFO audioFIFO;
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user