setTargetAtTime and the meaning of .value in the spec

First, some context [1], specifically, comment 2.

The paragraph that describes the `setTargetAtTime` method of an
AudioParam currently says:

> During the time interval: T0 <= t < T1, where T0 is the startTime
> parameter and T1 represents the time of the event following this
> event (or infinity if there are no following events):
>
>      v(t) = V1 + (V0 - V1) * exp(-(t - T0) / timeConstant)
>
>
> Where V0 is the initial value (the .value attribute) at T0 (the
> startTime parameter) and V1 is equal to the target parameter.

Here, V0 should be the "computedValue" attribute to make it explicit
that we are doing a curve from the last value this AudioParam had, to
the "target" parameter. Otherwise, the feature works in a surprising way
(i.e. does a curve from the last value set to the .value attribute to
the target parameter, or from the default value to the target
parameter), and makes it difficult for the author to use this feature to
implement sustain and release part of an ADSR-like envelope.

If we don't want to use the term "computedValue" at this point in the
spec (since it is only described later on), we should at least use a
wording along the lines of:

> Where V0 is the value of the AudioParam at the time T0

instead of

> Where V0 is the initial value (the .value attribute) at T0

since we have not settled yet whether .value should return the
"computedValue", or the value that was last assigned ([2] and replies).

Thanks,
Paul.

[1]: https://bugzilla.mozilla.org/show_bug.cgi?id=897092
[2]: http://lists.w3.org/Archives/Public/public-audio/2012OctDec/0191.html

Received on Monday, 29 July 2013 11:48:26 UTC