[LV2] LV2 Question

Harry van Haaren harryhaaren at gmail.com
Thu Nov 21 14:08:40 PST 2013

Please include list in replies (reply-all), it's useful for people with
similar questions in future.

On Thu, Nov 21, 2013 at 7:46 PM, Warren Koontz <profwub at gmail.com> wrote:

> It now seems to me that the "control signals" are only available in run().
> I had assumed that they were also available in activate() and deactivate().

Activate() docs, state explicity that connect_port() may be called before
or after activate(). That means, no port information available.

In activate you can zero your buffers and do other housekeeping that
doesn't require user input.
Perhaps even set-up your 'verb based on the last set of user-input: By
keeping a cache of user-input in your plugin's state. (this is only useful
it its already run() before, not for the 1st time setup).

My algorithm is basically as follows:
> Initialize left and right reverb with user parameters
> Do
>     Process block of audio data
> Until there are no more blocks
> If I have to do all of this in run(), then I need a way to know that I am
> processing the first block. Help!

Keep a bool "haveUserInput" in your state, set it to false in initialize().
In run()
if ( haveUserInput == false ) {

Certain properties of your reverb calculations are more expensive than
others: perhaps concider adding a port-property to that port:
Hosts tell users to not automate that input... hopefully.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lv2plug.in/pipermail/devel-lv2plug.in/attachments/20131121/322da09c/attachment-0002.htm>

More information about the Devel mailing list