Re: Aw: Re: Re: Reliable MIDI out

[email protected] Tue, 14 Jan 2020 09:54:51 -0300
Newsgroups gmane.comp.audio.supercollider.devel
Message-ID <CAFu0fFdV5ZRJ77uvHRZrLLQn-5y8vbNUTFUoJrQiZfZp+YLn7g@mail.gmail.com>
El dom., 5 ene. 2020 a las 15:13, <[email protected]> escribió:

> Converting thread time (since thread startup) to core audio time (system
> uptime, I believe) means capturing the initialization time for both into
> global variables, in order to translate the logical time to core audio
> time. One issue is the logical time doesn't move during MIDIClient.init,
> meaning that latency during initialization affects the snapped core audio
> time.
>

It should use the same logic as osc time, the problem is some of that part
is calculated using osc units in SystemClock. If time can´t be set directly
in time-since-epoch reference time in the MIDI system you can get
system-uptime time-of-initialization subtracting system-uptime to
time-since-epoch. Then you need the offset between sclang's
time-of-initialization (that is already there) and midi's
time-of-initialization and with that make a function similar
to elapsedTimeToOsc from SystemClock (which parameter is sclang's
time-of-initialization).

I don't know if the meaning of what I said is clear but I think that is the
way to go. The only new parameter needed is sclang-time to midi-time offset.