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

Re: Timing limitations when programming MIDI with Javascript

From: Jussi Kalliokoski <jussi.kalliokoski@gmail.com>
Date: Tue, 5 Jun 2012 22:43:14 +0300
Message-ID: <CAJhzemXzTz8f016omBJTg8=BiV-S44-r5TWWbkzDVdbZkXJfbw@mail.gmail.com>
To: James Ingram <j.ingram@netcologne.de>
Cc: Chris Wilson <cwilso@google.com>, public-audio@w3.org
On Tue, Jun 5, 2012 at 10:26 PM, James Ingram <j.ingram@netcologne.de>wrote:

> Hi Chris, all,
>
>
>         This is actually where the timestamps shine. You can have a
>>        clock interval, like 200 milliseconds, where you proceed
>>        reading a list of events and queue the events that are going
>>        to occur in the following 200ms, and send them to be played at
>>        respective times, without a need for individual setTimeouts
>>        for each event which is very CPU-intensive, and not to mention
>>        that events that are supposed to occur at the same time don't
>>        necessarily do so, maybe due to GC or rendering or whatever is
>>        blocking the next timeout.
>>
>>
>>    I think the penny just dropped! Thanks for your patience. Is this
>>    actually working in Midibridge? Perhaps there should be an example
>>    in the docs...
>>
>>
>> No.  MIDIBridge doesn't currently have timestamps, I don't believe.
>>
> So I'll have to go back to using setTimout() for the moment then (as I
> said, that's not the end of the world).
> Is there any way that I could try using timestamps? That's going to have
> to be done sometime. The sooner the better...


Looking at the code, it looks like MIDIBridge has timestamps, but I'm not
sure if they affect anything, gotta try later.

Cheers,
Jussi
Received on Tuesday, 5 June 2012 19:43:43 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 5 June 2012 19:43:44 GMT