On Thu, May 21, 2009 at 8:48 PM, Chris Cannam
<cannam(a)all-day-breakfast.com> wrote:
There is an IEC standard for this mapping in
meters (IEC 60-268-18)
which works OK for faders as well if extended in a sensible way down
to -inf, particularly if you don't want to go above 0dB. It divides
the range up into several sections which are individually linear in
dB. There's code for this mapping in several places, including
base/AudioLevel.cpp in the Rosegarden source code.
Actually I might as well summarise here, not least because I've
noticed the RG code does not in fact implement exactly what's in the
standard.
The standard has the top 25% of the meter covering 0dB down to -9dB;
the next 25% covering -9 to -20; the next 20% covering -20 to -30; the
next 15% covering -30 to -40; the next 7.5% covering -40 to -50; the
next 5% covering -50 to -60; and the last 2.5% covering -60 to -Inf.
Each of those ranges is linear in dB.
The numbered levels are 0, -5, -10, -15, -20, -30, -40, -50, -60.
Ticks are per dB down to -20, then only at numbered positions, with an
additional tick at -45dB (why?)
This is actually quite different from the cubic mapping; it gives you
a lot more space in -10 to -20 relative to 0 to -10. That suggests
that you can get away with quite a few different mappings in practice.
A cubic mapping is also good.
In Rosegarden we actually switched from a cubic mapping to one based
on the IEC meter mapping, many years ago, because "it seemed like a
good idea at the time". I've never really made up my mind whether it
turned out better or worse. Nowadays I'd probably go for cubic, since
it's a one-liner to code.
Thanks a lot for this elaborate information from everyone on this
thread! Very helpful!
I have now changed PulseAudio to use cubic mapping, mostly because I
came to the conclusion that the most interesting attenuation range is
between 0dB and -10dB and hence should be the range with the greatest
resolution, which is not what IEC would give us.
What makes me wonder though is, if I use cubic mapping for < 0dB what
would be a good choice for > 0db? Just continue the cubic mapping?
After having implemented this I can say it doesn't feel that bad in
the range 0..+10dB, but I was wondering if it actually makes sense?
Opinions?
Lennart
--
Lennart Poettering Red Hat, Inc.
lennart [at] poettering [dot] net