Page 1 of 1

ADSR Question

Posted: Mon Dec 28, 2020 5:35 pm
by creart
Hi, I don't think I get exactly how to operate ADSREnvelope.... When I do SetGate(true), do I need to start a timer which will fire a a SetGate(false)?
The SetGate starts the attack, decay and sustain phase with the time and levels settings I have set, but then remains in that sustain phase until the SetGate(false) is received...
But when I immediately give a SetGate(false) it's not entering the sustain phase at all...

I actually would have expected that Notify would have cases for the stages (like ADSR_Stage_Attack etc), and I tried adding those stages as case within the Notify section, but no luck there...

Can someone enlighten me?

cheers Hans

Re: ADSR Question

Posted: Wed Dec 30, 2020 4:37 pm
by creart
Btw, I was attempting to set a gate using a button and then you just have the option of setting the gate to true at that point....
In the meantime I have been able to start a NamedTimer to test and that works while testing...
I assume that normally you set the gate to true on NoteOn and to false on NoteOff...

But just using a button to start a gate manually is trickier than expected :-)

Anyway - getting there!

Re: ADSR Question

Posted: Wed Oct 06, 2021 5:53 pm
by bcgreen24
Hi, creart-- can you share some code snippets on how you're using ADSR envelopes? My main problem is trying to figure out how to use a gate input to trigger the envelope, how to deal with sustain, etc. (sooo, basically everything :) )

Bryan