Tweaked examples of MIDI API usage. https://www.w3.org/Bugs/Public/show_bug.cgi?id=20254
authorChris Wilson <cwilso@gmail.com>
Mon, 10 Dec 2012 09:59:45 -0800
changeset 244 39efc30b003f
parent 243 d61cc0adee7e
child 245 ba50122bd35b
child 247 17650b57632e
Tweaked examples of MIDI API usage. https://www.w3.org/Bugs/Public/show_bug.cgi?id=20254
Re-worded fingerprint. https://www.w3.org/Bugs/Public/show_bug.cgi?id=19803
midi/specification.html
--- a/midi/specification.html	Mon Dec 10 09:52:42 2012 -0800
+++ b/midi/specification.html	Mon Dec 10 09:59:45 2012 -0800
@@ -527,7 +527,8 @@
             best it can to match a port across instances of the MIDI API: 
             for example, storing the port interface manufacturer, name and 
             index in the fingerprint, and attempting to find any ports with 
-            that name to consider as a match. </p>
+            that name to consider as a match. Applications may use the 
+            comparison of fingerprints of MIDIPorts to test for equality.</p>
         </dd>
         <dt>readonly attribute DOMString manufacturer</dt>
         <dd>
@@ -727,7 +728,7 @@
         <h3>Sending MIDI Messages to an Output Device</h3>
         <p>This example sends a middle C note on message immediately on MIDI channel 0, and queues a corresponding note off message for 1 second later.</p>
         <pre class="code es-code">function sendMiddleC( midiAccess, indexOfPort ) {
-  var output = midiAccess.getOutput( index );
+  var output = midiAccess.getOutput( indexOfPort );
   output.send( [0x90, 60, 0x7f] );  // note on, middle C, full velocity - omitting the timestamp means send immediately.
   output.send( [0x80, 60, 0x40], window.performance.now() + 1000.0 ); // note off, middle C, release velocity = 64, 
                                                                       // timestamp = now + 1000ms.