[LV2] LV2 Question

Harry van Haaren harryhaaren at gmail.com
Thu Nov 21 08:18:23 PST 2013

Including devel at lists.lv2plug.in

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

> Harry,
> Thanks for the quick response. Or should I say "dank U wel"?
Dank je wel, I'm dutch indeed. Living in Ireland though

> The Multiverb object is not the plug-in itself, but an object used within
> the plug-in. This object includes delay lines which need to be re-set for
> each activate/run(one or more times)/deactivate cycle. So instantiate
> instantiates the plug-in, activate instantiates and initializes the
> Multiverb object (with fresh delay lines), run does the processing (saving
> delay line states between successive runs), deactivate deletes the
> Multiverb object (setting the state for a subsequent cycle) and cleanup
> deletes the plug-in.

Yes you're on the right track.  Lots of plugins have "internal classes" for
lack of a better way of explaining it.
An example I'm familiar with is Masha, which includes two instances of a
DSP class:

Try to do as little work as possible in activate() / deactivate(). If work
can be pushed to instantiate(), it should be:
In this case, concider having a "reset()" method on the Multiverb class,
and call that on activate(), instead of deleting the Multiverb object in
deallocate(), and creating a new one in activate().

Deleting / allocating a Multiverb object in activate() / deactivate()
should be avoided at all costs: it is *not* a real-time safe operation, and
can be avoided.

I agree that static variables are undesirable (although they served a
> purpose in the pre C++ days). I just thought it might be weird to give the
> host application access to the Multiverb object.
The host doesn't actually have access to the Multiverb object: it knows the
plugin handle*, but nothing particular about it. The host won't interact
with the plugin instance except for the LV2 specified callback functions.

> mvg,
> Warren

Cheers, -Harry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lv2plug.in/pipermail/devel-lv2plug.in/attachments/20131121/27d0da60/attachment-0002.htm>

More information about the Devel mailing list