[LAD] Fw: Re: Deriving a steady MIDI clock crossplatform?

Jeanette C. julien at mail.upb.de
Thu May 19 23:17:28 CEST 2022


Thanks both of you. Based on timed_wait, I looked at the boost libraries and 
found two candidates in the Thread library:
conditional_varaible::timed_wait
and
thread::sleep_until
which can both take an absolute time. I suppose both should be equally usable, 
since again absolute time can be calculated independent of the last 
wait/sleep?

Best wishes,

Jeanette

May 19 2022, Fons Adriaensen has written:

> On Thu, May 19, 2022 at 10:40:48PM +0200, Robin Gareus wrote:
> 
>> While there is a corresponding mach/clock.h, for the case at hand it is
>> preferable to use Apple's Core Audio, CoreMIDI. MIDI Event scheduling is
>> abstracted, and there is dedicated API to convert timestamped events
>> with high precision:
>> 
>> AudioConvertNanosToHostTime() and AudioConvertHostTimeToNanos()
>
> The problem here is not conversion, but what to wait for,
>
> In zita-convolver.h there is an implementation of sem_t for OSX
> (which only has a crippled implementation), using a condition
> variable. It doesn't have sem_timedwait(), (since zita-convolver
> doesn't need it) but that could be added quite easily.
>
> Ciao,
>
> -- 
> FA
>
> _______________________________________________
> Linux-audio-dev mailing list
> Linux-audio-dev at lists.linuxaudio.org
> https://lists.linuxaudio.org/listinfo/linux-audio-dev

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

If there's nothing missing in my life
Then why do these tears come at night <3
(Britney Spears)


More information about the Linux-audio-dev mailing list