W3C home > Mailing lists > Public > public-audio@w3.org > July to September 2013

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

From: Ehsan Akhgari <ehsan.akhgari@gmail.com>
Date: Tue, 30 Jul 2013 13:22:23 -0400
Message-ID: <CANTur_4yTWvbX-zRQx9om91QaSN9NdGb2d8v_nriU3Qf6VoR7w@mail.gmail.com>
To: Chris Rogers <crogers@google.com>
Cc: Paul Adenot <padenot@mozilla.com>, "public-audio@w3.org" <public-audio@w3.org>
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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:50:10 UTC