[Devel] OutputPort being ControlPort

Gabriel Beddingfield gabrbedd at gmail.com
Mon Aug 1 17:49:31 PDT 2011

On 07/31/2011 07:05 AM, Aurélien Leblond wrote:
> Hi,
> I'm working on porting the AMS internal modules into LV2 plugins to be
> used in Ingen.


> The few examples of LV2 plugin around uses AudioPort as OutputPort..
> Building my plugins like that works fine, but I'm not sure it makes
> sense for a simple plugin like a LFO.
> I have tried to make the OutputPort a ControlPort, but then get a Seg Fault.

 From the docs:

lv2:AudioPort is a pointer to an array of floats.
lv2:ControlPort is a pointer to a single float.

I'm guessing that your code segfaults because it treats lv2:ControlPort 
as an array (buffer).

lv2:OutputPort and lv2:InputPort are /modifiers/ to a port.  They don't 
specify the type... just who is expected to write to the port.

> My questions are:
> - Am I on the good track trying use ControlPort for OutputPort?
> - If so, is there any known examples I can have a look at?

AMS has a port type that acts like the old-style "control voltage" used 
in analog synths.  Is this what you're trying to find?

This is similar to an lv2:AudioPort (an array of values that correspond 
to time).  However, for an lv2:AudioPort the data is expected to be PCM 
data.  Also, often a control voltage port is done at 1/16th the sample rate.

What you need is a /new/ type of port... which I would call a "Control 
Voltage" port... which is also an array of floats.  AFAIK, no-one has 
yet established such a port.


More information about the Devel mailing list