[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [fluid-dev] File output with FluidSynth API
From: |
David Henningsson |
Subject: |
Re: [fluid-dev] File output with FluidSynth API |
Date: |
Thu, 11 Mar 2010 21:05:14 +0100 |
User-agent: |
Thunderbird 2.0.0.23 (X11/20090817) |
Felix Krause wrote:
> On 06.03.2010, at 19:09, David Henningsson wrote:
>> A debug print of the delay variable in fluid_timer_run might also be
>> helpful (just before the call to g_usleep).
>
> Here's what I got as debug output when rendering to a wave file with
> libsndfile:
>
> Sample_time = 0, clock_time = 0
> delay = 1
> Sample_time = 1, clock_time = 0
> delay = 2
> Sample_time = 1, clock_time = 0
> delay = 3
> Sample_time = 1, clock_time = 0
> delay = 4
> Sample_time = 1, clock_time = 0
> delay = 5
> Sample_time = 1, clock_time = 0
> delay = 6
> Sample_time = 1, clock_time = 0
> delay = 7
> Sample_time = 1, clock_time = 0
> delay = 8
> Sample_time = 1, clock_time = 0
> delay = 9
> Sample_time = 1, clock_time = 0
> delay = 10
If the clock_time never advances beyond zero, it definitely looks like
some problem with fluid_curtime (or g_get_current_time in glib).
Could it be a rounding problem? Please try this change to fluid_curtime():
unsigned int fluid_curtime(void)
{
GTimeVal timeval;
unsigned int result;
g_get_current_time (&timeval);
result = (unsigned int) (timeval.tv_sec * (gdouble) 1000.0 +
timeval.tv_usec / (gdouble) 1000.0);
fprintf(stderr, "tv_sec = %d, tv_usec = %d, curtime = %d\n",
timeval.tv_sec, timeval.tv_usec, result);
return result;
}
// David
- Re: [fluid-dev] File output with FluidSynth API, Felix Krause, 2010/03/02
- Re: [fluid-dev] File output with FluidSynth API, David Henningsson, 2010/03/04
- Re: [fluid-dev] File output with FluidSynth API, Felix Krause, 2010/03/05
- Re: [fluid-dev] File output with FluidSynth API, David Henningsson, 2010/03/06
- Re: [fluid-dev] File output with FluidSynth API, Felix Krause, 2010/03/11
- Re: [fluid-dev] File output with FluidSynth API,
David Henningsson <=
- Re: [fluid-dev] File output with FluidSynth API, Felix Krause, 2010/03/11
- Re: [fluid-dev] File output with FluidSynth API, Pedro Lopez-Cabanillas, 2010/03/17
- Re: [fluid-dev] File output with FluidSynth API, David Henningsson, 2010/03/17