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

From: Christopher Arndt <chris@email-addr-hidden>
Date: Wed May 27 2015 - 22:42:02 EEST

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

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev

Received on Thu May 28 00:15:01 2015

This archive was generated by hypermail 2.1.8 : Thu May 28 2015 - 00:15:01 EEST