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

Re: MIDI in Web Audio

From: Alistair Macdonald <al@bocoup.com>
Date: Fri, 22 Apr 2011 17:04:54 -0400
Message-ID: <BANLkTikEGsSxD26UVZkSoJyxvVs1332neg@mail.gmail.com>
To: Olli@pettay.fi
Cc: Chris Rogers <crogers@google.com>, Vilson Vieira <vilson@void.cc>, public-audio@w3.org, Grant Galitz <grantgalitz@gmail.com>
>
> So MIDI messages go over HTTP? Isn't latency pretty bad that way?
>

I have done this before:

USB MIDI > JAVA > Apache & PHP > JavaScript

I was using it to turn CC dials in to control a 3D landscape. The latency
was very good locally (sub milliseconds). But very  inconsistent across the
internet (as expected) which was sometimes quick but usually too slow to be
called "real-time".

Obviously HTTP MIDI is no kind of long-term solution and as Chris Rogers
points out, the device spec is probably the best way forward. It would also
be good to see someone develop MIDI-based browser plugins to test how such
things might work in the future, such as device recognition,
master-controller assignment, channel routing etc.

Even so Olli, I wanted you to be aware that a local HTTP-based MIDI
interface was in fact fast enough for a real-time music performance. The
latency was typically around a millisecond, which is actually 32 times
faster than my software synthesizer can turn my MIDI data into sound. :)

-- Alistair



On Fri, Apr 22, 2011 at 3:12 PM, Vilson Vieira <vilson@void.cc> wrote:

> Hi Olli and Chris,
>
> 2011/4/22 Chris Rogers <crogers@google.com>
>
>> Olli,
>>
>> I think people are just experimenting with getting MIDI events into the
>> browser any way they can right now.  If we add browser support for it, then
>> of course we can bypass the HTTP latency.
>>
>
> yes, it is the point. We have latency on HTTP but IMHO for now it is the
> best we can do.
>
>
>> The MIDI events from the OS will come in on their own thread, which can
>> then be dispatched to a JS event listener.  Of course, this is assuming that
>> a proposal for a MIDI JavaScript API is crafted and implemented.
>>
>
> I'd like to help on this. I'm thinking if it could be related with the work
> of Device APIs and Policy WG [1] or Webinos Discovery Plugin [2].
>
> Cheers.
>
> PS : I forgot to include the reference to osc-web so here it is
> http://automata.cc/osc-web
>
> [1] http://www.w3.org/2009/dap/
> [2] http://www.w3.org/2011/04/discovery.html
>
> --
> Vilson Vieira
>
> vilson@void.cc
>
> ((( http://automata.cc )))
>
> ((( http://musa.cc )))
>
Received on Friday, 22 April 2011 21:06:34 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 April 2011 21:06:34 GMT