fluid-dev
[Top][All Lists]
Advanced

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

Re: [fluid-dev] fluid_sequencer_send_at ignoring time when not using an


From: Raja Mukherji
Subject: Re: [fluid-dev] fluid_sequencer_send_at ignoring time when not using an audio driver
Date: Sun, 17 Jun 2012 14:51:49 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120430 Thunderbird/12.0.1



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.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

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. 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 code for the loop is spread over several files, but I've attached pseudo-code showing the effective loop.

I have found a working solution for now, by writing my own simple sequencer (which interleaves calls to fluid_synth_write_float with direct calls to fluid_synth_noteon, fluid_synth_noteoff, etc).

Regards,
Raja

Attachment: renderloop.c
Description: Text Data


reply via email to

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