[Top][All Lists]

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

Re: [fluid-dev] Re: Changes checked into CVS

From: Josh Green
Subject: Re: [fluid-dev] Re: Changes checked into CVS
Date: Thu, 23 Nov 2006 19:13:37 +0000

Hello Mihail Zenkov,

Question to others on the list: Anyone have an application using a
new_fluid_*_audio_driver2() call?

On Wed, 2006-11-22 at 02:57 +0200, Mihail Zenkov wrote:
> But it have big overhead: many buffers, many purposeless copy of memory.

Yes you are right and I wanted to axe it myself.  Not sure what the
original author, Peter Hanappe, had in mind when he added that.  I would
guess it is to allow applications using FluidSynth to get their fingers
on the audio data and do other processing before it goes out to the
device.  I suppose the other option is to make it to where if the
new_fluid_*_audio_driver2 functions are used they could do the extra
copy and if the regular new_fluid_*_audio_driver calls are used then the
more efficient single conversion could be done.  Therefore backwards
compatibility would be preserved and the normal case would be more

> > - I removed the roundf calls since they seem to require a special
> > -std=c99 compiler switch, which makes me doubt it works in Windows.
> Without roundf() 0.5f (or 0.9f) = 0.
> We can do dithering without roundf():
> - d = rand() / (float)RAND_MAX - 0.5f;
> +d = rand() / (float)RAND_MAX * 2.0f - 1.0f;
> but it have worse THD.

Not sure I quite understand your argument there (I'm OK at math, but not
great :)  I'm ready to take your word for it, but..

>From what I can see:  The random table contains values between -0.5 and
0.5 (well actually its the difference between a new random value and the
previous, which seems weird to me, since the numbers are supposed to be
random anyways).  These are then added to the floating point sample
values of the audio.  roundf() would round the value to the nearest
integer away from 0, whereas an integer assignment would just truncate
it.  Adding 0.5 and then truncating the fractional result would be the
same as rounding though, correct? (Except it wouldn't be always away
from 0, but instead to the lower integer).

Anyways, if we can find a solution that works across Windows/Linux and
Mac OSX I'd be happy :)

> It not very complicate. Just set gain very low (0.0001) and set maximum
> loudness in amp and mixer ;)

Will give that a try!

> > I did discover another bug in the process.  There seems to be a rather
> > explosive audio problem with some instruments played at very high notes.
> > I suspect a filter issue (there were several similar issues in the
> > past).  Not sure at this point how to fix it though.
> I try reproduce this tomorrow. Can you describe way to reproduce this
> (sound font - better link to download, instrument, other settings)?

Yeah, I'll throw together some example.  Its not related to your patch
though.  If you wanted to check it out though, I'd be happy to provide
an example case.

Best regards,

reply via email to

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