Re: Missing information in the Web Audio spec

On Wed, May 9, 2012 at 6:19 PM, Robert O'Callahan <robert@ocallahan.org>wrote:

>
> In AudioParam, a lot of the processing model is unclear. I assume that
> nominally an AudioParam is a function from time to floats. So, for
> example,what does setValueAtTime actually do? Does it set the value for all
> times >= 'time'? Does setting the 'value' attribute make the function
> constant over all times? And what does it mean to be "relative to the
> AudioContext currentTime"? Does that mean passing 0 changes the value at
> the current time, or that 'time' and 'context.currentTime' are simply on
> the same timeline? If the former, clarify by saying that 0 corresponds to
> the context's currentTime.
>

Heh.  I thought setValueAtTime was the easiest method to understand.  It
sets the value of the AudioParam to the specified value at time T, where T
is the offset from context.currentTime.  Unless you do something else to
it, it stays at this value.

>
> The actual values computed by the AudioParam curves must be specified
> mathematically. The current text is too vague to be implemented.
>

Yes, this could probably be added, although I think linearRampToValueAtTime
is pretty clear.

exponentialRampToValueAtTime is less so because there was some issue raised
that you can't start or end with a negative value (because exp(x) is always
positive for real x).

setValueCurveAtTime seems straighforward, unless you need to describe how
the interpolation is done if the number of values doesn't exactly match the
duration.

Ray

Received on Thursday, 10 May 2012 16:38:49 UTC