Guide

From pattern to audio

How channel patterns become timestamped OSC for SuperDirt, and how tempo, sound names, orbits, and mixer levels fit together.

Mora separates the temporal score from the system that renders its events. This page follows a pattern from a session channel to a SuperDirt server and explains the tempo, naming, routing, and mixing distinctions that decide whether you hear it.

How a channel reaches SuperDirt

Mora’s normal audio backend sends timestamped OSC to SuperDirt, which runs in SuperCollider. d1! through d8! install patterns in Mora’s session channels. The SuperDirt backend lowers the resulting events and sends OSC bundles with future playback timetags.

Common Lisp
(bpm 140)

(d1! (>> (s "bd ~ sn [hh hh]")
         (gain .8)))

The score’s cycle time and the audio server’s scheduling are distinct from the editor’s redraw rate. Live changes affect future queries; previously dispatched output cannot be rewritten after the fact by editing an object.

MIDI is another output path, described in MIDI and other outputs. Sample discovery, stem selection, continuous DSP controls, measured audio feedback, and optional learned models build on these distinctions rather than replacing the pattern language. The core pattern language does not require model downloads, a cloud account, a microphone, or Studio.

Configure the receiver

Mora’s default backend targets loopback UDP port 57120. Its standard eight channels need a suitable SuperDirt orbit configuration, and your physical output routing depends on your own setup. Configure the server device, orbit outputs, and monitoring accordingly.

A few habits keep the receiver predictable:

  • Use one language interpreter and one audio server.
  • Keep imported-audio and sample-loading memory budgets explicit rather than loading an entire collection without a budget.
  • Stock pattern and sample playback and the optional managed features have different requirements. Managed features need the separately installed SuperDirtMora companion.

Installation and setup covers the rest of the environment.

Tempo, cycles, and beats

bpm exposes the musician-facing tempo convention, and tempo also sets musical BPM. For cycle-based work, set-cps sets global cycles per second. A cycle is a unit in the pattern algebra, not an unconditional synonym for one beat; the session’s cycle duration gives the conversion. With four beats per cycle, these two forms express the same rate:

Common Lisp
(bpm 140)
(set-cps 7/12)

The event parameter cps is not the global command set-cps. Channels, tempo, and transport covers the transport in more detail.

An explicit Link integration can share transport with other applications. Joining a peer session is a separate action from querying Link status. The Studio launcher attempts the configured Link connection along with its other optional services; the core language does not depend on them.

Sound names live on the server

Source names such as bd refer to sounds registered in SuperDirt. The basic sample examples in this documentation use the familiar SuperDirt banks bd, sn, hh, and cp; for a first test, confirm that the bd, sn, and hh banks are loaded. Pitched examples need an available instrument named psin.

Without an audio backend, evaluating a pattern still constructs a queryable object, but it does not produce sound by itself.

If a pattern is silent, When something is silent or blank walks through the layers in order.

Session channels and output orbits

A Mora channel owns a source pattern. A SuperDirt orbit is an audio routing and mixing destination: an output and effect bus. Both have defaults, but they are not the same abstraction.

A single stack can keep drum, bass, and melody sources together in the score while assigning each a distinct downstream orbit:

Common Lisp
(d1! (stack
       (>> (s "bd ~ sn ~")
           (orbit 0))
       (>> (notes "f2 ~ ab2 c3")
           (s "psin")
           (orbit 1))
       (>> (notes "f4 ab4 c5 eb5")
           (s "psin")
           (orbit 2))))

Orbit indices are zero-based here. Those orbits still need suitable routing in SuperDirt and, where you use one, in your DAW: naming an orbit in code does not create a hardware output or a DAW track, and orbit does not reconfigure the audio device. A channel form that routes several sources to separate orbits does not thereby acquire an automatic master mixer spanning every override. Pipelines and composition covers stack and layering in general.

Mixer levels and crossfades

The mixer provides continuous channel levels with level and transitions with xfade. A mixer crossfade affects the running streams and their tails. The event-level pattern-crossfade shapes newly triggered events; it does not continuously turn down a sample or effect tail that is already sounding. They are different tools even when both use an equal-power default.

level and xfade address each channel’s configured target orbit. They do not automatically discover and fade every overridden orbit inside an arbitrarily routed stack, so understand that mapping before using them to transition a multi-orbit arrangement. A multi-orbit composition needs matching routing and mix ownership rather than treating a d-channel as a universal audio submix. The receiver must also support the continuous mixer this workflow uses.

Arrangement and transitions shows level, xfade, and pattern-crossfade in context. For owned audio submixes inside prepared audio, see SuperDirtMora submixes.

Stopping sound

To stop one channel, assign an actual silent pattern, such as (d1! (silence)); (d1!) is not a stop command. hush silences the session. Inspect the transport and backend controls before reaching for stronger panic or recovery operations.

Sound-channel silence is not a blanket hardware panic. MIDI has its own cleanup functions; see MIDI and other outputs.

Source references

Repository-relative paths in the Mora source where these mechanisms are implemented.

  • src/backends/superdirt/
  • src/runtime/backend.lisp
  • src/runtime/transport.lisp
  • src/runtime/channel.lisp
  • src/mini/mixer.lisp

Documentation

Search the documentation

Results update as you type. Use the up and down arrow keys to choose a result and Enter to open it.