Files
InstaDrums/Source/PluginProcessor.h
hariel1985 a0e83fa0a4 Per-pad FX chain, animated toggles, GR meter, simplified master panel
- FX moved from master bus to per-pad processing:
  each pad has its own Filter, Distortion, EQ, Compressor, Reverb
  via DrumPad::applyPadFx() with temp buffer rendering
- FxPanel now edits the selected pad's FX parameters
- Animated toggle switches with smooth lerp transition and glow
- Per-pad compressor GR meter connected to FxPanel display
- Master panel simplified: Volume/Tune/Pan + Limiter toggle + VU meter
- Master bus chain: Vol/Pan → Output Limiter (0dB brickwall) → VU
- Pointer glow reduced to half intensity (4 layers, narrower spread)
- Smooth 8-layer arc glow with exponential opacity falloff

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 06:42:47 +01:00

74 sor
2.5 KiB
C++

#pragma once
#include <JuceHeader.h>
#include "DrumPad.h"
class InstaDrumsProcessor : public juce::AudioProcessor
{
public:
static constexpr int defaultNumPads = 12;
static constexpr int maxPads = 64;
InstaDrumsProcessor();
~InstaDrumsProcessor() override;
void prepareToPlay (double sampleRate, int samplesPerBlock) override;
void releaseResources() override;
void processBlock (juce::AudioBuffer<float>&, juce::MidiBuffer&) override;
juce::AudioProcessorEditor* createEditor() override;
bool hasEditor() const override { return true; }
const juce::String getName() const override { return JucePlugin_Name; }
bool acceptsMidi() const override { return true; }
bool producesMidi() const override { return true; }
double getTailLengthSeconds() const override { return 0.0; }
int getNumPrograms() override { return 1; }
int getCurrentProgram() override { return 0; }
void setCurrentProgram (int) override {}
const juce::String getProgramName (int) override { return {}; }
void changeProgramName (int, const juce::String&) override {}
void getStateInformation (juce::MemoryBlock& destData) override;
void setStateInformation (const void* data, int sizeInBytes) override;
// Pad management
int getNumPads() const { return numActivePads; }
DrumPad& getPad (int index) { return pads[index]; }
void addPads (int count = 4);
void loadSample (int padIndex, const juce::File& file);
juce::AudioFormatManager& getFormatManager() { return formatManager; }
DrumPad* findPadForNote (int midiNote);
// Kit management
void loadKitFromFolder (const juce::File& folder);
void saveKitPreset (const juce::File& file);
void loadKitPreset (const juce::File& file);
// Master FX parameters (read by editor from FxPanel/MasterPanel)
std::atomic<float> masterVolume { 1.0f };
std::atomic<float> masterPan { 0.0f };
std::atomic<float> masterTune { 0.0f };
// Master bus
std::atomic<bool> outputLimiterEnabled { true };
// VU meter levels (written by audio thread, read by GUI)
std::atomic<float> vuLevelL { 0.0f };
std::atomic<float> vuLevelR { 0.0f };
private:
std::array<DrumPad, maxPads> pads;
int numActivePads = defaultNumPads;
juce::AudioFormatManager formatManager;
double currentSampleRate = 44100.0;
void initializeDefaults();
void applyMasterFx (juce::AudioBuffer<float>& buffer);
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (InstaDrumsProcessor)
};