Tweaks to the Web MIDI API.
authorJussi Kalliokoski <jussi.kalliokoski@gmail.com>
Tue, 05 Jun 2012 23:07:38 +0300
changeset 75 16a8505511c0
parent 74 902e92d5d069
child 76 1ab2a972b9bc
Tweaks to the Web MIDI API.

* Fixed a typo (getInput => getOutput).
* Changed the order of arguments for createMIDIMessage.
* Added a shorthand method, MIDIOutputDevice#sendMessage, see
http://lists.w3.org/Archives/Public/public-audio/2012AprJun/thread.html
for thread Re: Timing limitations when programming MIDI with Javascript
for further details about the reasoning.
midi/specification.html
--- a/midi/specification.html	Tue Jun 05 13:58:25 2012 +0300
+++ b/midi/specification.html	Tue Jun 05 23:07:38 2012 +0300
@@ -194,7 +194,7 @@
 
           <p>
             When the
-            <dfn id="midiaccess-get-output"><code>getInput()</code></dfn>
+            <dfn id="midiaccess-get-output"><code>getOutput()</code></dfn>
             is invoked, the user agent MUST run the following steps:
           </p>
 
@@ -238,9 +238,9 @@
             </li>
           </ol>
         </dd>
-        <dt><a>MIDIMessage</a> createMIDIMessage(short status, Uint8Array?
-                                    data, DOMHighResTimeStamp? timestamp,
-                                    short? channel)</dt>
+        <dt><a>MIDIMessage</a> createMIDIMessage(short status, short? channel,
+                                    DOMHighResTimeStamp timestamp,
+                                    Uint8Array? data)</dt>
         <dd>
           <p>
             Creates and returns a new <code><a>MIDIMessage</a></code> according
@@ -256,13 +256,13 @@
           <ol>
             <li>
               <p>
-                Let <var>status</var> be the <code>short</code> argument.
+                Let <var>status</var> be the first <code>short</code> argument.
               </p>
             </li>
 
             <li>
               <p>
-                Let <var>data</var> be the <code>Uint8Array</code> argument.
+                Let <var>channel</var> be the second <code>short</code> argument.
               </p>
             </li>
 
@@ -277,7 +277,7 @@
 
             <li>
               <p>
-                Let <var>channel</var> be the <code>short</code> argument.
+                Let <var>data</var> be the <code>Uint8Array</code> argument.
               </p>
             </li>
 
@@ -467,6 +467,16 @@
               signifying whether the operation was succesful.
             </p>
           </dd>
+          <dt>boolean sendMessage(short status, short? channel,
+                                    DOMHighResTimeStamp timestamp,
+                                    short? data0, short? dataX)</dt>
+          <dd>
+            <p>
+              Creates a new MIDI message, sends it to the device
+              and returns a boolean signifying whether the
+              operation was succesful.
+            </p>
+          </dd>
         </dl>
       </section>
     </section>