uvi-script
Musical event scripting with Lua
Loading...
Searching...
No Matches
ParamKnob Class Reference

A knob bound to an existing Element parameter. More...

Inheritance diagram for ParamKnob:
Widget

Public Member Functions

 ParamKnob (Element elementOrPath, string paramName)
 creates a knob bound to an existing Element parameter.
 
void setRange (number min, number max)
 override the range inherited from the parameter.
 
void setStripImage (string imagePath, int numImages)
 

Public Attributes

number value
 the widget's value (read-only; reflects the bound parameter)
 
Unit::Type unit
 unit override, default is taken from the parameter
 
string stripImage
 path to knob strip image
 
bool showValue
 show/hide value display
 
bool showPopupDisplay
 show/hide the value popup display (if any)
 
string fillColour
 fill colour (named colour or RGB/ARGB hex string)
 
string outlineColour
 outline colour (named colour or RGB/ARGB hex string)
 
- Public Attributes inherited from Widget
string name
 widget name
 
string displayName
 widget display name
 
string tooltip
 widget tooltip, default is name
 
int x
 x position in pixels
 
int y
 y position in pixels
 
int width
 widget width in pixels
 
int height
 widget height in pixels
 
table size
 widget size {width, height}
 
table position
 widget position {x,y}
 
table bounds
 widget bounding rect {x,y,width,height}
 
number alpha
 transparency value between 0.0 and 1.0
 
bool enabled
 boolean flag to enable / disable the widget
 
bool visible
 boolean flag to toggle widget visibility
 
bool interceptsMouseClicks
 boolean flag to toggle mouse handling on widget
 
bool showLabel
 show widgets label if any
 
bool persistent
 flag to tell if the widget values should be serialized when saving.
 
function changed
 callback function used by child widgets to be notified of changes
 

Detailed Description

A knob bound to an existing Element parameter.

It drives a parameter that already lives on an engine Element instead of carrying its own value. The parameter provides the range, default, unit and response curve, so no min/max/default is passed at construction: the unit gives display formatting and text parsing for free, and the knob follows the parameter's own mapper. Moving the knob writes the parameter, and external changes (host automation, modulation, preset load) move the knob.

It is a Widget (not a Knob); it exposes the appearance properties below plus setRange / unit to override the inherited range/unit.

local fx = Program.inserts[1]
local drive = ParamKnob(fx, "DriveAmount")
ParamKnob(Element elementOrPath, string paramName)
creates a knob bound to an existing Element parameter.
A Patch that represents a monotimbral instrument.
Definition Engine.cpp:238
table inserts
all InsertEffect for this node
Definition Engine.cpp:243

Constructor & Destructor Documentation

◆ ParamKnob()

ParamKnob::ParamKnob ( Element elementOrPath,
string paramName )

creates a knob bound to an existing Element parameter.

Parameters
elementOrPathan Element reference, or a path string identifying one
paramNamethe parameter name (as used by setParameter)

Member Function Documentation

◆ setRange()

void ParamKnob::setRange ( number min,
number max )

override the range inherited from the parameter.

Parameters
minminimum value
maxmaximum value

◆ setStripImage()

void ParamKnob::setStripImage ( string imagePath,
int numImages )
Parameters
imagePathpath to knob strip image. Supports Retina @2x variants.
numImagesnumber of images in strip