fluid-dev
[Top][All Lists]
Advanced

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

Re: [fluid-dev] Purpose of dither?


From: Z F
Subject: Re: [fluid-dev] Purpose of dither?
Date: Wed, 9 May 2007 15:24:12 -0700 (PDT)

--- Mihail Zenkov <address@hidden> wrote:

>  
> 1. Dynamic gain just fake. I can change velocity curve in midi and
> get
> something similarities gamma-correction. This sounds like cheap
> hardware synth. I need _full_ emulation real piano (and want better
> then real, with greater dynamic range :). Just play and compare
> classic
> music and pop. First have dynamic range 70-80 dB, second - 20-30 dB.
> For expression real emotions we need huge dynamic range!

Well, as far as I understand, velocity curve is translation of the
velocity (or strength of the key press) to the amplitude of generated
note. What I am talking about is the amplitude of the total signal of
all notes which are ON.

The dynamic range should always be set to 16 bits (which you translted
to ?? dB). The question is how this dynamic range is used. Ideally, the
output of fluidsynth should be linear thus the output should be a
simple
sum of all amplitudes of the notes. Unfortunately, this may not be
possible because of 16 bit output constraint. (Ideally, all
comminucation between modules should be done in floats untill the data
goes directly to the audio hardware). So, to compress high dynamic
range
into a small one, the gamma-correction is needed.

It will give a relatively high portion of DAC dynamic range to low
volume sounds and small portion of DAC dynamic range to high-volume
sounds. This is possible because humans differentiate change in volume
of low-volume soounds very well and do not do so well on high volume
sounds. This very doable. The price to pay is that there will be
non-linear distrotions of high-volume sounds, but it will not be
clipping which is horrible. Once again, we will substitude one
distortion for another which is less noticable to humans. There is no
way around it, a distortion must happen due to limited dynamic range.
(as with dithering).

This gamma-curve is fixed which is different from automatic
gain-control.
The goal of automatic gain-control is to have the same level of output
given a range of levels on input. The goal of gamma-curve is to reduce
the gain if the input is high compared to the gain when the input is
low. See the difference? The shape of the curve can, of course, be
changed manually or with some other method, but this is not the point.

To envoke the "herd" argument, this is done in all good analog audio
amplifiers and I hope in many others too. Your TVset has it. This is
the difference between the linear(line) output and the speaker output.
Speaker output goes through the non-linear amplification, linear output
- does not.

Absence of such facility in fluidsynth combined with intermediate 16
bit samples cased the problem you described which was fixed with
dithering. In my opinion, the dithering solution is suboptimal because
it introduces noise. It should not be necessary to reduce the gain to
0.1 for sound not to clip.

> 
> 2. I need total control on volume each note. Otherwise, i can't
> expression what i want.

110% agree with you.

> > Well, unfotutanely, as far as I know, it is a common misconception
> in
> > engineering. Truncation with or without dithering produces new
> > harmoncis
> > just in a different way. I call them distortions. 
> 
> I don't see harmonics after dithering ... Only noise.
> Look at this:
>
http://www.users.qwest.net/~volt42/cadenzarecording/DitherExplained.pdf
> 
> In any case with dithering i don't hear any distortion, without - it
> _very_ annoying me.
> 

Well, it depends on what you call harmonics or noise. To me harmonic
is magnitude at any frequency (in this content) basically the spectrum.

As such, no matter what you do, with or without dithering, you damage
the spectrum. The difference is that with dithering, our brain is less
sensitive to it that is why you do not hear the spectral distrotion.

ZF

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




reply via email to

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