Reference
MIDI and other outputs
MIDI pitch policies, pitch-bend and MPE configuration, MIDI input, and Mora's optional OSC, serial, MQTT, Csound, and speech adapters.
MIDI is an output path beside SuperDirt. This reference covers how MIDI output delivers fractional pitches, how to configure pitch bend and MPE, how MIDI input relates to output, and which other optional outputs and inputs Mora provides.
Mora supports ordinary MIDI patterns, fractional pitch policies, tuning, and MPE. MIDI output requires an explicitly selected and configured receiver.
notes can retain fractional pitches. In Mora’s named-pitch convention, bare C is C3/MIDI 48 and C4 is MIDI 60. Tuning is independent of temporal meter and independent of the MIDI receiver’s policy; see pitch, harmony, and tuning.
The selected output policy determines how the receiver can deliver fractional pitches:
| Policy | Behavior |
|---|---|
:quantize | Rounds and clamps for ordinary MIDI. |
:strict | Declines unsupported fractional or out-of-range delivery with diagnostics instead of silently changing the pitch. |
:bend | Uses channel pitch bend. Simultaneous notes on one ordinary MIDI channel share that bend. |
| MPE | Allocates member channels for independent note expression, subject to the configured receiver and capacity. |
Plain-channel pitch bend is shared by overlapping notes on that channel; MPE uses member channels for independent note bends. Fractional synthesis pitches are therefore not automatically deliverable as independent polyphonic bends on an ordinary MIDI channel.
(configure-midi 1
:device "Mora"
:channel 0
:pitch-policy :bend
:bend-range 2)The device name here denotes a configured virtual output. The receiver’s bend sensitivity must agree with the declared range.
For an MPE-capable receiver, the explicit configuration is different:
(configure-midi 1
:device "Mora"
:mpe :lower
:mpe-members 8
:pitch-policy :bend
:bend-range 48)
(m1! (notes "[60,64.5,67] [62,65.5,69]"))In this configuration, :mpe and :mpe-members appear alongside :pitch-policy :bend, with a wider declared :bend-range. Sending MPE setup and SysEx to the device is a separate, explicit action.
MIDI input is separate from output. Mora tracks incoming held-key and MPE state and supports framed SysEx input.
In Studio, midi-map and midi-learn connect named inline controls to incoming MIDI. Absolute controls support pickup behavior; relative encoder modes must match the controller’s configured message format.
Registering a mapping is separate from opening the selected input device, which is its own explicit step. Mappings read input; they do not implicitly send controller LED updates, motor updates, or other hardware messages.
Output channels in the MIDI performance API and input-channel numbers in a widget map have different documented conventions. Consult the corresponding signature rather than copying a channel number between them. Inline controls describes the mappings in full.
MIDI has its own cleanup functions. Sound-channel silence, such as assigning (silence) to a channel, is not a blanket hardware panic. See stopping sound.
Mora includes further output and input families, each with its own backend and setup:
| Family | Setup |
|---|---|
| Generic OSC output | Optional adapter; requires explicit configuration. |
| Serial output | Optional adapter; requires explicit configuration and a suitable device. |
| Speech | Optional adapter; requires explicit configuration. |
| MQTT | Optional adapter; inactive until explicitly configured and started. |
| Csound | Optional adapter; inactive until explicitly configured and started. |
| Gamepad, motion, and desktop inputs | Optional inputs. |
These families require explicit configuration and the applicable devices or services. The Studio launcher attempts the configured MIDI connection along with its other optional services; the core language does not depend on any of them.
Source references
Repository-relative paths in the Mora source where these mechanisms are implemented.
-
src/runtime/midi*.lisp -
src/mini/midi*.lisp