How to create a description file:
Filter:
Modality-toolkit/Tutorials (extension) | Libraries > Modality

How to create a description file
ExtensionExtension

How to create a description file for a device to use with the Modality toolkit.

Introduction

The functionality of MKtl relies on descriptions of the devices to be used. For many controllers, there are already descriptions available, but your preferred device may not be among them.

This tutorial shows how to describe elements, which is largely the same for all description files (regardless of protocol). For the specifics of the three supported protocols, there are these three specific tutorials:

When your controller is rather typical example of its class, say a gamepad or faderbox, you can also find a similar device and adapt its description: How_to_adapt_a_description_file

NOTE: Making descriptions by hand is a good method for sketching the functionality and layout of new controllers before physically making them.

Basic structure of the description file

The description file is a Dictionary with a number of required entries.

The main entry is the elementsDesc which contains all the elements/controls of a device.

For physical devices, you need to define the protocol and the idInfo. The protocol is one of [\osc, \midi, \hid]. The \idInfo is different per protocol, please see the respective tutorial for an elaborate description.

If you want to create a virtual device, the minimum info required is the idInfo and protocol: (idInfo: \something, protocol: \virtual) and in the description, every element needs an ioType and a spec.

For example:

Simple Element Groups

Descs for devices with multiple elements can be written in multiple ways:

See also: MKtl_description_files for a discussion of all possible keys.

Specs

If a control of your device needs a custom Spec, then you can define this in the element spec of the device description.

For example:

Many common specs in SC are in Spec.specs, and some specs that many MKtls share can be found in MKtl.globalSpecs:

Elements in depth

Elements require an elementType describing which kind of physical thing it is, such as button, slider, joyAxis, mouseWheel, or any of:

MKtlElement.types

Multiple elements can go into nested groups, which is helpful for semantic clarity. For example, an MKtl with 6 sliders and 4 buttons, and two labeled buttons (play and stop) would look like this:

For full details on single element descriptions see also: Naming_conventions_in_element_descriptions

Finding descriptions for similar devices

Many devices already have description files, which are used by the MKtlDesc class. They can be found here:

While developing new descs in files, you can also keep them in

You are cordially invited to contribute desc files for any devices you have and find useful! For details on making descs for devices using MIDI, HID, or OSC, please read on here: