[LV2] LV2-C++-Tools

David Robillard d at drobilla.net
Sat Mar 24 14:13:04 PDT 2012


On Sat, 2012-03-24 at 20:58 +0000, Aurélien Leblond wrote:
[...]
> Of course you can't do X things in the audio thread!!! Holy crap!
> 
> Ha! How can I be so stupid!
> Ok, I get it now (well I hope anyway).

:)  Just makin' sure.

It's easy to screw up if you're not working within a framework that
avoids it.  I was just trying to stress that there's a more fundamental
problem here than getting the cursor position being a bit too slow.

> Create a fairly simply GUI that queries the mouse position, and get
> the GUI to feed that into two control inputs of the plugin itself.
> The plugin would simply take the value of those 2 control input, and
> feed that into two audio outputs (or VC outputs, for that matter)...
> And obviously, the two would be conpletely separated, the way it
> already is for other plugin: audio processing on one side, GUI on the
> other....

That'll do.  As long as all the communication happens via ports these
problems are impossible.  Some kind of event might be needed for
anything more fancy, but for a couple of numbers KISS with control
ports.

(Historical note, it's only to accommodate porting existing plugins from
certain broken proprietary APIs that the facility to directly access the
plugin exists at all.  I should probably put some loud disclaimers in
the relevant extensions to explain that actually using them is a
terrible idea intended as a last resort)

> If I'm not wrong, that should dissociate GUI/plugin. In fact it
> wouldn't be that different than how a usual plugin works now, but
> instead of being let say a combo box changing the controls value of
> the plugin, it's simply the position of the mouse cursor.

Yep

> (by the way you are completely right, I'm learning audio dev as I go
> in this project! that does explain my confusions sometimes...)

Took me a while to figure out (the hard way) that the usual "la de da
direct access to everything" approach is an awful idea for audio.

I've since become more or less completely convinced that anything but an
event queue to and from your engine is wrong.  Show me a program not
built that way, and I'll show you a program that's probably not
real-time safe :)

-dr





More information about the Devel mailing list