[LV2] LV2-C++-Tools

Aurélien Leblond blablack at gmail.com
Sat Mar 24 11:50:10 PDT 2012

>> Hello,
>> I have been coding the porting of the AMS internal modules to LV2
>> plugins using the Lv2-C++-Tools.
>> The more I'm progressing, the more I am wondering if there are any
>> limitations involved in using this library, especially these days
>> where a lot of new features are being added to the Lv2 Extensions.
> Maybe this isn't really a technical argument, but I really don't like
> these libraries as they are because the pkg-config names are really
> generic and impossible to find, and make them seem like some kind of
> official "LV2 plugin library" or something.
> They really need a proper, somewhat unique, name.
>> For example, I am coding a plugin that output the position of the
>> mouse cursor as two control ports (handy to develop a kind of theremin
>> synth).
>> Getting the cursor position from the X Library is an expensive
>> operation, and the new Worker Extension seems perfect for the job, but
>> I can't figure out if somehow it is compatible or not with the
>> Lv2-C++-Tools.
> Whoah now!  The worker extension is a plugin-side thing, not UI, and
> there is an EXTREMELY small chance that you actually want to be doing
> multi-threaded things in your UI code.  Trust me.

Although it involves the mouse, what I'm trying to achieve is not
exactly UI related.
The plugin I have has two output called X and Y.

When the mouse is at the bottom left corner of the screen, X and Y are
equal to 0.
When it's at the top right corner, X and Y are equal to 1.

The design I had in mind was to have a thread on the side that would
query the mouse position every 25ms, especially to avoid having it in
the method processing the sound itself (this create a lot of XRuns
when I do that).

(when it's used with a touchpad, it can be used a lot like the Korg
Kaossilator, by controlling the cutoff point of a filter for example)

@Fons: I phrased it wrong the first time :) by expensive, I meant that
my poor design was creating a lot of xruns :)

>> The most obvious pros of using Lv2-C++-Tools is its simplicity.
>> Porting an AMS module takes only 20 to 30 minutes with it, while doing
>> it without the help of the library takes much more time and is way
>> more tedious.
>> (I am much more confortable coding in C++ than C, but the question
>> deserves to be asked, am I doing something wrong here that I find it
>> way more difficult to code without the help of Lv2-C++-Tools?)
> Personally I think a good C++ wrapper header(s) would be a good thing to
> have, but I don't really get the point of the rest of it.
> Also not sure the kinda crazy template hackery is worth it...

The lv2peg tool makes the development a lot faster.
>From my own experience, there is duplication of work by setting up the
input/output/controls in the ttl files, then having to set them up
again in the code of the plugin itself.
lv2peg creates the headers automatically.

But that's my 2 cents!

(I became a software developer because I'm extremely lazy, and I like
computers to do the monkey work for me!)

> Cheers,
> -dr


More information about the Devel mailing list