Concept

What remains after evaluation

Mora keeps selected evaluated constructs as inspectable objects, so performers and tools can examine them and change how they answer later queries.

Evaluating a Mora form does not leave behind only an opaque result. Selected parts of a composition remain as objects that can be inspected, and whose behavior can be extended, while they are being performed. This page explains what is kept, what that makes possible, and how far it reaches.

The representation left behind

Mora is a Common Lisp livecoding system in which composable temporal patterns remain inspectable, extensible objects while they are being performed. What Mora emphasizes is the representation left behind: selected evaluated constructs remain as inspectable objects, interpreted through an open protocol. The notation can be terse while the implementation remains available.

Consider a composition made from a sample sequence, a speed change, and a parameter annotation. The source is a convenient way to construct it, but the result is not limited to source text. Named pattern instances, their children, metadata, and applicable methods remain available for inspection and interpretation.

Mora retains a designated set of semantically operative evaluated constructs as CLOS objects. Its scheduler and tools obtain behavior from those objects through open protocols.

Temporal query semantics are not unique to Mora. Its design emphasis is a particular combination: retained decomposition, runtime method extension, Lisp embedding, and clients such as Studio. The result is an open, inspectable implementation of an audiovisual pattern language.

Introspection and intercession

Retained objects support two different activities:

  • Introspection: inspect the retained objects, their structure, parameters, and event answers.
  • Intercession: add or redefine applicable protocol methods, changing behavior obtained through those objects on subsequent queries.

Introspection exposes the retained structure. Intercession changes future interpretation through applicable methods.

Inspecting a temporal object

The following forms inspect a pattern without making any sound:

Common Lisp
(defparameter *pattern* (>> (s "bd ~ sn hh") (fast 2)))

(class-of *pattern*)
(pattern-summary *pattern*)
(pattern-children *pattern*)
(pattern-metadata *pattern*)
(events-in *pattern* (span 13/4 7/2))

class-of is the standard Common Lisp function for an object’s class. pattern-summary, pattern-children, and pattern-metadata belong to Mora’s structural observation protocol, which supports inspection and tools. events-in answers the event query for a span whose bounds, 13/4 and 7/2, are exact ratios. None of these forms sends audio; see Queries are not playback.

In Mora Studio, the editor and the running language share the same Lisp image, so a pattern, transform, visual operator, or application object can be inspected and redefined while the session continues.

Changing behavior through methods

Extending the system can mean defining another pattern class or specializing a protocol method, rather than adding another case to a central list of recognized types. An already-installed object can therefore answer future queries differently after its class’s method changes.

Extending Mora shows this with a pattern class defined by defpattern whose events-in method is redefined after an instance has been assigned to a channel. The protocol operations involved are described in Common Lisp and CLOS.

What live changes affect

Live changes affect future queries. They do not rewrite audio already dispatched or frames already rendered.

Library selection follows the same rule. Retained part and stem readers follow published pool changes on later onsets, but sound already dispatched is not canceled solely because the library selection changed. See Stems and sample libraries.

What is and is not retained

Mora retains a designated set of semantically operative constructs. Some construction and transform helpers are transient, so not every intermediate construction object is retained.

The construction syntax and the retained representation are therefore separate topics. A macro that makes a form concise does not by itself guarantee that every source construct survives as a distinct runtime object.

A custom extension does not automatically gain every editor affordance, and a new interpretation may apply only to a particular class family.

Source references

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

  • src/core/pattern.lisp
  • src/core/combinators.lisp
  • src/mini/defpattern.lisp
  • src/mini/deftransform.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.