mirror of
https://codeberg.org/armin/wavetable.git
synced 2026-09-01 05:50:46 +02:00
Add retrigger to lfos
This commit is contained in:
parent
bd54be0c66
commit
56c3bbfa51
7 changed files with 21 additions and 20 deletions
|
|
@ -56,7 +56,8 @@
|
|||
{ "id": "Phase", "x": "prevR()", "y": "prevY()", "w": 42, "h": 57 },
|
||||
{ "id": "Delay", "x": "prevR()", "y": "prevY()", "w": 42, "h": 57 },
|
||||
{ "id": "Fade", "x": "prevR()", "y": "prevY()", "w": 42, "h": 57 },
|
||||
{ "id": "lfo", "x": "getX('Offset')", "y": "getY('Rate')", "r": "getR('Fade')", "b": "getY('Fade')" }
|
||||
{ "id": "lfo", "x": "getX('Offset')", "y": "getY('Rate')", "r": "getR('Fade')", "b": "getY('Fade')" },
|
||||
{ "id": "Retrig", "r": "getR('lfo') - 3", "y": "getY('lfo') + 3", "w": 12, "h": 12 }
|
||||
] },
|
||||
{ "id": "env[1..3]", "x": "getR('lfo1')+1", "y": "prevY()", "w": "168 + 50", "h": 163, "children":
|
||||
[
|
||||
|
|
|
|||
|
|
@ -309,21 +309,23 @@ public:
|
|||
addModSource (new gin::ModulationSourceButton (proc.modMatrix, proc.modSrcLFO[idx], true));
|
||||
addModSource (new gin::ModulationSourceButton (proc.modMatrix, proc.modSrcMonoLFO[idx], false));
|
||||
|
||||
addControl (r = new gin::Knob (lfo.rate), 0, 0);
|
||||
addControl (b = new gin::Select (lfo.beat), 0, 0);
|
||||
addControl (new gin::Knob (lfo.depth, true), 1, 0);
|
||||
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);
|
||||
addControl (r = new gin::Knob (lfo.rate));
|
||||
addControl (b = new gin::Select (lfo.beat));
|
||||
addControl (new gin::Knob (lfo.depth, true));
|
||||
addControl (new gin::Knob (lfo.fade, true));
|
||||
addControl (new gin::Knob (lfo.delay));
|
||||
|
||||
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));
|
||||
|
||||
auto l = new gin::LFOComponent();
|
||||
l->phaseCallback = [this] { return proc.modLFOs[idx].getCurrentPhase(); };
|
||||
l->setParams (lfo.wave, lfo.sync, lfo.rate, lfo.beat, lfo.depth, lfo.offset, lfo.phase, lfo.enable);
|
||||
addControl (l, 2, 0, 4, 1);
|
||||
|
||||
addControl (new gin::SVGPluginButton (lfo.retrig, gin::Assets::retrigger));
|
||||
|
||||
watchParam (lfo.sync);
|
||||
|
||||
|
|
|
|||
|
|
@ -211,6 +211,7 @@ void WavetableAudioProcessor::LFOParams::setup (WavetableAudioProcessor& p, int
|
|||
|
||||
enable = p.addIntParam (id + "enable", nm + "Enable", "Enable", "", { 0.0, 1.0, 1.0, 1.0 }, 0.0f, 0.0f, enableTextFunction);
|
||||
sync = p.addIntParam (id + "sync", nm + "Sync", "Sync", "", { 0.0, 1.0, 1.0, 1.0 }, 0.0, 0.0f, enableTextFunction);
|
||||
retrig = p.addIntParam (id + "retrig", nm + "Retrig", "Retrig", "", { 0.0, 1.0, 1.0, 1.0 }, 1.0, 0.0f, enableTextFunction);
|
||||
wave = p.addIntParam (id + "wave", nm + "Wave", "Wave", "", { 1.0, 17.0, 1.0, 1.0 }, 1.0, 0.0f, lfoTextFunction);
|
||||
rate = p.addExtParam (id + "rate", nm + "Rate", "Rate", "Hz", { 0.0, 50.0, 0.0, 0.3f }, 10.0, 0.0f);
|
||||
beat = p.addIntParam (id + "beat", nm + "Beat", "Beat", "", { 0.0, float (notes.size() - 1), 1.0, 1.0 }, 13.0, 0.0f, durationTextFunction);
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ public:
|
|||
{
|
||||
LFOParams() = default;
|
||||
|
||||
gin::Parameter::Ptr enable, sync, wave, rate, beat, depth, phase, offset, fade, delay;
|
||||
gin::Parameter::Ptr enable, sync, retrig, wave, rate, beat, depth, phase, offset, fade, delay;
|
||||
|
||||
void setup (WavetableAudioProcessor& p, int idx);
|
||||
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@ void WavetableVoice::noteStarted()
|
|||
for (auto& a : modADSRs)
|
||||
a.noteOn();
|
||||
|
||||
for (auto& l : modLFOs)
|
||||
l.noteOn();
|
||||
for (auto idx = 0; auto& l : modLFOs)
|
||||
l.noteOn (proc.lfoParams[idx++].retrig->getBoolValue() ? -1 : rng.nextFloat());
|
||||
|
||||
modStepLFO.reset();
|
||||
modStepLFO.noteOn();
|
||||
|
|
@ -91,15 +91,11 @@ void WavetableVoice::noteRetriggered()
|
|||
|
||||
updateParams (0);
|
||||
|
||||
for (auto& osc : oscillators)
|
||||
osc.noteOn();
|
||||
|
||||
filterADSR.noteOn();
|
||||
|
||||
for (auto& a : modADSRs)
|
||||
a.noteOn();
|
||||
|
||||
modStepLFO.noteOn();
|
||||
adsr.noteOn();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ private:
|
|||
gin::StereoOscillator::Params noiseParams;
|
||||
|
||||
gin::EasedValueSmoother<float> noteSmoother;
|
||||
juce::Random rng;
|
||||
|
||||
float ampKeyTrack = 1.0f;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue