Re: [linux-audio-dev] finding the selection length with LADSPA

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

Subject: Re: [linux-audio-dev] finding the selection length with LADSPA
From: douglas irving repetto (douglas_AT_music.columbia.edu)
Date: Thu Oct 19 2000 - 00:23:58 EEST


Paul Barton-Davis wrote:
>
> >i've been playing around with ladspa, and it looks great! but i tried to
> >implement a simple fadein/out plugin, and quickly realized that i don't
> >know how to get the _total_ number of samples that will be processed
> >(i.e. the total user selection). i'm passed the number of samples to
> >process for each block, but for something like a fade or envelope, i
> >need to know the total number of sample in all blocks. where do i get
> >this info? sorry if it's in the docs, but i can't find it anywhere.
>
> i'm guessing that you're trying to apply a gain curve to an
> unknown number of samples, the way an editor would do if you selected
> a region, and then applied an envelope to it.

exactly.

> for an editing operation, i think that a plugin could assume that it
> was being given *all* the samples at once. but for real-time playback
> use, this will never be true (and in fact, it may not even be
> known). right now, the plugin has no way to to know which of these two
> situations is the case.

i found that i was given about 1/2 of the samples each time my run() (i
think that's the callback name, right? don't have it here) was called.
this was using sweep as the host.

> richard (furse) may have some ideas, but i don't think there is
> anything you can do with LADSPA as it stands. if your plugin is trying
> to, say, "fade to zero exponentially over the duration of the
> samples", you're stuck. LADSPA's model is more like "fade to zero over
> <my-parameter> number of samples". i would agree with anyone who felt
> this wasn't adequate.

yes, it seems like it's a problem if it's impossible to implement a fade
in/out filter that operates on a user selection. requiring a user to
type in a number of samples to fade over is kind of old skool, and is
redundant if the user has already selected a region. i can think of many
cases where it's necessary to know the total number of samples selected
before beginning the processing.

> we're heading for the territory of "host callbacks" like those in VST,
> where the plugin could find out the circumstances under which it was
> operating.

perhaps during initialization the plugin could be told whether it's
running in realtime or not, and if not it could be given some additional
info like the selection length (total number of samples to . i think
that that sort of info is generally useful enough to be added to the
API.

i don't want to knock the LADSPA though, it really looks good and i'm
excited to start working with it!

douglas

-- 
                        douglas irving repetto 
                  http://music.columbia.edu/~douglas 
                the music-dsp mailing list and website:
                  http://shoko.calarts.edu/musicdsp


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

This archive was generated by hypermail 2b28 : Thu Oct 19 2000 - 00:53:23 EEST