How to stop playing all notes
<p>I am using <a href="https://github.com/mudcube/MIDI.js" rel="nofollow">MIDI.js</a> library and I want to stop playing all notes which are activated with following code.</p>

<pre><code>  function myPlayer(myMid){       
      var delay = 0; // play one note every quarter second
      var start = 0;
      var note = 36; // the MIDI note
      var velocity = 127; // how hard the note hits
      var currentIds = [];
      MIDI.setVolume(0, 127);

      for(j=0; j&lt;myMid.length; j++){
          delay = parseFloat(myMid[j][0])/8;                    

          for(i=2; i&lt;myMid[j].length; i++){               
              note = mIn[parseInt(myMid[j][i])-1];   

              MIDI.noteOn(0, note, velocity, start);                        
              MIDI.noteOff(0, note, start + delay);    
          }            
          start += delay;
      }
  }
</code></pre>

<p>I was trying with <code>MIDI.stop()</code> and <code>MIDI.stopAllNotes()</code> but not working...</p>