fluid-dev
[Top][All Lists]
Advanced

[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: Fri, 24 Nov 2006 22:19:10 +0000

On Fri, 2006-11-24 at 04:08 +0200, Mihail Zenkov wrote:
> Good. And imho better if fluid_synth_write_s16 will work with one
> buffer without negotiator. I do it in avidemux in dither16(), it use
> single buffer for in (float) and out (int16_t). This buffer one for all
> audio chain, only pointer transmit between function.
> 
> http://svn.berlios.de/wsvn/avidemux/branches/avidemux_2.3_branch/avidemux/ADM_audiofilter/audioencoder.cpp?op=file&rev=2597&sc=0
> 

I assume you are referring to how FluidSynth stores the audio first in
its internal buffers (in fluid_synth_one_block) and then copies it to
the buffer passed to fluid_synth_write_s16?

I think that's a little more work than I want to undertake at this
point.  FluidSynth processes inputs per its internal buffer size (64
samples by default).  The buffer size passed to fluid_synth_write_s16 is
dependent on the buffer size of the audio driver.  I don't have a really
good view of how all that works yet though.

If you get a good idea of how to process the audio only into the buffer
passed to fluid_synth_write_s16 without changing the public API, go
ahead ;)  I think there are higher priorities though.

> > >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).
> 
> Read more about triangle dithering. If we add just random - we have
> noise modulated by signal. It bad.
> Difference between new and old random value prevent this.
> 

I'll take your word for it ;)

> >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).
> 
> Yes you right, but in case without roundf we have two time bigger
> amplitude and imho bigger THD (i see it when compare spectrum in
> audacity). See attach to more undersend.
>  
> > Anyways, if we can find a solution that works across Windows/Linux and
> > Mac OSX I'd be happy :)
> 
> I add dither with roundf to avidemux-2.3 and Mean (main developer) copy
> this to new branch-2.4 ... Avidemux work on linux/win/mac/freebsd. But
> not shure if he (or someone else) test it on all platforms. If you want
> i can ask him.
> 

I did a search for roundf and "windows" and came up with complaints that
it isn't available in Microsoft compilers.  Perhaps that has changed,
but I doubt it.  It would be nice just to use roundf, but I would like
to keep things portable.
 
> > 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.
> 
> I interested in better sound quality. If i can help - i try.
> 

Ok.  I'll let you know when I get a test case.
        Josh






reply via email to

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