A named element within an MKtl, which typically represents a slider, a button, a joystick axis etc etc. It has a description with a deviceSpec (e.g. \midiNum for a midi faderbox slider), and a type (e.g. \slider). It also has a deviceValue (in the deviceSpec range), and a value (in range 0.0 - 1.0). It is mostly created automatically when an MKtl is made.
See also Creating Custom Elements and Groups.
The types of elements used in descs so far:
Creates a new instance, with a name, a description and optionally a source.
The source arg is usually an MKtl.
The spec that maps between the numerical value range the device sends and/or receives, and the the unipolar range in the MKtlElement.
The element's default value
Get and set the element's deviceValue in units and range of the deviceSpec
Get and set the element's current value in normalised range
newval |
a Float between 0.0 and 1.0 |
Set the element's deviceValue or value without sending back to the hardware device
Set the element's deviceValue or value and perform its action.
deviceValue_ and value_ will not cause the action to be performed. deviceValueNoSend_ and valueNoSend_ will also not trigger the action.
If the element is has an output to send back to the device, value_ and deviceValue_ will send the deviceValue to the device, while deviceValueNoSend_ and valueNoSend_ allow just setting the value without sending it (which is sometimes necessary).
Example: Control a knob on the Behringer BCF2000
Add an action to the element's action. Adding multiple actions will create a FunctionList.
Remove an action from the list of current actions. The action to be removed has to be the exact same function object.
Perform the actions related to this element. This includes the action instance variable, and the actions of its parents, up to the containing MKtl.
(sendValue) |
Whether or not to send the value out to the device if this is an output element. |
ask whether this element's action is currently enabled
enable and disable this element's action. works hierarchically in MKtlElementGroup as well:
Set action to nil.
pattern support - convert MKtlElement to a stream
pattern support - embed MKtlElement in a stream.
An Event or dictionary with a description of the element. Typically contains a deviceSpec, a type, and
Create a gui for this element.
Sending data back to MIDI device, one should use MAbstractElement: value_ :
Classic knobs rotating demo for BCF: