Learn

From a first pattern to the ideas behind it.

Mora has a small conceptual entry point and a larger optional environment. Start with patterns, then add the audio receiver, Studio, samples, and analysis that your work needs. There is no need to install every optional model or adapter to evaluate a first expression.

Try first Want to hear the language before installing anything? The Play page translates pattern forms into Strudel and plays them in your browser.

Know which pieces you need

Each goal below adds its own prerequisites. The first row is enough to start; add the rest as your work needs them.

Required pieces for each goal
GoalRequired pieces
Construct and query patterns SBCL, Qlot dependencies, mora / mora/mini.
Hear ordinary sample patterns Above, plus a configured SuperCollider/SuperDirt server and the sample banks used.
Use Mora Studio Native GLFW, libffi, font libraries, and a driver supporting OpenGL 4.1 core / GLSL 410.
Use managed audio features A compatible, active SuperDirtMora package; some features have additional native plug-in requirements.
Use stem selection An imported sample collection with metadata, and the corresponding sound banks loaded in SuperDirt.
Use measured visual reactivity cl-mltk and an audio input to analyze.
Use ML discovery or generation Explicitly provisioned optional environments, models, and caches with suitable licenses.

Set up a checkout

Install SBCL and Qlot. Mora Studio also needs GLFW, libffi, and FreeType. On macOS, Homebrew provides all of them:

Shell
brew install sbcl glfw libffi freetype

Then, from the Mora checkout:

Shell
make deps
make repl

make deps installs the declared Lisp dependencies. SuperCollider, sample libraries, native audio plugins, and optional models are installed separately.

Installation and setup

Query a pattern, without audio

The make repl launcher loads the lower-level SuperDirt system, so load the language explicitly before using its DSL. The result is a pattern object and its events, not an audio file.

Common Lisp
(asdf:load-system "mora")

(in-package :mora)

(defparameter *first-pattern*
  (s "bd [hh hh] sn hh"))

(query-cycle *first-pattern* 0)

(mora.core:pattern-summary *first-pattern*)

(mora.core:pattern-children *first-pattern*)

The string notation is embedded in Lisp rather than replacing it, and the object stays available for later queries and inspection:

Common Lisp
(defparameter *changed-pattern*
  (>> *first-pattern*
      (fast 2)
      (every 4 #'rev)))

(query-cycle *changed-pattern* 0)

Hear it in Mora Studio

Follow the SuperDirt project's setup instructions for SuperCollider and its sample library, and confirm that the bd, sn, and hh banks are loaded. Then open the normal Studio launcher, which attempts the configured services and opens the native editor:

Shell
make studio

Evaluate one form at a time with Cmd+Return (Ctrl+Return). (d1!) is not a stop command: assign (silence) to stop a channel, and use hush when you mean to silence the whole session.

Common Lisp
(bpm 140)

(d1! (s "bd hh sn hh"))

(d1! (>> (s "bd [hh hh] sn hh")
         (gain 0.9)))

(d1! (silence))

A reading path

From here, the documentation moves from practice to the ideas behind it, then back to the instrument. Read in order, or jump to what you need.

  1. First patterns Query a pattern, open Studio, play and stop a channel.
  2. Patterns and time Span queries, exact ratios, whole and visible parts.
  3. Mini notation Subdivision, alternation, rests, repetition, weighting.
  4. Pipelines and composition The >> pipeline, stack, merge-left, channels and orbits.
  5. Transformations and groove Rate, placement, repetition, groove, and chance.
  6. What remains after evaluation Retained objects, introspection, and intercession.
  7. Common Lisp and CLOS Generic functions, classes, macros, and the image.
  8. Extending Mora defpattern, deftransform, and methods on events-in.
  9. Studio overview Editing, feedback, the listener, and errors.
  10. Multimodal channel forms Audio, shaders, and ordered post in one form.

The framework examples file

The framework example file demonstrates ordinary patterns, layering, inspection, generic shaders, and ordered image effects. Open it in Studio and evaluate forms individually; its header lists the sound and renderer prerequisites.

examples/mora-framework-intro.mora
;;; MORA: SMALL FRAMEWORK EXAMPLES
;;; Evaluate one form at a time in normal Mora Studio.
;;; Sound requires SuperDirt and its bd/sn/hh banks. Shader examples require
;;; Studio's native renderer.

(in-package :mora)

;;; Tempo, mini notation, transformation, and explicit stopping.
(bpm 140)

(d1! (s "bd [hh hh] sn hh"))

(d1! (>> (s "bd [hh hh] sn hh")
         (every 4 #'rev)
         (gain 0.9)))

(d1! (silence))

;;; Independent voices, using ordinary sample patterns.
(d1! (stack
       (s "bd ~ bd ~")
       (s "~ sn ~ sn")
       (>> (s "hh*8")
           (gain 0.45))))

;;; Generic shader construction and ordered image processing.
(d1! :viz (>> (osc :freq 36)
              (kaleid 6))
     :post (>> (mora.visual:pixelate :px 128
                                     :py 72)
               (mora.visual:ascii :characters " .:-=+*#%@")
               (mora.visual:edge-glow :amount .6
                                      :radius 1.5)))

;;; Bypass post-processing without replacing the visual source.
(d1! :post (mora.visual:post-chain))

;;; Inspect an ordinary temporal pattern without dispatching sound.
(defparameter *example-pattern*
  (>> (s "bd sn")
      (fast 2)))

(query-cycle *example-pattern* 0)
(mora.core:pattern-summary *example-pattern*)
(mora.core:pattern-children *example-pattern*)

Search the documentation

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