[LAD] LV2 control port (parameter) value scaling and mapping?

Christopher Arndt chris at chrisarndt.de
Wed May 27 19:42:02 UTC 2015


Is there a way to have the value range of a control input port of a LV2
plugin be in one range (e.g. 0.0f..1.0f or 0-127) and have the LV2 host
display the values scaled or mapped to a different range (e.g. 20-20,000
Hz or 2 - 2000 ms)?

I know about lv2:scalePoints and the lv2:enumeration property to handle
list of discrete values and the units:unit properties to set the value
unit, but how do I map the actual values of a large continuous range? Is
there a way to define a transfer function? Or does that need to happen
inside the plug-in code?

And what about more advanced parameter display, e.g. a wet/dry setting,
which I want to display as going from 100:00 through 50:50 to 0:100, but
the actual parameter value is just 0.0..1.0 (or -1.0..+1.0)?


Background: I'm trying to improve the JX10.ttl from the mda.lv2
collection [1], so that the parameter display in the LV2 host generated
plug-in UI is more useful and intuitive, i.e. instead of e.g. the slider
for OSC Tuning being going from 0.0 .. 1.0, I want it to be displayed as
-24 .. +24 cents. All control input ports of the plugin are defined as
taking a value 0.0f..1.0f.

[1] http://svn.drobilla.net/lad/trunk/plugins/mda.lv2/


Chris

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 979 bytes
Desc: OpenPGP digital signature
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20150527/60c93fb6/attachment.pgp>


More information about the Linux-audio-dev mailing list