[SDL] accurate audio timing

Richard Henwood r.henwood at rl.ac.uk
Fri Jan 4 05:36:13 PST 2008


David Olofson wrote:

> On Friday 04 January 2008, Richard Henwood wrote:
> [...]
>> In short, if I want to make a reliably timed, cross-platform
>> metronome, which route should go; threads, callback, something else?
> 
<snip valueable advice>

Thanks for the detailed response. It has clarified a number of grey areas
for me. 

My other idea for an approach was to delegate the audio completely to a
library, like libmikmod and have it play 'metronome.mod'. I would then ask
the library to tell me when a beat was playing, rather than call the beat
from SDL. 

However, since libmikmod does not apprently have a callback or other nice
mechanism to do this, my search continues... 
 
> 
> You might want to look at DT-42, which is a minimalistic tracker style
> drum machine/sequencer that deals with most of these issues - or at
> least, tries to, within the limits of the SDL API:
> http://olofson.net/mixed.html
> 

... and DT-42 looks like a good candidate for study. I'll check that out.

Thanks again for your help 
r,




More information about the SDL mailing list