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: Steve Harris (S.W.Harris_AT_ecs.soton.ac.uk)
Date: Mon Feb 04 2002 - 13:00:32 EET


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


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

This archive was generated by hypermail 2b28 : Mon Feb 04 2002 - 12:57:19 EET