RE: [linux-audio-dev] LADSPA and plugin sample rate

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

Subject: RE: [linux-audio-dev] LADSPA and plugin sample rate
From: Richard W.E. Furse (richard_AT_muse.demon.co.uk)
Date: Mon Dec 11 2000 - 10:22:45 EET


When finding bounds, application of LADSPA_HINT_SAMPLE_RATE is the job of
the host. This cannot be done by the plugin as there may not be a plugin
instantiated. (To instantiate a plugin the host needs a sample rate - I
cannot imagine it is that difficult to hang on to this information!) Yep,
this is fiddly when defining a network of plugins in the abstract, away
from real signals, because there is no known sample rate. But in this case
the plugin is no more able to provide a sample rate than the host.

LADSPA_HINT_SAMPLE_RATE should only apply to the bound-setting stage (Hmm I
wonder if this is explicit). Control values at run-time should use their
obvious values. The example low-pass filter in the LADSPA SDK defines
LADSPA_HINT_SAMPLE_RATE to declare a cutoff range from 0Hz to the Nyquist
frequency (0.5 * sample rate). In actual use, a value of 440 is fed to the
cutoff frequency control port to generate a 440Hz cutoff.

I still have a suspicion I'm still missing the point here. Sorry if I'm
being foolish :o)

--Richard

-----Original Message-----
From: Paul Barton-Davis [SMTP:pbd_AT_Op.Net]
Sent: Monday, December 11, 2000 12:54 AM
To: Richard W.E. Furse
Cc: 'Linux-audio-dev'
Subject: Re: [linux-audio-dev] LADSPA and plugin sample rate

>Maybe I'm being stupid, but frankly I don't understand what this
discussion is
> about. Can someone clarify?

The current spec says:

----------------------------------------------------------------------
/* Hint LADSPA_HINT_BOUNDED_BELOW indicates that the LowerBound field
   of the LADSPA_PortRangeHint should be considered meaningful. The
   value in this field should be considered the (inclusive) lower
   bound of the valid range. If LADSPA_HINT_SAMPLE_RATE is also
   specified then the value of LowerBound should be multiplied by the
   sample rate. */
#define LADSPA_HINT_BOUNDED_BELOW 0x1
----------------------------------------------------------------------

So, whose job is it to do the multiplication ? So far, existing
plugins (i.e. steve's; i haven't looked through the CMT set to see if
any set HINT_SAMPLE_RATE) assume that its the job of the host.

My request is that we make it explicit that its the plugin's job to do
this. So to take a concrete example: Steve's new decimator has a
sample rate parameter, which in the code is hinted to lie between 0
and 1.0. But the plugin never scales that by the SR, it assumes that
the host will do it.

The problem is that the part of the host that takes care of this (the
GUI, for example) may not (and in my case, does not) have any easy way
to know what the sample rate is. The plugin, OTOH, does.

--p


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

This archive was generated by hypermail 2b28 : Mon Dec 11 2000 - 11:04:01 EET