Page 1 of 1

Envelopes

Posted: Sat Nov 07, 2015 8:33 pm
by tulamide
Here comes another so basic question, that it will be probably very hard for you to answer it in a way I understand :lol:

I was wondering how the standard ADSR envelope is working. I found out that A, D and R range from 0 to 4 times the sample rate. In other words, 0 to 4 seconds. That's cool, because I can now use this as a template for other values (5, 7, 10 secondes or whatever).

Unfortunately this system breaks with the sustain value. On most synths I use, the sustain is just as well expressed in time values (either seconds or note lengths, just like A, D and R).
In FS standard envelope there is no time information for sustain, but it ranges from 0 to 1. Also I can't find it referenced anywhere else than in these 2 lines (variable "s"):

Code: Select all

...
dStep = 16/d * (1-s);
...
val = (stage==2)&s + (stage!=2)&val;
...


So , sustain seems to influence the decay directly and later on it replaces val depending on the stage count with a constant value (since "s" is a fixed value)
How do I calculate the real lengths for d and s in seconds, and is there a way for s to act in the same way as a, d and r (= being calculated based on x*samplerate)?

EDIT: Corrected "brakes" into "breaks" (although it's funny imagining the system braking)

Re: Envelopes

Posted: Sun Nov 08, 2015 1:27 am
by MyCo
The release is handled like attack and decay, so it's in samples. The only difference is, that attack and decay are calculated in the first hop section and release is calculated in the second hop section.

Re: Envelopes

Posted: Sun Nov 08, 2015 11:29 am
by tulamide
MyCo wrote:The release is handled like attack and decay, so it's in samples. The only difference is, that attack and decay are calculated in the first hop section and release is calculated in the second hop section.

I know.
That's why I didn't ask about release. I asked about sustain ;)

Re: Envelopes

Posted: Sun Nov 08, 2015 11:45 am
by adamszabo
Sustain is not really a measure as a variable of time, since its always constant as long as you hold down a note. The synth wont know how long you will keep holding down a note no? ;)

Re: Envelopes

Posted: Sun Nov 08, 2015 12:24 pm
by KG_is_back
Sustain can be a little misleading. The knob does not control any time parameter (unlike A D and R). It controls a level (volume). During Attack phase, the volume rises from 0 to 1. During the decay, the volume drops from 1 to S (S being the volume set by sustain knob). Finally during release the volume drops from S level to zero.

Sustain level shouldn't affect the length of decay or release - it only affects the steepness of the drop (since the level has to "drop" more for low sustain value and less for higher sustain value and vice versa for the release)

Re: Envelopes

Posted: Sun Nov 08, 2015 12:52 pm
by tulamide
Thank you both! I don't know exactly where I was taking the wrong path - but you both are of course totally right :oops:

(If I think of all the envelopes I've set up in all those years - why could I even ask? Maybe I was just overly tired)