[LV2] LV2 Question

Warren Koontz profwub at gmail.com
Fri Nov 22 03:47:44 PST 2013


Thanks again. After I sent my last message to you I had a similar idea: set
a bool in activate() and then check and clear it in run(). I cannot do too
much without user input since I use user input to determine the number of
buffers and their sizes among other things. I can always set a limit to the
number of buffers and their sizes and allocate them once and for all in
instantiate(), but I was hoping to avoid this.

I will try to implement reverb as a class. I had been following the amp.c
example from the LV2 site, which seems to be in plain vanilla C. I will
instead look at C++ examples, including your Masha class.

On Thu, Nov 21, 2013 at 5:08 PM, Harry van Haaren <harryhaaren at gmail.com>wrote:

> 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.
> http://lv2plug.in/doc/html/structLV2__Descriptor.html#af65673266e8da03aee22eaed10a7a0f4
> 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 ) {
>   setupReverb();
> }
> Certain properties of your reverb calculations are more expensive than
> others: perhaps concider adding a port-property to that port:
> http://lv2plug.in/ns/ext/port-props/#expensive
> Hosts tell users to not automate that input... hopefully.
> -Harry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lv2plug.in/pipermail/devel-lv2plug.in/attachments/20131122/d9cfb344/attachment-0001.htm>

More information about the Devel mailing list