On Sunday 17 June 2012, you wrote: > On Sun 17 Jun 2012 13:02:39 IST, Pedro Lopez-Cabanillas wrote: > > 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.h > > tml > > > > 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 > > Thanks for your reply. I had originally used this this method with the > sequencer callback and it worked fine, as it does in your example.
So, the problem is not in fluid_sequencer_send_at(), but in another place. > The > problem is that this method does suit the rest of the application which > is processing events for any number of synths and for lv2 and other > filters (basically a modular synth application). So I'm not using > fluid_sequencer_register_client and a callback to add new events, > instead I'm adding events using fluid_sequencer_send_at and then > directly calling fluid_synth_write_float in effectively one large loop. The length of the block processed by fluid_synth_write_float() is the same or smaller than the total duration of the events previously sent to the sequencer ? > The code for the loop is spread over several files, but I've attached > pseudo-code showing the effective loop. Sorry, there are things that I don't understand in your pseudocode. For instance, how is calculated TIME_STEP in the call to fluid_synth_write_float() ? maybe you wanted to use FRAME_STEP instead ? Can you please post a simple C or C++ working code that can be compiled and illustrates your problem? Regards, Pedro _______________________________________________ fluid-dev mailing list fluid-dev@nongnu.org https://lists.nongnu.org/mailman/listinfo/fluid-dev