fluid-dev
[Top][All Lists]
Advanced

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

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


From: Raja Mukherji
Subject: [fluid-dev] fluid_sequencer_send_at ignoring time when not using an audio driver
Date: Thu, 14 Jun 2012 13:19:53 +0100

Hi,

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.

These are the notes I'm playing (in json format). This pattern is
looped every 4 seconds. There are two deliberate longer pauses between
the 1st and 2nd notes and between the 3rd and 4th notes.

                                                {"target": 0, "start": 400, 
"event": "note", "key": 63,
"velocity": 127, "duration": 100},
                                                {"target": 0, "start": 1200, 
"event": "note", "key": 69,
"velocity": 127, "duration": 100},
                                                {"target": 0, "start": 1600, 
"event": "note", "key": 72,
"velocity": 127, "duration": 100},
                                                {"target": 0, "start": 2400, 
"event": "note", "key": 75,
"velocity": 127, "duration": 100},
                                                {"target": 0, "start": 2800, 
"event": "note", "key": 78,
"velocity": 127, "duration": 100},
                                                {"target": 0, "start": 3200, 
"event": "note", "key": 81,
"velocity": 127, "duration": 100},
                                                {"target": 0, "start": 3600, 
"event": "note", "key": 84,
"velocity": 127, "duration": 100}

These are the generated events for each block (start is relative to
the start of the 3 second block, sequencer:tick is what is returned
from fluid_sequencer_get_tick).

--------------------
sequencer:tick = 0
start = 400, key = 63, duration = 100
start = 1200, key = 69, duration = 100
start = 1600, key = 72, duration = 100
start = 2400, key = 75, duration = 100
start = 2800, key = 78, duration = 100
--------------------
sequencer:tick = 12900
start = 200, key = 81, duration = 100
start = 600, key = 84, duration = 100
start = 1400, key = 63, duration = 100
start = 2200, key = 69, duration = 100
start = 2600, key = 72, duration = 100
--------------------
sequencer:tick = 25600
start = 400, key = 75, duration = 100
start = 800, key = 78, duration = 100
start = 1200, key = 81, duration = 100
start = 1600, key = 84, duration = 100
start = 2400, key = 63, duration = 100
--------------------
sequencer:tick = 38099
start = 200, key = 69, duration = 100
start = 600, key = 72, duration = 100
start = 1400, key = 75, duration = 100
start = 1800, key = 78, duration = 100
start = 2200, key = 81, duration = 100
start = 2600, key = 84, duration = 100
--------------------
sequencer:tick = 48075
start = 400, key = 63, duration = 100
start = 1200, key = 69, duration = 100
start = 1600, key = 72, duration = 100
start = 2400, key = 75, duration = 100
start = 2800, key = 78, duration = 100
--------------------
sequencer:tick = 60988
start = 200, key = 81, duration = 100
start = 600, key = 84, duration = 100
start = 1400, key = 63, duration = 100
start = 2200, key = 69, duration = 100
start = 2600, key = 72, duration = 100

I've attached an image of the output (plotted using R) and clearly the
timing does not match the events being generated.
I am using libfluidsynth 1.1.5 on Ubuntu. I'm using my own programming
language (Wrapl) for the task so I haven't posted the source, but I
can if it will help.

Thanks,

Raja

Attachment: output.png
Description: PNG image


reply via email to

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