Issue 17398: Add more detailed information about how AudioParam value is calculated
authorcrogers
Thu, 16 Aug 2012 16:30:55 -0700
changeset 13541db9905149d
parent 134 268c9d52caa0
child 137 4b6c7a7b9312
Issue 17398: Add more detailed information about how AudioParam value is calculated
webaudio/specification.html
     1.1 --- a/webaudio/specification.html	Thu Aug 16 15:21:38 2012 -0700
     1.2 +++ b/webaudio/specification.html	Thu Aug 16 16:30:55 2012 -0700
     1.3 @@ -1271,13 +1271,38 @@
     1.4  <p>AudioParam controls an individual aspect of an <a
     1.5  href="#AudioNode-section"><code>AudioNode</code></a>'s functioning, such as
     1.6  volume. The parameter can be set immediately to a particular value using the
     1.7 -"value" attribute. Additionally, value changes can be scheduled to happen at
     1.8 +"value" attribute. Or, value changes can be scheduled to happen at
     1.9  very precise times (in the coordinate system of AudioContext.currentTime), for envelopes, volume fades, LFOs, filter sweeps, grain
    1.10  windows, etc. In this way, arbitrary timeline-based automation curves can be
    1.11 -set on any AudioParam.
    1.12 +set on any AudioParam.  Additionally, audio signals from the outputs of <code>AudioNodes</code> can be connected
    1.13 +to an <code>AudioParam</code>, summing with the <em>intrinsic</em> parameter value.
    1.14  </p>
    1.15  
    1.16  <p>
    1.17 +The <em>final</em> parameter value used to control the audio DSP is calculated as follows:
    1.18 +</p>
    1.19 +
    1.20 +<ol>
    1.21 +<li>An <em>intrinsic</em> parameter value will be calculated at each time, which is either the value set directly to the .value attribute,
    1.22 +or, if there are any scheduled parameter changes (automation events), the value as calculated from these events.  If the .value attribute
    1.23 +is directly set during a time when there are any automation events, then it will be ignored.  When read, the .value attribute
    1.24 +always returns the <em>intrinsic</em> value for the current time.  If automation events are removed from a given time range, then the
    1.25 +<em>intrinsic</em> value will remain unchanged and stay at its previous value until either the .value attribute is directly set, or automation events are added
    1.26 +for the time range.
    1.27 +</li>
    1.28 +
    1.29 +<li>
    1.30 +An AudioParam will take the rendered audio data from any AudioNode output connected to it and <a href="#down-mix">convert it to mono</a> by down-mixing if it is not
    1.31 +already mono, then mix it together with other such outputs.
    1.32 +</li>
    1.33 +
    1.34 +<li>
    1.35 +The <em>final</em> parameter value is the sum of the <em>intrinsic</em> value and the value calculated from (2).
    1.36 +</li>
    1.37 +
    1.38 +</ol>
    1.39 +
    1.40 +<p>
    1.41  Some synthesis and processing <code>AudioNodes</code> have <code>AudioParams</code> as attributes whose values must
    1.42   be taken into account on a per-audio-sample basis.
    1.43  For other <code>AudioParams</code>, sample-accuracy is not important and the value changes can be sampled more coarsely.