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>
50 sor
1.7 KiB
C++
50 sor
1.7 KiB
C++
#include "MasterPanel.h"
|
|
|
|
MasterPanel::MasterPanel()
|
|
{
|
|
titleLabel.setText ("MASTER", juce::dontSendNotification);
|
|
titleLabel.setJustificationType (juce::Justification::centredLeft);
|
|
titleLabel.setColour (juce::Label::textColourId, InstaGrainLookAndFeel::textPrimary);
|
|
addAndMakeVisible (titleLabel);
|
|
|
|
volumeKnob.setSliderStyle (juce::Slider::RotaryHorizontalVerticalDrag);
|
|
volumeKnob.setTextBoxStyle (juce::Slider::TextBoxBelow, false, 55, 14);
|
|
volumeKnob.setRange (0.0, 2.0);
|
|
volumeKnob.setValue (1.0);
|
|
volumeKnob.getProperties().set (InstaGrainLookAndFeel::knobTypeProperty, "orange");
|
|
addAndMakeVisible (volumeKnob);
|
|
|
|
volLabel.setText ("Volume", juce::dontSendNotification);
|
|
volLabel.setJustificationType (juce::Justification::centred);
|
|
volLabel.setColour (juce::Label::textColourId, InstaGrainLookAndFeel::textSecondary);
|
|
addAndMakeVisible (volLabel);
|
|
|
|
addAndMakeVisible (vuMeter);
|
|
}
|
|
|
|
void MasterPanel::resized()
|
|
{
|
|
auto bounds = getLocalBounds().reduced (4);
|
|
titleLabel.setBounds (bounds.removeFromTop (20));
|
|
|
|
int halfW = bounds.getWidth() / 2;
|
|
|
|
// Volume knob
|
|
auto knobArea = bounds.removeFromLeft (halfW);
|
|
auto knobRect = knobArea.withTrimmedBottom (16);
|
|
volumeKnob.setBounds (knobRect.reduced (2));
|
|
volLabel.setBounds (knobArea.getX(), knobRect.getBottom() - 2, knobArea.getWidth(), 16);
|
|
|
|
// VU meter
|
|
vuMeter.setBounds (bounds.reduced (8, 4));
|
|
}
|
|
|
|
void MasterPanel::paint (juce::Graphics& g)
|
|
{
|
|
auto bounds = getLocalBounds().toFloat();
|
|
g.setColour (InstaGrainLookAndFeel::bgMedium.withAlpha (0.5f));
|
|
g.fillRoundedRectangle (bounds, 4.0f);
|
|
g.setColour (InstaGrainLookAndFeel::bgLight.withAlpha (0.3f));
|
|
g.drawRoundedRectangle (bounds, 4.0f, 1.0f);
|
|
}
|