Bug 17334: Add precise equations for AudioParam.setTargetValueAtTime()
authorcrogers
Wed, 13 Jun 2012 17:40:49 -0700
changeset 84 d86920562bf1
parent 83 1d90202f29bb
child 85 f415796410bf
Bug 17334: Add precise equations for AudioParam.setTargetValueAtTime()
webaudio/specification.html
--- a/webaudio/specification.html	Mon Jun 11 13:00:17 2012 +0100
+++ b/webaudio/specification.html	Wed Jun 13 17:40:49 2012 -0700
@@ -1452,12 +1452,27 @@
       change to the target value at the given time, but instead gradually
       changes to the target value.</p>
       <p>The <dfn id="dfn-targetValue">targetValue</dfn> parameter is the value
-      the parameter will *start* changing to at the given time.</p>
+      the parameter will <em>start</em> changing to at the given time.</p>
       <p>The <dfn id="dfn-time">time</dfn> parameter is the time in the same time coordinate system as AudioContext.currentTime.</p>
       <p>The <dfn id="dfn-timeConstant">timeConstant</dfn> parameter is the
       time-constant value of first-order filter (exponential) approach to the
       target value. The larger this value is, the slower the transition will
       be.</p>
+      <p>
+      More precisely, <em>timeConstant</em> is the time it takes a first-order linear continuous time-invariant system
+      to reach the value 1 - 1/e (around 63.2%) given a step input response (transition from 0 to 1 value).
+      </p>
+      <p>
+      During the time interval: <em>T0</em> <= t < <em>T1</em>, where T0 is the <em>time</em> parameter and T1 represents the time of the event following this
+      event (or <em>infinity</em> if there are no following events):
+      </p>
+      <pre>
+      v(t) = V1 + (V0 - V1) * exp(-(t - T0) / <em>timeConstant</em>)
+      </pre>
+      <p>
+      Where V0 is the initial value (the .value attribute) at T0 (the <em>time</em> parameter) and V1 is equal to the <em>targetValue</em>
+      parameter.
+      </p>
     </dd>
 </dl>
 <dl>