[music-dsp] Real Time Tempo & Synchronising Issues

Amarpreet Basi A.S.Basi at warwick.ac.uk
Tue Feb 1 14:22:26 EST 2005


[@#! sorry--incomplete post...lets try again]

hi Ben. I've investigated the callback route that you've outlined below. Got a few problems though so any suggestions would be extremely helpful.

i've got something like this

callback function (outputBuffer)
{
 /* I want to "trigger" sounds at X bpm
 I know it involves filling the output buffer
 with the sample data, but exactly how do i control
 the rate of the samples being output when the
 timing interval between each call of this function is
 fixed at some specified constant (set by the API 
 makers, 25 milliseconds in this case) */

 return outputBuffer;
}

>>> Amarpreet Basi 02/01/05 19:18 PM >>>
hi Ben. I've investigated the callback route that you've outlined below. Got a few problems though so any suggestions would be extremely helpful. 

i've got something like this

callback function (output buffer)
{
  //


}

>>> ben at glw.com 01/25/05 16:21 PM >>>

The "hardware clock" that you need to get access to is that of the soundcard  
in your computer.  The way to take advantage of the soundcard's clock is to 
use a "callback" based API.  This means that, as the soundcard outputs audio 
samples, your callback function will be asked to fill the buffers before they 
are sent to the sound card.  You have the ability to touch every outgoing 
sample before it is sent to the soundcard,and therefore you can derive your 
timing very accurately (assuming that the soundcard's clock is accurate!)

I'm not familiar with FMOD but I think it allows for a "callback" based API in 
additon to the simplified API you are using.  I see a feature called "WAV 
marker synchronization call-backs" which might allow you to fire sounds on 
sample-accurate locations within the stream, while still taking advantage of 
the high-level file abstractions.  Maybe you should look into that.

-Ben  Loftis

--
dupswapdrop -- the music-dsp mailing list and website: 
subscription info, FAQ, source code archive, list archive, book reviews, dsp links 
http://shoko.calarts.edu/musicdsp 
http://ceait.calarts.edu/mailman/listinfo/music-dsp

--
dupswapdrop -- the music-dsp mailing list and website:
subscription info, FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp
http://ceait.calarts.edu/mailman/listinfo/music-dsp




More information about the music-dsp mailing list