Re: [linux-audio-dev] Reference amplitudes and LADSPA (again)

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] Reference amplitudes and LADSPA (again)
From: John Meacham (john_AT_repetae.net)
Date: Wed Feb 06 2002 - 03:48:50 EET


yeah, for what it is worth, I have always implicitly assumed that 0db =
1.0f when writing hosts and plugins. the fact that this might not be so
is worriesome, i am strongly in favor of adding it to the spec. (along
with the default value extension, whatever happened to that?)
        John

On Mon, Feb 04, 2002 at 11:00:32AM +0000, Steve Harris wrote:
> On Sat, Feb 02, 2002 at 11:57:05 -0000, Richard W.E. Furse wrote:
> > Perhaps we should include a flag on LADSPA plugins indicating that the
> > plugin is non-linear and therefore cares about input level, plus a
> > recommendation that such plugins expect peak amplitude around 1. This gives
> > the host the option to renormalise its signal to 1 on input and output from
> > whatever representation it uses and a way to know when this should be done.
> > I'm inclined to modify applyplugin with this in mind. Folk who've written
> > linear plugins will not notice the difference, folk who've written nonlinear
> > ones may be in a bit of trouble. Also, has anyone written plugins that map
> > the floats directly to shorts before processing? Is there much out there
> > that couldn't be changed easily?
>
> I would hope that noone has code that casts to short, that would be
> really optimistic. Almost all hosts use 1.0 as the 0dB level allready.
>
> I don't see the point in making it a flag. You don't gain anything by
> having some (not many) plugins that will run at arbitrary gain levels, it
> just increases the complexity. All you have to do is:
>
> input = (float)read_from_soundcard() / 32767.0f;
> input = run_plugin(input);
> ...
> write_to_soundcard((short)(input * 32767.0f));
>
> > I don't think this should be much more than a recommendation - some plugins
> > inevitably mess around with peak levels and forcing plugins to keep to these
> > levels (a) breaks relative scaling when processing two channels of stereo in
> > parallel and (b) is very artificial and (c) inefficient - a chain of linear
> > plugins may mess around with signal amplitude quite badly and it'll be much
> > more efficient to renormalise at one point in the chain rather than on each
> > plugin.
>
> The 0dB level is only a recomendation by definition. You don't need to
> renormalise!
>
> You're thinking of this in the wrong terms. Think of a set of external,
> analogue processors. You set the reference 0dB level (1.22volts or
> whatever) and all processors are built to use that range. Nothing very bad
> will happen if you exceed that by a decibel or ten. If you have a plugin
> that produces large output spikes you can either live with that or put a
> limiter on the output.
>
> The same holds true for nonlinear float processing, the problem comes when
> you exceed 0dB by 32000 times.
>
> The point I was trying to make is that a plugin should be able to predict
> roughly what level an incoming signal will be. If that signal is 6dB over
> what you're expecting its not a big problem.
>
> - Steve
>

-- 
---------------------------------------------------------------------------
John Meacham - California Institute of Technology, Alum. - john_AT_repetae.net
---------------------------------------------------------------------------


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Wed Feb 06 2002 - 03:42:43 EET