Re: Creating ADSR Envelopes

Hey Yotam,

I'm not sure I understand the first half of your statement - if you know
when in the future you will be scheduling another envelope, can't you use
ramps to that time?  This seems like "I want the release to start 0.02s
after I receive this JS event", or something like that - is this correct?

That aside, the filter frequency should work as you surmise; however, there
was a bug in that for a while.  Are you using Chrome Canary (i.e. version
26.xx?)

-Chris


On Thu, Jan 10, 2013 at 11:00 AM, Yotam Mann <matoyotambien@gmail.com>wrote:

> 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:09:09 UTC