MPadView:
Filter:
Modality-toolkit/Classes (extension) | GUI

MPadView
ExtensionExtension

a view for noteOn/noteOff/touch elements

Description

MPadView is used in MKtlGUIs to automatically generate representations of pads and piano keys as commonly used in MIDI devices. You may never need to use MPadView explicitly.

It flexibly supports a variety of behaviors these noteOn, noteOff and touch elements may have, discussed here for clarity, and to possibly add more arcane combinations when encountered.

These types of MIDI elements include:

tag:description:noteOn:noteOff:touch:comment
\noteOnTrigtrigger pad127--
\noteOnVeltrig pad w/ vel.1-127--
\noteOnOffpiano key w/ on vel.1-1270-default
\noteOnOffButbutton on/off1270-
\noteOnOffVelpad/key w/ off vel.1-1271-127-rare
\noteOnOffTouchpad/key w/ polytouch1-12700-127semi-rare
\noteOnOffVelTouchpad/key w/ off vel and touch1-1271-1271-127very rare

Code Examples for demonstration:

Class Methods

.new

Arguments:

parent
bounds

make a new instance of an MPadView

.modes

a dictionary of modes, see top example

.modeKeys

names of the available behavior modes

Instance Methods

.mode

get and set behavior mode of the mpadview. modeName is one of MPadView.modeKeys.

.baseColor

get and set mpadview's background color

.hiliteColor

get and set color for activities on view

.value

.valueAction

get and set current value (and optionally do its action): Clicking on gui sets it to y position within view. Usually used as noteOn velocity.

.upValue

.upValueAction

get and set current upValue (and optionally do its action): releasing mouseClick on gui sets it to y position within view. Usually used for velocity decay; also for noteOff velocity.

.moveValue

.moveValueAction

get and set current moveValue (and optionally do its action): moving the held mouse on gui sets it to y position within view. Usually used for polytouch value.

.useValue

.useUpValue

.useMoveValue

get and set booleans whether to use value, upValue, moveValue. This supports different behavior modes.

.action

.upAction

.moveAction

get and set actions to do when value, upValue, moveValue changes

.doAction

.doUpAction

.doMoveAction

evaluate action, upAction moveAction.

.pressed

get and set boolean whether pad is pressed.

.autoUpTime

get and set time for automatic upAction after activation. default inf means it waits for release of mouseclick, short times (e.g. 0.1) allow trigger pad-like behavior.

.label

get and set view label to show

.vShiftLabel

shift label by vertical offset

.font

get and set font to use for label