title: Sinewave.js won't play several notes when the new frequency is set
body: <p>I am having a problem trying to get sinewave.js-plugin to play several notes in succession.</p>
  <p><a href="https://github.com/0xfe/experiments/tree/master/www/tone" rel="nofollow noreferrer">Link to the sinewave.js Github page</a></p>
  <p>Here is my code.</p>
  <pre><code>scalePlayer = function(){
  var command = arguments[0]; 
  
  if (command == 'play'){
      sinewave.setFrequency(261.63); // C4
      sinewave.play();
  }else if (command == 'pause'){
      sinewave.pause();
  }else if (command == 'cmajor'){
      // C major scale
      var scale=[
          &quot;130.81&quot;,
          &quot;146.83&quot;,
          &quot;164.81&quot;,
          &quot;174.61&quot;,
          &quot;196.00&quot;,
          &quot;220.00&quot;,
          &quot;246.94&quot;,
          &quot;261.63&quot;];
      s = scale.length;
      i=0;
      while (i&lt;=s){
          setTimeout(&quot;sinewave.setFrequency(&quot;+parseFloat(scale[i])+&quot;)&quot;, 1000);
          console.log(parseFloat(scale[i]));
        i++;
       }  
  
  }else if (command == 'test'){
          setTimeout(&quot;sinewave.setFrequency(300)&quot;, 1000);
          setTimeout(&quot;sinewave.setFrequency(500)&quot;, 1000);
  }
  }
  </code></pre>
  <p>The &quot;test&quot; command only plays the first note of the two, and the one that actually goes through the scale frequencies plays nothing, but prints the correct tones from the array.</p>
  <p>What I am trying to achieve is that the &quot;cmajor&quot; command would play a scale, one note every 1 seconds.</p>
  <p>I feel like the setTimeout is causing problems, and I can't understand why the &quot;test&quot; command won't play two different notes.</p>