Mixin: LiveDisplayValueMixin

xebra.js v1.2.5 - Documentation

LiveDisplayValueMixin

Adds a virtual, readonly "displayvalue" parameter to the object in order to simplify reading the different display and unit styles of certain live objects.

For example, if the value of the "distance" parameter is 0.5, then depending on the configuration of the object, the "displayvalue" parameter could be "400 Hz" or "C3#".

This mixin is currently added to ObjectNodes representing live.dial, live.numbox and live.slider objects.

See:

Example

// dialNode is the ObjectNode for the live.dial
dialNode.setParamValue("_parameter_range", [10, 20]);
dialNode.setParamValue("_parameter_exponent", 1);
dialNode.setParamValue("distance", 0.5);
dialNode.setParamValue("_parameter_unitstyle", "Pan");
dialNode.getParamValue("displayvalue"); // returns "15R"

dialNode.setParamValue("_parameter_unitstyle", "Semitones");
dialNode.getParamValue("displayvalue"); // returns "+ 15 st"