diff --git a/modules/gin b/modules/gin index cac2161..0e2729f 160000 --- a/modules/gin +++ b/modules/gin @@ -1 +1 @@ -Subproject commit cac21613040d2a29dbd5a22f0cb46a8bd732228c +Subproject commit 0e2729ff522819ddb94f8df6ce1d665494a6b19a diff --git a/plugin/Source/Cfg.h b/plugin/Source/Cfg.h index 1569899..6546dd4 100644 --- a/plugin/Source/Cfg.h +++ b/plugin/Source/Cfg.h @@ -5,4 +5,7 @@ namespace Cfg constexpr static int numOSCs = 2; constexpr static int numENVs = 3; constexpr static int numLFOs = 3; + + constexpr static int numStepLFOSteps = 32; + constexpr static int numGateSteps = 16; } diff --git a/plugin/Source/Panels.h b/plugin/Source/Panels.h index 6098c0a..abd9b73 100644 --- a/plugin/Source/Panels.h +++ b/plugin/Source/Panels.h @@ -27,7 +27,7 @@ public: addControl (new gin::Knob (osc.pos), 0, 0); addControl (new gin::Knob (osc.tune, true), 1, 0); addControl (new gin::Knob (osc.finetune, true), 2, 0); - addControl (new gin::Knob (osc.level, true), 3, 0); + addControl (new gin::Knob (osc.level), 3, 0); addControl (new gin::Knob (osc.pan, true), 4, 0); addControl (new gin::Select (osc.voices), 0, 1); @@ -369,7 +369,7 @@ public: addControl (new gin::Knob (prs.beat), 0, 1); addControl (new gin::Knob (prs.length), 1, 1); - auto g = new gin::StepLFOComponent(); + auto g = new gin::StepLFOComponent (Cfg::numStepLFOSteps); g->setParams (prs.beat, prs.length, prs.level, prs.enable); addControl (g, 0, 0, 4, 1); @@ -433,7 +433,7 @@ public: addControl (new gin::Knob (proc.gateParams.attack), 2, 0); addControl (new gin::Knob (proc.gateParams.release), 3, 0); - auto g = new gin::GateEffectComponent(); + auto g = new gin::GateEffectComponent (Cfg::numGateSteps); g->setParams (proc.gateParams.length, proc.gateParams.l, proc.gateParams.r, proc.gateParams.enable); addControl (g, 0, 1, 4, 1); diff --git a/plugin/Source/PluginProcessor.cpp b/plugin/Source/PluginProcessor.cpp index 1e36509..8909eeb 100644 --- a/plugin/Source/PluginProcessor.cpp +++ b/plugin/Source/PluginProcessor.cpp @@ -214,10 +214,10 @@ void WavetableAudioProcessor::StepLFOParams::setup (WavetableAudioProcessor& p) beat = p.addIntParam (id + "beat", nm + "Beat", "Beat", "", { 0.0, float (notes.size() - 1), 1.0, 1.0 }, 13.0, 0.0f, durationTextFunction); length = p.addIntParam (id + "length", nm + "Length", "Length", "", { 2.0, 32.0, 1.0, 1.0f }, 8.0f, 0.0f); - for (int i = 0; i < 32; i++) + for (int i = 0; i < Cfg::numStepLFOSteps; i++) { auto num = juce::String (i + 1); - level[i] = p.addIntParam (id + "step" + num, nm + "Step " + num, "", "", { -1.0, 1.0, 0.0, 1.0f }, 0.0f, 0.0f); + level[i] = p.addIntParam (id + "step" + num, nm + "Step " + num, "", "", { -1.0, 1.0, 0.0, 1.0f }, 0.0f, 0.0f); } } @@ -231,11 +231,11 @@ void WavetableAudioProcessor::GateParams::setup (WavetableAudioProcessor& p) enable = p.addIntParam (id + "enable", nm + "Enable", "Enable", "", { 0.0, 1.0, 1.0, 1.0 }, 0.0f, 0.0f, enableTextFunction); beat = p.addIntParam (id + "beat", nm + "Beat", "Beat", "", { 0.0, float (notes.size() - 1), 1.0, 1.0 }, 7.0, 0.0f, durationTextFunction); - length = p.addIntParam (id + "length", nm + "Length", "Length", "", { 2.0, 32.0, 1.0, 1.0f }, 8.0f, 0.0f); + length = p.addIntParam (id + "length", nm + "Length", "Length", "", { 2.0, Cfg::numGateSteps, 1.0, 1.0f }, 8.0f, 0.0f); attack = p.addExtParam (id + "attack", nm + "Attack", "A", "s", { 0.0, 1.0, 0.0, 0.2f }, 0.1f, 0.0f); release = p.addExtParam (id + "release", nm + "Release", "R", "s", { 0.0, 1.0, 0.0, 0.2f }, 0.1f, 0.0f); - for (int i = 0; i < 32; i++) + for (int i = 0; i < Cfg::numGateSteps; i++) { auto num = juce::String (i + 1); l[i] = p.addIntParam (id + "l" + num, nm + "L " + num, "", "", { 0.0, 1.0, 1.0, 1.0f }, (i % 2 == 0 || i % 5 == 0) ? 1.0f : 0.0f, 0.0f); diff --git a/plugin/Source/PluginProcessor.h b/plugin/Source/PluginProcessor.h index 90423ba..9b8e398 100644 --- a/plugin/Source/PluginProcessor.h +++ b/plugin/Source/PluginProcessor.h @@ -116,7 +116,7 @@ public: StepLFOParams() = default; gin::Parameter::Ptr enable, beat, length; - gin::Parameter::Ptr level[32] = { nullptr }; + gin::Parameter::Ptr level[Cfg::numStepLFOSteps] = { nullptr }; void setup (WavetableAudioProcessor& p); @@ -151,8 +151,8 @@ public: GateParams() = default; gin::Parameter::Ptr enable, beat, length, attack, release; - gin::Parameter::Ptr l[32] = { nullptr }; - gin::Parameter::Ptr r[32] = { nullptr }; + gin::Parameter::Ptr l[Cfg::numGateSteps] = { nullptr }; + gin::Parameter::Ptr r[Cfg::numGateSteps] = { nullptr }; void setup (WavetableAudioProcessor& p);