On Thursday 14 June 2012, Raja Mukherji wrote:
I'm not sure if I'm doing something wrong but it seems as though
fluid_sequencer_send_at is ignoring the time parameter.
I'm trying to use fluid_synth_write_float to render music to a buffer
that I can then encode and stream to a browser. Hence realtime
rendering is not important, rather rendering as fast as possible is
desired.
I've created a sequencer using new_fluid_sequencer2(0) so it's not
using the system timer. I'm trying to render in 3 second blocks
(arbitrary for now, I've tried smaller and longer blocks). For each
block, I create and send all the events for that block. Then I call
fluid_synth_write_float. It seems that the tick value of the sequencer
does not change in a manner consistent with the call to
fluid_synth_write_float so I am adjusting the times for all events in
a block by the value returned by fluid_sequencer_get_tick and using
relative times (so the last parameter to fluid_sequencer_send_at is
false). I have tried using absolute times too, with no difference.
I can't reproduce your problem. Attached is a slightly version of our
fluidsynth_metronome program that is distributed in the doc/ folder of
FluidSynth:
http://fluidsynth.sourceforge.net/api/fluidsynth__metronome.c-example.html
Instead of using an audio driver, this modified program renders 10 bars of
the metronome pattern to a wav disk file. It uses absolute tick times, like
the original sample program. The result has all beats where they should be.
Regards,
Pedro