8-voice polyphonic granular synth (VST3/AU/LV2) with: - 128 grain pool per voice, Hann windowing, linear interpolation - Root note selector, sample rate correction, sustain pedal (CC64) - Scatter controls, direction modes (Fwd/Rev/PingPong), freeze - ADSR envelope, global filter (LP/HP/BP), reverb - Waveform display with grain visualization - Drag & drop sample loading, full state save/restore - CI/CD for Windows/macOS/Linux Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
59 sor
1.6 KiB
C++
59 sor
1.6 KiB
C++
#pragma once
|
|
#include <JuceHeader.h>
|
|
#include "PluginProcessor.h"
|
|
#include "LookAndFeel.h"
|
|
#include "WaveformDisplay.h"
|
|
#include "GrainControlPanel.h"
|
|
#include "ScatterPanel.h"
|
|
#include "EnvelopePanel.h"
|
|
#include "EffectsPanel.h"
|
|
#include "MasterPanel.h"
|
|
|
|
static constexpr const char* kInstaGrainVersion = "v1.0";
|
|
|
|
class InstaGrainEditor : public juce::AudioProcessorEditor,
|
|
public juce::FileDragAndDropTarget,
|
|
public juce::Timer
|
|
{
|
|
public:
|
|
explicit InstaGrainEditor (InstaGrainProcessor&);
|
|
~InstaGrainEditor() override;
|
|
|
|
void paint (juce::Graphics&) override;
|
|
void resized() override;
|
|
|
|
// FileDragAndDropTarget
|
|
bool isInterestedInFileDrag (const juce::StringArray& files) override;
|
|
void filesDropped (const juce::StringArray& files, int x, int y) override;
|
|
|
|
// Timer
|
|
void timerCallback() override;
|
|
|
|
private:
|
|
InstaGrainProcessor& processor;
|
|
InstaGrainLookAndFeel lookAndFeel;
|
|
|
|
// Top bar
|
|
juce::Label titleLabel;
|
|
juce::Label versionLabel;
|
|
juce::TextButton loadButton { "LOAD SAMPLE" };
|
|
juce::ToggleButton bypassButton;
|
|
juce::Label bypassLabel;
|
|
|
|
// Panels
|
|
WaveformDisplay waveformDisplay;
|
|
GrainControlPanel grainPanel;
|
|
ScatterPanel scatterPanel;
|
|
EnvelopePanel envelopePanel;
|
|
EffectsPanel effectsPanel;
|
|
MasterPanel masterPanel;
|
|
|
|
std::unique_ptr<juce::FileChooser> fileChooser;
|
|
|
|
void loadSampleFile (const juce::File& file);
|
|
void syncKnobsToEngine();
|
|
void syncEngineFromKnobs();
|
|
|
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (InstaGrainEditor)
|
|
};
|