mirror of
https://codeberg.org/armin/wavetable.git
synced 2026-09-01 05:50:46 +02:00
Add dots to ADSRs
This commit is contained in:
parent
6474640dbb
commit
2190db8fc6
3 changed files with 38 additions and 2 deletions
|
|
@ -1 +1 @@
|
||||||
Subproject commit cf19899bbcbc2f46132d5f49de6a519b313c0922
|
Subproject commit 1c2ff0f34c275feea0ec95074689634416296343
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit 22df0d2266007bccb25d6ed52b9907f60d04e971
|
Subproject commit a878e042e86f9462fc08459e13fcd9bf196e0c69
|
||||||
|
|
@ -250,6 +250,16 @@ public:
|
||||||
|
|
||||||
adsr = new gin::ADSRComponent ();
|
adsr = new gin::ADSRComponent ();
|
||||||
adsr->setParams (preset.attack, preset.decay, preset.sustain, preset.release);
|
adsr->setParams (preset.attack, preset.decay, preset.sustain, preset.release);
|
||||||
|
adsr->phaseCallback = [this]
|
||||||
|
{
|
||||||
|
std::vector<std::pair<int, float>> res;
|
||||||
|
|
||||||
|
for (auto v : proc.getActiveVoices())
|
||||||
|
if (auto wtv = dynamic_cast<WavetableVoice*> (v))
|
||||||
|
res.push_back (wtv->adsr.getCurrentPhase());
|
||||||
|
|
||||||
|
return res;
|
||||||
|
};
|
||||||
addControl (adsr, 0, 0, 4, 1);
|
addControl (adsr, 0, 0, 4, 1);
|
||||||
|
|
||||||
addControl (new gin::Knob (preset.attack), 0, 1);
|
addControl (new gin::Knob (preset.attack), 0, 1);
|
||||||
|
|
@ -290,6 +300,19 @@ public:
|
||||||
|
|
||||||
adsr = new gin::ADSRComponent ();
|
adsr = new gin::ADSRComponent ();
|
||||||
adsr->setParams (flt.attack, flt.decay, flt.sustain, flt.release);
|
adsr->setParams (flt.attack, flt.decay, flt.sustain, flt.release);
|
||||||
|
adsr->phaseCallback = [this, &flt]
|
||||||
|
{
|
||||||
|
std::vector<std::pair<int, float>> res;
|
||||||
|
|
||||||
|
if (flt.amount->getUserValue() != 0.0f)
|
||||||
|
{
|
||||||
|
for (auto voice : proc.getActiveVoices())
|
||||||
|
if (auto wtv = dynamic_cast<WavetableVoice*> (voice))
|
||||||
|
res.push_back (wtv->filterADSR.getCurrentPhase());
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
};
|
||||||
addControl (adsr, 3, 0, 4, 1);
|
addControl (adsr, 3, 0, 4, 1);
|
||||||
|
|
||||||
addControl (a = new gin::Knob (flt.attack), 3, 1);
|
addControl (a = new gin::Knob (flt.attack), 3, 1);
|
||||||
|
|
@ -435,6 +458,19 @@ public:
|
||||||
|
|
||||||
auto g = new gin::ADSRComponent();
|
auto g = new gin::ADSRComponent();
|
||||||
g->setParams (env.attack, env.decay, env.sustain, env.release);
|
g->setParams (env.attack, env.decay, env.sustain, env.release);
|
||||||
|
g->phaseCallback = [this, &env]
|
||||||
|
{
|
||||||
|
std::vector<std::pair<int, float>> res;
|
||||||
|
|
||||||
|
if (env.enable->isOn())
|
||||||
|
{
|
||||||
|
for (auto v : proc.getActiveVoices())
|
||||||
|
if (auto wtv = dynamic_cast<WavetableVoice*> (v))
|
||||||
|
res.push_back (wtv->modADSRs[idx].getCurrentPhase());
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
};
|
||||||
addControl (g, 0, 0, 4, 1);
|
addControl (g, 0, 0, 4, 1);
|
||||||
|
|
||||||
setSize (112, 163);
|
setSize (112, 163);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue