Creating ADSR Envelopes

Hi group,

I'm working on a synthesizer in Web Audio and i'm stuck on the filter
envelope part.

One issue that i'm having is that the pattern that I see often for avoiding
clicks when scheduling AudioParam's envelopes doesn't work when
scheduling the envelope in the future where the AudioParam's current value
is no longer the same:

i.e. AudioParam.setValueAtTime(AudioParam.value, context.currentTime);

If i want to schedule the next envelope in the future, but don't know if
the previous envelope's release has finished, i can't have the future
attack start where the previous envelope's release left off since there is
not getValueAtTime function for AudioParams.

For this reason, i decided to make my own envelope generator with a
ScriptNode. This works well when I connect this signal to an oscillator's
gain, but I also want to apply the envelope to a filter's frequency
AudioParam. I scale the ADSR values to be between 0 and 500 for example and
connect it to the filter.frequency, but it doesn't not seem to be making
any difference. does this filter's frequency AudioParam not behave the same
as the gain's gain param?

Insight on these issues would be greatly appreciated.

thanks.

Yotam

Received on Thursday, 10 January 2013 19:00:50 UTC