[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [fluid-dev] syncing fluidsynth with sampled audio

From: Matt Giuca
Subject: Re: [fluid-dev] syncing fluidsynth with sampled audio
Date: Wed, 24 Nov 2010 22:17:44 +1100

I would like to find a way to sync midi playback with some recorded audio I have. I'm not planning on using any audio driver. I want to pull the audio data usingĀ fluid_synth_write_s16().

I'm not quite sure how the fluid_synth_write_s16 interface works, but I don't think it does its own timing. It simply lets you pull an arbitrary amount of samples out of the synth whenever you like, right?

So it rather depends on what your sampled audio program looks like, but typically (when it is a low-level interface, like SDL_Audio), it will provide you with a buffer of some size, and require that you load precisely that many samples into it, and it will play along the buffer in real-time, occasionally asking you to put more samples into the buffer. At that point, you can just load the precise number of samples from FluidSynth using fluid_synth_write_s16, and copy those into the buffer (mixing with your recorded audio).

In a simpler sense, it is entirely up to you how to time it because you can pull any number of samples you want out of the synthesiser.

(Unless I am mistaken)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]