LADPSA and LV2 Sample Types

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

LADPSA and LV2 Sample Types

Taylor
Hey,

I'm a little bit new to LADSPA and LV2, so this may be a naive question.

I would like to know why single precision floating point types are used in the plugin interface, instead of double precision.

I would also like to know if there are plans to standardize a plugin interface that may process double-precision instead of single-precision data (or both).


_______________________________________________
Linux-audio-dev mailing list
[hidden email]
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Reply | Threaded
Open this post in threaded view
|

Re: LADPSA and LV2 Sample Types

Paul Davis


On Mon, Mar 6, 2017 at 8:59 PM, Taylor <[hidden email]> wrote:
Hey,

I'm a little bit new to LADSPA and LV2, so this may be a naive question.

I would like to know why single precision floating point types are used in the plugin interface, instead of double precision.

I would also like to know if there are plans to standardize a plugin interface that may process double-precision instead of single-precision data (or both).

Nobody needs double precision when moving data between host and plugins (or from one plugin to another).

You might be able to make a case for double precision math inside a plugin (and indeed several people have). But once that particular math is done, single precision is more than adequate.

As to why.... because everybody else who knew anything about this stuff was using 32 bit floating point already.

No existing plugin API supports double precision floating point as a standard sample format (you could do it in AU, but it would involve a converter to/from single precision on either side of the plugin that asks for this.
 

_______________________________________________
Linux-audio-dev mailing list
[hidden email]
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Reply | Threaded
Open this post in threaded view
|

Re: LADPSA and LV2 Sample Types

Fons Adriaensen-3
In reply to this post by Taylor
On Mon, Mar 06, 2017 at 02:59:47PM -0500, Taylor wrote:

> I'm a little bit new to LADSPA and LV2, so this may be a naive question.
>
> I would like to know why single precision floating point types are used
> in the plugin interface, instead of double precision.

Because 32-bit floating point already provides more dynamic range
than is required for audio signals.

Even 24-bit fixed point has a dynamic range of 145 dB. Which means
it can at the same time represent a signal that is so low that you
can't hear it, and one so loud that will damage your ears beyond
repair.

Even the best analog hardware, including AD and DA converters, and
even using high 'professional' signal levels, is no better than 21
or maybe 22 bits. This is not going to change, it's the consequence
of basic physics.

Using double precision doesn't provide any advantage. The only place
where it may be required is internally in some DSP algorithms (e.g.
some filter types). But even this can be avoided in most cases by
good design.

If you read anything on the web claiming that high quality audio
requires 32 bits converters or double precision you can be sure
this is snake oil - someone trying to make money by exploiting
ignorance.

> I would also like to know if there are plans to standardize a plugin
> interface that may process double-precision instead of single-precision
> data (or both).

Don't think so, since there's no point in doing that.

Ciao,

--
FA

A world of exhaustive, reliable metadata would be an utopia.
It's also a pipe-dream, founded on self-delusion, nerd hubris
and hysterically inflated market opportunities. (Cory Doctorow)

_______________________________________________
Linux-audio-dev mailing list
[hidden email]
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Reply | Threaded
Open this post in threaded view
|

Re: LADPSA and LV2 Sample Types

Paul Davis
In reply to this post by Paul Davis
I need to correct a mistake in what I wrote yesterday.

VST3 does support double precision samples, and for whatever inexplicable reason even makes it the default.

Thanks to Robin Gareus for pointing this out.

Also, to follow on from something Fons wrote: an actual 32 bit sample value would have at least the low 4-6 bits representing brownian (atomic) motion. That's pretty crazy.

On Mon, Mar 6, 2017 at 9:30 PM, Paul Davis <[hidden email]> wrote:


On Mon, Mar 6, 2017 at 8:59 PM, Taylor <[hidden email]> wrote:
Hey,

I'm a little bit new to LADSPA and LV2, so this may be a naive question.

I would like to know why single precision floating point types are used in the plugin interface, instead of double precision.

I would also like to know if there are plans to standardize a plugin interface that may process double-precision instead of single-precision data (or both).

Nobody needs double precision when moving data between host and plugins (or from one plugin to another).

You might be able to make a case for double precision math inside a plugin (and indeed several people have). But once that particular math is done, single precision is more than adequate.

As to why.... because everybody else who knew anything about this stuff was using 32 bit floating point already.

No existing plugin API supports double precision floating point as a standard sample format (you could do it in AU, but it would involve a converter to/from single precision on either side of the plugin that asks for this.
 


_______________________________________________
Linux-audio-dev mailing list
[hidden email]
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Reply | Threaded
Open this post in threaded view
|

Re: LADPSA and LV2 Sample Types

Will Godfrey
On Tue, 7 Mar 2017 11:34:34 +0100
Paul Davis <[hidden email]> wrote:

> I need to correct a mistake in what I wrote yesterday.
>
> VST3 does support double precision samples, and for whatever inexplicable
> reason even makes it the default.
>
> Thanks to Robin Gareus for pointing this out.
>
> Also, to follow on from something Fons wrote: an actual 32 bit sample value
> would have at least the low 4-6 bits representing brownian (atomic) motion.
> That's pretty crazy.

Adding to this, even 16 bit has a dynamic range of over 90dB. There is a quite
dramatice demo at that depth of a garage door being slammed after the
demonstrater talks rather quietly - sorry, I can't find it now.

By the time you reach 24bit, you're well below any reasonable accoustic noise
level, and are getting into the region of thermal noise in analogue equipment.

--
Will J Godfrey
http://www.musically.me.uk
Say you have a poem and I have a tune.
Exchange them and we can both have a poem, a tune, and a song.
_______________________________________________
Linux-audio-dev mailing list
[hidden email]
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Reply | Threaded
Open this post in threaded view
|

Re: LADPSA and LV2 Sample Types

Fons Adriaensen-3
In reply to this post by Paul Davis
On Tue, Mar 07, 2017 at 11:34:34AM +0100, Paul Davis wrote:

> Also, to follow on from something Fons wrote: an actual 32 bit sample value
> would have at least the low 4-6 bits representing brownian (atomic) motion.
> That's pretty crazy.

To put this in perspective:

To have a dynamic range corresponding to roughly 27 bits,
an analog signal needs to have full scale power of 1 Watt
(since thermal noise in 20 kHz is around -161 dBW, and
161 / 6 ~= 27).

For 32 bits you'd need more than a kilowatt at the point
of conversion between analog and digital and in every
analog signal point before or after.

Ciao,

--
FA

A world of exhaustive, reliable metadata would be an utopia.
It's also a pipe-dream, founded on self-delusion, nerd hubris
and hysterically inflated market opportunities. (Cory Doctorow)

_______________________________________________
Linux-audio-dev mailing list
[hidden email]
http://lists.linuxaudio.org/listinfo/linux-audio-dev