Re: [Web MIDI API] send() timestamp

Hi Marcos!

On Fri, Dec 14, 2012 at 9:24 PM, Marcos Caceres <marcos@marcosc.com> wrote:

> Hi,
> I'm a bit confused… why does the API require a timestamp relative to some
> time (i.e., performance.now())? For example:
>

This is to maintain symmetry with incoming messages, which have relative
timestamps, e.g.

// proxy
input.onmessage = function (e) {
  output.send(e.data, e.timestamp)
}

Cheers,
Jussi


>
> output.send(data, performance.now() + time);
>
> It seems to me that it would be better to just let the second argument be
> a delay (as a high resolution timestamp):
>
> //wait a few millis
> output.send(data, millis);
>
>
> The problem is that timestamps in the past always resolve to 0 (i.e., play
> now!), so seems kinda pointless to rely on a timestamp.  What am I missing?
>
> --
> Marcos Caceres
>
>
>
>

Received on Friday, 14 December 2012 19:55:30 UTC