Re: [livecode] livecode systems architecture questions

From: Adrian Ward <adrian_at_signwave.co.uk>
Date: Thu, 16 Nov 2006 16:54:17 +0000

On 15 Nov 2006, at 17:40, Dylan McNamee wrote:

> Since I'm going to be doing this on MacOS X, what about using
> NSTimer or the RunLoopTimer? Alternatively, should I consider
> building my livecoding system as a kernel module and using the real-
> time facilities provided to device drivers?

If you're talking about generating sounds, then I don't think using
CFRunLoopTimer (which is toll-free bridged to NSTimer, so it's the
same thing anyway) will give you good enough results. Or, atleast, if
it was good enough on one machine then you couldn't be sure it would
be on another. It's not realtime, as you know.

I count audio samples from my IOProc and use that to derive a time to
which all sounds and events are synced. I'm fairly confident that
CoreAudio is consistent once it gets going but I have noticed a
little bit of oddity. Sometimes in the first few milliseconds of
operation, CoreAudio uses a lower sampling rate until it ramps up to
the desired one. My understanding of this is a bit sketchy but I
think it has to do with the way CoreAudio optimises itself to reduce
latency. So you lose a bit of accuracy in the first few frames of
your audio, but in the long run CoreAudio should be very precise and
responsive.

Anyway, funky music is never properly synchronised anyway.


-- 
Ade
Received on Thu Nov 16 2006 - 16:58:45 GMT

This archive was generated by hypermail 2.4.0 : Sun Aug 20 2023 - 16:02:23 BST