W3C home > Mailing lists > Public > public-audio@w3.org > April to June 2012

Re: Comments on draft MIDI API

From: Chris Wilson <cwilso@google.com>
Date: Wed, 27 Jun 2012 09:22:39 -0700
Message-ID: <CAJK2wqUn9dO+MESpOx2v2hDeb0T39sVv83AA9CaubMWuZstuQg@mail.gmail.com>
To: Adam Goode <agoode@google.com>
Cc: Jussi Kalliokoski <jussi.kalliokoski@gmail.com>, Dominique Hazael-Massieux <dom@w3.org>, public-audio@w3.org
Sorry, I/O has been taking all my attention lately - but I do want to
underscore that there is a confusing difference between a "MIDIDevice" and
a MIDI device (e.g. a rack-mount synthesizer unit).  MIDIDevice represents
a MIDI interface - so the enumeration, for example, is enumerating the MIDI
interfaces available, NOT polling the MIDI devices plugged into those
interfaces.  Sometimes these are the same - e.g. my USB MIDI keyboard is an
interface as well as a MIDI device - but sometimes they're not (e.g. the
several synths and drum machines I have chained together from a single 4x4
MIDI interface.

On Tue, Jun 26, 2012 at 8:44 AM, Adam Goode <agoode@google.com> wrote:

> On Tue, Jun 26, 2012 at 11:34 AM, Jussi Kalliokoski <
> jussi.kalliokoski@gmail.com> wrote:
>
>> The semantics here may be too strong, maybe SHOULD should be used instead
>> of MUST, as forcing the browser to poll on the devices when the OS doesn't
>> provide an API for this is a bad idea. And disconnect and connect are not
>> applicable to MIDI ports anyway (as in, not direct USB connection).
>>
>>
>>> > And the API does allow for (un)plugging. [1]
>>>
>>> But only for devices that the app already knows about and keeps track of
>>>  or am I missing something? To be more concrete, how would a Web app
>>> know that the new MIDI keyboard I just bought just got plugged in?
>>>
>>
>> According to the current API, the only way would be polling. I've been
>> thinking of a way to fix this, perhaps an event to MIDIAccess when any
>> device is plugged in or out would suffice, but I'm not sure yet.
>>
>>
>>>
>>>
> Putting the event on MIDIAccess seems like the right thing. Many MIDI
> devices are USB, so you'll get that notification. I like the way CoreMIDI
> does it on iOS, you get all sorts of notifications for various events:
>
> http://developer.apple.com/library/ios/#documentation/CoreMidi/Reference/MIDIServices_Reference/Reference/reference.html#//apple_ref/doc/c_ref/MIDINotificationMessageID
>
>
> Adam
>
Received on Wednesday, 27 June 2012 16:23:14 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 27 June 2012 16:23:21 GMT