mirror of
https://codeberg.org/armin/wavetable.git
synced 2026-09-01 05:50:46 +02:00
More UI work
This commit is contained in:
parent
5367e208be
commit
6083909d32
5 changed files with 89 additions and 31 deletions
|
|
@ -3,15 +3,17 @@
|
|||
[
|
||||
{ "id": "osc[1..2]", "x": "0,prevR()+1", "y": 0, "w": "parW()/2", "h": 163 },
|
||||
{ "id": "flt", "x": "0", "y": "prevB()+1", "w": 400, "h": 163 },
|
||||
{ "id": "noise", "x": "prevR()+1", "y": "prevY()", "w": 60, "h": 163 },
|
||||
{ "id": "adsr", "x": "prevR()+1", "y": "prevY()", "w": 240, "h": 163 },
|
||||
{ "id": "noise", "x": "prevR()+1", "y": "prevY()", "w": 120, "h": 163 },
|
||||
{ "id": "sub", "x": "prevR()+1", "y": "prevY()", "w": 120, "h": 163 },
|
||||
{ "id": "lfo[1..3]", "x": "0,prevR()+1", "y": "prevB()+1,prevY()", "w": 175, "h": 163 },
|
||||
{ "id": "gate", "x": "prevR()+1", "y": "prevY()", "w": 240, "h": 163 },
|
||||
{ "id": "scope", "x": "0", "y": "prevB()+1", "w": 175, "h": 163 },
|
||||
{ "id": "lfo[1..3]", "x": 0, "y": "prevB()+1,prevY()", "w": 340, "h": 163 },
|
||||
{ "id": "env[1..3]", "x": "getR('lfo1')+1", "y": "prevY()", "w": 240, "h": 163 },
|
||||
{ "id": "step", "x": "prevR()+1", "y": "prevY()", "w": 240, "h": 163 },
|
||||
{ "id": "gate", "x": "0", "y": "prevB()+1", "w": 240, "h": 163 },
|
||||
{ "id": "reverb", "x": "prevR()+1", "y": "prevY()", "w": 175, "h": 163 },
|
||||
{ "id": "delay", "x": "prevR()+1", "y": "prevY()", "w": 175, "h": 163 },
|
||||
{ "id": "distort", "x": "prevR()+1", "y": "prevY()", "w": 175, "h": 163 },
|
||||
{ "id": "distort", "x": "prevR()+1", "y": "prevY()", "w": 100, "h": 163 },
|
||||
{ "id": "chorus", "x": "prevR()+1", "y": "prevY()", "w": 175, "h": 163 },
|
||||
{ "id": "lfoArea[1..3]", "x": 0, "y": 0, "w": 0, "h": 0 }
|
||||
{ "id": "scope", "x": 0, "y": "prevB()+1", "w": "parW()-2", "b": "parH()-1" }
|
||||
]
|
||||
}
|
||||
|
|
@ -5,18 +5,13 @@ Editor::Editor (WavetableAudioProcessor& proc_)
|
|||
{
|
||||
for (auto& o : oscillators) addAndMakeVisible (o);
|
||||
for (auto& l : lfos) addAndMakeVisible (l);
|
||||
for (auto& l : lfoGraphs) addAndMakeVisible (l);
|
||||
for (auto& e : envs) addAndMakeVisible (e);
|
||||
|
||||
addAndMakeVisible (sub);
|
||||
addAndMakeVisible (noise);
|
||||
addAndMakeVisible (adsr);
|
||||
addAndMakeVisible (filter);
|
||||
|
||||
for (int i = 0; i < Cfg::numLFOs; i++)
|
||||
{
|
||||
addAndMakeVisible (&lfos[i]);
|
||||
addAndMakeVisible (&lfoGraphs[i]);
|
||||
}
|
||||
|
||||
addAndMakeVisible (step);
|
||||
addAndMakeVisible (gate);
|
||||
addAndMakeVisible (chorus);
|
||||
addAndMakeVisible (distort);
|
||||
|
|
|
|||
|
|
@ -21,10 +21,12 @@ private:
|
|||
NoiseBox noise { "noise", proc };
|
||||
SubBox sub { "sub", proc };
|
||||
|
||||
ADSRBox adsr { "adsr", proc };
|
||||
FilterBox filter { "filter", proc };
|
||||
|
||||
LFOBox lfos[Cfg::numLFOs] { { "LFO 1", proc, 0 }, { "LFO 2", proc, 1 }, { "LFO 3", proc, 2 } };
|
||||
LFOArea lfoGraphs[Cfg::numLFOs] { { proc, 0 }, { proc, 1 }, { proc, 2 } };
|
||||
ENVBox envs[Cfg::numENVs] { { "ENV 1", proc, 0 }, { "ENV 2", proc, 1 }, { "ENV 3", proc, 2 } };
|
||||
StepBox step { "step", proc };
|
||||
|
||||
GateBox gate { proc };
|
||||
ChorusBox chorus { proc };
|
||||
|
|
|
|||
|
|
@ -179,6 +179,32 @@ public:
|
|||
WavetableAudioProcessor& proc;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class ADSRBox : public gin::ParamBox
|
||||
{
|
||||
public:
|
||||
ADSRBox (const juce::String& name, WavetableAudioProcessor& proc_)
|
||||
: gin::ParamBox (name), proc (proc_)
|
||||
{
|
||||
setName ("adsr");
|
||||
|
||||
auto& preset = proc.adsrParams;
|
||||
|
||||
adsr = new gin::ADSRComponent ();
|
||||
adsr->setParams (preset.attack, preset.decay, preset.sustain, preset.release);
|
||||
addControl (adsr, 0, 0, 4, 1);
|
||||
|
||||
addControl (a = new gin::Knob (preset.attack), 0, 1);
|
||||
addControl (d = new gin::Knob (preset.decay), 1, 1);
|
||||
addControl (s = new gin::Knob (preset.sustain), 2, 1);
|
||||
addControl (r = new gin::Knob (preset.release), 3, 1);
|
||||
}
|
||||
|
||||
WavetableAudioProcessor& proc;
|
||||
gin::ParamComponent::Ptr a, d, s, r;
|
||||
gin::ADSRComponent* adsr;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class FilterBox : public gin::ParamBox
|
||||
{
|
||||
|
|
@ -260,6 +286,15 @@ public:
|
|||
addControl (new gin::Knob (lfo.fade, true), 0, 1);
|
||||
addControl (new gin::Knob (lfo.delay), 1, 1);
|
||||
|
||||
addControl (new gin::Select (lfo.wave), 2, 1);
|
||||
addControl (new gin::Switch (lfo.sync), 3, 1);
|
||||
addControl (new gin::Knob (lfo.phase, true), 4, 1);
|
||||
addControl (new gin::Knob (lfo.offset, true), 5, 1);
|
||||
|
||||
auto l = new gin::LFOComponent();
|
||||
l->setParams (lfo.wave, lfo.sync, lfo.rate, lfo.beat, lfo.depth, lfo.offset, lfo.phase, lfo.enable);
|
||||
addControl (l, 2, 0, 4, 1);
|
||||
|
||||
watchParam (lfo.sync);
|
||||
|
||||
setSize (112, 163);
|
||||
|
|
@ -280,31 +315,55 @@ public:
|
|||
};
|
||||
|
||||
//==============================================================================
|
||||
class LFOArea : public gin::ParamArea
|
||||
class ENVBox : public gin::ParamBox
|
||||
{
|
||||
public:
|
||||
LFOArea (WavetableAudioProcessor& proc_, int idx_)
|
||||
: proc (proc_), idx (idx_)
|
||||
ENVBox (const juce::String& name, WavetableAudioProcessor& proc_, int idx_)
|
||||
: gin::ParamBox (name), proc (proc_), idx (idx_)
|
||||
{
|
||||
setName ("lfoArea" + juce::String (idx + 1));
|
||||
setName ("env" + juce::String (idx + 1));
|
||||
|
||||
auto& lfo = proc.lfoParams[idx];
|
||||
auto& env = proc.envParams[idx];
|
||||
|
||||
addControl (new gin::Select (lfo.wave));
|
||||
addControl (new gin::Switch (lfo.sync));
|
||||
addControl (new gin::Knob (lfo.phase, true));
|
||||
addControl (new gin::Knob (lfo.offset, true));
|
||||
addEnable (env.enable);
|
||||
|
||||
auto l = new gin::LFOComponent();
|
||||
l->setParams (lfo.wave, lfo.sync, lfo.rate, lfo.beat, lfo.depth, lfo.offset, lfo.phase, lfo.enable);
|
||||
addControl (l);
|
||||
addControl (new gin::Knob (env.attack), 0, 1);
|
||||
addControl (new gin::Knob (env.decay), 1, 1);
|
||||
addControl (new gin::Knob (env.sustain), 2, 1);
|
||||
addControl (new gin::Knob (env.release), 3, 1);
|
||||
|
||||
setSize (186, 163);
|
||||
auto g = new gin::ADSRComponent();
|
||||
g->setParams (env.attack, env.decay, env.sustain, env.release);
|
||||
addControl (g, 0, 0, 4, 1);
|
||||
|
||||
setSize (112, 163);
|
||||
}
|
||||
|
||||
void paramChanged () override
|
||||
WavetableAudioProcessor& proc;
|
||||
int idx;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class StepBox : public gin::ParamBox
|
||||
{
|
||||
public:
|
||||
StepBox (const juce::String& name, WavetableAudioProcessor& proc_)
|
||||
: gin::ParamBox (name), proc (proc_)
|
||||
{
|
||||
gin::ParamArea::paramChanged ();
|
||||
setName ("step");
|
||||
|
||||
auto& prs = proc.stepLfoParams;
|
||||
|
||||
addEnable (prs.enable);
|
||||
|
||||
addControl (new gin::Knob (prs.beat), 0, 1);
|
||||
addControl (new gin::Knob (prs.length), 1, 1);
|
||||
|
||||
auto g = new gin::StepLFOComponent();
|
||||
g->setParams (prs.beat, prs.length, prs.level, prs.enable);
|
||||
addControl (g, 0, 0, 4, 1);
|
||||
|
||||
setSize (112, 163);
|
||||
}
|
||||
|
||||
WavetableAudioProcessor& proc;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue