Two general reasons why AudioParam.value setter cannot be changed to a setTargetAtTime alias

On Mon, 23 Dec 2013 11:55:41 +0000, Olivier Thereaux wrote:

> We discussed this issue again at our last teleconference, and confirmed the
> resolution to have .value effectively be an alias for setTargetAtTime() - with
> time constants TBD.

Please see below for two features of AudioParam.value attributes
that are provided by the Web Audio draft and Gecko and Blink
implementations.  (I assume WebKit is similar.)  Each of these
features would be removed if the .value setter were re-spec'd as an
alias for setTargetAtTime().

1. The setter can be used to set the initial value of an AudioParam.

This feature is useful on GainNode for example to ensure the
signal is silenced when first connected.

  var node = context.createGain();
  node.gain.value = 0;

Using setTargetAtTime() would mean the node initially passes the
signal at full volume, and then the multiplier would approach zero.

Setting the initial values of parameters is more important than
having a transition applied when changing values after the node
has begun processing signal.  No attempt to spec transitions on
running streams should remove the feature allowing use of setters
for initial values.

This problem was already pointed out in [1], but not so strongly
because, at that point in time, the CfC was no longer looking
for feedback on details of how de-zippering would be performed. 

2. The getter returns the value provided to the setter, if no
   automation events have been scheduled.

For example, the steady-state gain below is 0.2.

  var node = context.createGain();
  node.gain.value = 0;
  node.gain.value += 0.1;
  node.gain.value += 0.1;

Using setTargetAtTime() would change the steady state gain to 1.1.

[1] http://lists.w3.org/Archives/Public/public-audio/2013OctDec/0315.html

Received on Monday, 30 December 2013 23:29:58 UTC