<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>17334</bug_id>
          
          <creation_ts>2012-06-05 11:25:34 +0000</creation_ts>
          <short_desc>(setTargetValueAtTime): AudioParam.setTargetValueAtTime is misleading and underdefined</short_desc>
          <delta_ts>2012-10-16 13:56:54 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>AudioWG</product>
          <component>Web Audio API</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>TBD</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Philip Jägenstedt">philipj</reporter>
          <assigned_to name="Chris Rogers">crogers</assigned_to>
          <cc>crogers</cc>
    
    <cc>heiskr</cc>
    
    <cc>jussi.kalliokoski</cc>
    
    <cc>mage</cc>
    
    <cc>olivier.thereaux</cc>
    
    <cc>philipj</cc>
    
    <cc>public-audio</cc>
          
          <qa_contact name="This bug has no owner yet - up for the taking">dave.null</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>68645</commentid>
    <comment_count>0</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2012-06-05 11:25:34 +0000</bug_when>
    <thetext>Audio-ISSUE-38 (setTargetValueAtTime): AudioParam.setTargetValueAtTime is misleading and underdefined [Web Audio API]

http://www.w3.org/2011/audio/track/issues/38

Raised by: Philip Jägenstedt
On product: Web Audio API

The naming of this function is misleading, since it does not in fact set the target value at the given time.

timeConstant is underdefined, what is the exponent? A &quot;first-order filter (exponential)&quot; is mentioned, but not clarified further.

Finally, it is not well defined what the difference to exponentialRampToValueAtTime is, but we suspect that setTargetValueAtTime is something like v=1-e-kt. The equations involving the 3 parameters should be included in the spec, normatively.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69032</commentid>
    <comment_count>1</comment_count>
    <who name="Chris Rogers">crogers</who>
    <bug_when>2012-06-14 00:46:35 +0000</bug_when>
    <thetext>I disagree that the name is misleading.  It&apos;s a *target* value which we start approaching at precisely the time given.

* timeConstant is now defined.
* precise v(t) equation is now given:
https://dvcs.w3.org/hg/audio/rev/d86920562bf1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69488</commentid>
    <comment_count>2</comment_count>
    <who name="Olivier Thereaux">olivier.thereaux</who>
    <bug_when>2012-06-28 13:51:51 +0000</bug_when>
    <thetext>Philip, does this answer your concerns? 

Unless you or someone else can suggest a convincingly better name for setTargetValueAtTime, I think we can close this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69654</commentid>
    <comment_count>3</comment_count>
    <who name="Olivier Thereaux">olivier.thereaux</who>
    <bug_when>2012-07-05 14:34:01 +0000</bug_when>
    <thetext>Mailing-list discussion on this topic between Ray Bellis, Chris Rogers, Marcus Geelnard and myself:
http://lists.w3.org/Archives/Public/public-audio/2012AprJun/thread.html#msg856

Marcus has a pretty good summary, and raises something interesting:
http://lists.w3.org/Archives/Public/public-audio/2012AprJun/0865.html

«
Once you understand what the function does, the name makes sense. However,  
the name alone does not make it easy to understand what it does.

I think that the confusion (at least for me) is that &quot;setTargetValue&quot; is  
very similar to &quot;setValue&quot;, and I fear that many will have them mixed up.  
Generally speaking, the &quot;set&quot; term indicates a zero-duration operation.  
I&apos;d much rather see that methods that cause gradual changes use a  
consistent naming convention, excluding the term &quot;set&quot;.

I think that a more appropriate name could be &quot;approachValueAtTime&quot; or  
&quot;startApproachingValueAtTime&quot;.

Similarly the name &quot;setValueCurveAtTime&quot; would do better without &quot;set&quot;.  
Any suggestions? (I&apos;m out of ideas right now)
»</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69729</commentid>
    <comment_count>4</comment_count>
    <who name="Olivier Thereaux">olivier.thereaux</who>
    <bug_when>2012-07-09 08:52:11 +0000</bug_when>
    <thetext>Rob Baxter suggested the following on the mailing-list:

AudioParam.set(value, time)
AudioParam.linearRamp(value, time)
AudioParam.exponentialRamp(value, time)
AudioParam.approach(target, time, k)
AudioParam.curve(value_set, time, duration)


The suggestion already received two +1&apos;s, from Marcus and me.
http://lists.w3.org/Archives/Public/public-audio/2012JulSep/0017.html
http://lists.w3.org/Archives/Public/public-audio/2012JulSep/0030.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69739</commentid>
    <comment_count>5</comment_count>
    <who name="Jussi Kalliokoski">jussi.kalliokoski</who>
    <bug_when>2012-07-09 17:42:51 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; Rob Baxter suggested the following on the mailing-list:
&gt; 
&gt; AudioParam.set(value, time)
&gt; AudioParam.linearRamp(value, time)
&gt; AudioParam.exponentialRamp(value, time)
&gt; AudioParam.approach(target, time, k)
&gt; AudioParam.curve(value_set, time, duration)
&gt; 
&gt; 
&gt; The suggestion already received two +1&apos;s, from Marcus and me.
&gt; http://lists.w3.org/Archives/Public/public-audio/2012JulSep/0017.html
&gt; http://lists.w3.org/Archives/Public/public-audio/2012JulSep/0030.html

+1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69740</commentid>
    <comment_count>6</comment_count>
    <who name="">heiskr</who>
    <bug_when>2012-07-09 17:50:27 +0000</bug_when>
    <thetext>Having just gone through the process of figuring out what those different things mean for something I&apos;m working on (that image on the spec is awesome by the way), hooray for easier names :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72602</commentid>
    <comment_count>7</comment_count>
    <who name="Olivier Thereaux">olivier.thereaux</who>
    <bug_when>2012-08-23 10:01:37 +0000</bug_when>
    <thetext>We had a lengthy conversation about this during the group&apos;s teleconference on 22nd August 2012:
http://www.w3.org/2012/08/22-audio-minutes#item03

There was agreement that the name was imperfect, but there was a compromise to be reached between using a nice, short method name and one that describes the behaviour of the method well. We discussed whether to remove the &quot;at time&quot;, whether to remove &quot;set&quot;, and so on.  

In the end, we reached the following proposed resolution:

* Change the setTargetValueAtTime method to setTargetAtTime
* The rest of the methods are a decent enough compromise, will be kept as is

Related changes were also proposed, which would make the description and behaviour of AudioParam automation easier to understand and use:

* Use startTime / endTime parameter names for AudioParam automation methods
https://www.w3.org/Bugs/Public/show_bug.cgi?id=18661

* Setting audioparam value while there is an automation curve will cancel that automation curve and set value immediately
https://www.w3.org/Bugs/Public/show_bug.cgi?id=18662

* Need a method to get a readonly reading of the combined value when using AudioParam automation curve
https://www.w3.org/Bugs/Public/show_bug.cgi?id=18663</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74842</commentid>
    <comment_count>8</comment_count>
    <who name="Chris Rogers">crogers</who>
    <bug_when>2012-09-28 22:30:13 +0000</bug_when>
    <thetext>Marcus was present in one of the teleconferences where we decided to change:
setTargetValueAtTime() -&gt; setTargetAtTime()

The spec has now been updated.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75037</commentid>
    <comment_count>9</comment_count>
    <who name="Marcus Geelnard (Opera)">mage</who>
    <bug_when>2012-10-02 09:51:53 +0000</bug_when>
    <thetext>(In reply to comment #8)
&gt; The spec has now been updated.

I assume you&apos;re referring to this change: http://dvcs.w3.org/hg/audio/rev/aea45daa1200

Looks ok to me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76381</commentid>
    <comment_count>10</comment_count>
    <who name="Olivier Thereaux">olivier.thereaux</who>
    <bug_when>2012-10-16 13:56:54 +0000</bug_when>
    <thetext>No objection in 2 weeks, vetted: closing.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>