Re: setTargetAtTime and the meaning of .value in the spec

On Mon, Jul 29, 2013 at 3:10 PM, Chris Rogers <crogers@google.com> wrote:

>
>
>
> On Mon, Jul 29, 2013 at 4:48 AM, Paul Adenot <padenot@mozilla.com> wrote:
>
>> 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.
>>
>
> The computedValue is an internal value which also includes (by summing in)
> all audio-rate connections to the param, but the V0 and V1 values are not
> meant to include that part.  It's really the last "intrinsic" value as
> described in the spec which matters here.
>
>
>>
>> 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
>>
>
> Maybe we could say that V0 is the last intrinsic value.
>

Rewording it like that sounds good.  FWIW when I was reading the current
wording for the Gecko implementation, I mistakenly interpreted V0 here as
AudioParam.value.

Cheers,
Ehsan


>
>
>> 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 Tuesday, 30 July 2013 17:23:31 UTC