Reference
Authored meter and pacing
Authored positions versus emitted attacks, meter declarations, pace, exact metric clocks, and step-level phrase operations.
The positions a phrase is written in are not the same as the attacks it emits. Mora makes that distinction inspectable and provides operations that retime phrases by their authored units instead of by changing the global tempo.
Sound-bearing examples on this page use the SuperDirt banks bd, sn, hh, and cp, and need an attached output backend and a working receiver.
Rests count as positions, and parallel voices may not have a single scalar count. Mora exposes this distinction with metrical-description, metric-count, and status information:
(metric-count (metrical-description (s "bd ~ sn")))This is an inspection expression, not sound. It reports three authored positions, including the rest.
meter declares structure without changing playback. pace retimes a phrase according to its authored units. Pacing is separate from changing the global BPM described in channels, tempo, and transport.
(defparameter *phrases*
(slow-cat (s "bd ~ sn")
(s "bd hh ~ sn hh")))
(d1! (pace 4 *phrases*
:period 2))The three-unit and five-unit phrases occupy 3/4 and 5/4 cycles at four units per cycle. Their unit spacing stays consistent, instead of each phrase being squeezed into an equal duration.
Exact clocks support constant and explicitly periodic schedules. A period must be declared when the implementation cannot establish the required schedule.
make-periodic-metric-clock, metric-clock-units, metric-clock-source-time, and pace-anchor expose the clock and its phase relationship.
The step family includes step-cat, step-alt, step-expand, step-contract, step-extend, step-replicate, step-take, step-drop, step-grow, step-shrink, step-zip, and step-tour.
These operations work on authored units, which is different from making the transport faster. Consult each operation’s docstring for its timing and count contract; the similarly named operations are not all aliases.
(d1! (step-cat (s "bd ~ sn")
(s "bd hh ~ sn hh")))
(d1! (>> (s "bd hh sn cp")
(step-take 3)))Cropping defaults to a playable, retriggered boundary. An explicit preserve mode retains a crossing event’s old attack:
(d1! (>> (s "bd hh sn cp")
(step-take 3
:boundaries :preserve)))The difference between an event’s visible span and its whole span, and why operators decide explicitly whether to keep an attack, is explained in patterns and time.
Source references
Repository-relative paths in the Mora source where these mechanisms are implemented.
-
src/core/metrical.lisp -
src/mini/metrical.lisp -
src/mini/metric-clock.lisp -
src/mini/step-*.lisp -
src/core/combinators.lisp