Naming conventions in element descriptions:
Filter:
Modality-toolkit/Reference (extension) | Libraries > Modality

Naming conventions in element descriptions
ExtensionExtension

How to name entries in the single element descriptions in MKtl desc files.
NOTE: This document lists conventions to describe MKtlElements in Modality description files. A more general introduction to description files can be found in How_to_create_a_description_file.

A single element description is a dictionary of type Event. It (or the shared properties of its group) should contain these keys:

generic keys

elementType

User-readable name for the physical type of thing. Usually one of the many types in

Example:

ioType

whether and how it is an input and/or output element. Usually one of

Example:

spec

a spec for the internal number range of the device; e.g. for midi controls, \midiCC is [0, 127, \lin, 1, 0].asSpec;

This gives an overview of some predefined specs:

NOTE: You can also add specific specs in the desc for the MKtl itself.

Example:

valueType

Either \absolute or \relative.

\absolute
this is what most elements send, e.g. fader position, so it is the default valueType.
\relative
means the element sends a delta value, i.e. by how much to change whatever it is currently setting. HID mouse devices send deltaX and deltY values, MIDI encoder knobs send how many clicks one has turned, or custom increment/decrement buttons. In this case, the element's value is simply the last delta value, and there is no current absolute value in the element - the object that is being set knows its absolute value. The RelSet class can be used in the element.action to change the current value of the destination object by a delta. See RelSet

Example:

buttonMode

Determines how buttons behave:

\toggle
triggers action on release only for toggle buttons
\momentary
triggers action on push and release, so value is active only while holding down on MKtlGUIs. The mode can be changed by clicking on the button view and typing 't' or 'm'.

Example:

releaseMode and snapbackValue

Many physical elements, e.g. faders and joystick axes have one of several behaviors when they are released. \releaseMode describes which behavior the element has.

\hold
means the value is held where it is (e.g. most faders)
\snapback
means it physically returns to a known value, which is then given via \snapbackValue.

Example:

Protocol-specific keys

MIDI device elements

MIDI device elements require these keys:

HID device elements

HID device elements require these keys:

OSC device elements

OSC device elements require these keys:

\argTemplate is further described in How_to_create_a_description_file_for_OSC.