[Devel] OutputPort being ControlPort
blablack at gmail.com
Sun Aug 21 03:19:55 PDT 2011
>On Mon, 2011-08-01 at 19:49 -0500, Gabriel Beddingfield wrote:
>> 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.
I ported 3 of them already...Well the code is "dirty" and with the
explanations below they'll probably need a lot of changes.
But VCO2, LFO and Noise2 produce some sound that so far sounds similar
to what AMS does.
I would like to share the code with you guys so you can have a look
and advise me if necessary.
Any easy way to do that?
>> > 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).
Yep, exactly... I figured that out afterwards after checking more examples.
>> 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?
Yep, spot on again.
>> 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.
>Yes, we really need CV. One possible option would be to make the port
>*both* AudioPort and ControlPort, though this might break existing
>Personally (with an admitted modular bias) I consider this a major flaw
>of LADSPA, and since the scope of these ports is clearly within that of
>LADSPA and core LV2, but kludges are necessary which ruin user
>experience, I think a proper solution to this problem such as an
>lv2:CVPort is within the scope of the core specification.
All right, so for the time being I could keep using AudioPort. That
means that only these ports of AMS to LV2 would only be compatible
with each other?
Once a solution would be found to that problem I would "just" have to
change from AudioPort to CVPort?
Would that be the way to go? (I just want to take advantage of my
current motivation to write these plugins to actually....do it!)
Thanks in advance for your help!
More information about the Devel