Reference

Pitch, harmony, and tuning

Absolute pitches, scale degrees, chords, voicings, arpeggiation, tunings beyond twelve equal divisions, and explicit MIDI pitch policies.

Mora treats pitch in separate layers: absolute pitches, coordinates in a scale, chord identity and its voicing, and the tuning that maps degrees to frequency. This page covers each layer, the forms that move between them, and how pitch reaches a MIDI receiver.

Absolute pitches

notes makes the absolute-pitch intent explicit:

Common Lisp
(d1! (>> (notes "f3 ab3 c4 eb4")
         (s "psin")
         (gain 1)))

In Mora’s named-pitch convention, bare C is C3, and C3 is MIDI 48:

Named pitchMIDI note number
C (bare)48
C348
C460

notes accepts named and fractional pitches. Fractional numeric pitches remain fractional for capable synthesis targets.

notes is distinct from n, the legacy numeric and sample-index lane, whose interpretation depends on the receiving context. In mini notation, :N after a sound name selects a sample variant, not a pitch. See pattern literals and mini notation.

Scale degrees

degrees represents scale coordinates. in-scale maps those coordinates to pitches:

Common Lisp
(d1! (>> (degrees "0 0.5 1 1.5 2 2.5 3 3.5")
         (in-scale :minor
                   :root "f3")
         (s "psin")))

Fractional degrees interpolate between adjacent scale degrees. They are not silently rounded.

Quantizing and transposing in a scale

scale-quantize maps pitches onto a scale. scale-transpose moves in the mapped degree space.

Defining a scale

Scale vocabulary can be extended with define-scale:

Common Lisp
(define-scale :my-pentatonic '(0 3 5 7 10))

(d1! (>> (degrees "0 1 2 3 4 5 6 7")
         (in-scale :my-pentatonic
                   :root "f3")
         (s "psin")))

Chords, voicings, and arpeggiation

Chord identity and its realization as voices are separate. chords describes the chords; voicing realizes them as voices:

Common Lisp
(defparameter *changes* (chords "<Fm7 Dbmaj7 Eb7 Cm7>"))

(d1! (>> (voicing *changes*
                  :anchor "c4"
                  :dictionary :closed)
         (s "psin")))

arpeggiate selects actual voices from those chords:

Common Lisp
(d1! (>> (voicing *changes*
                  :anchor "c4")
         (arpeggiate "0 ~ 2 [1 3]")
         (s "psin")
         (legato 0.6)))

Arpeggiating chord voices is distinct from choosing sample indices or independently authoring another melody.

define-chord and define-voicing extend the chord and voicing dictionaries.

Tuning beyond twelve equal divisions

Mora includes equal-division, ratio-based, and large/small-step tuning descriptions. tune maps degrees to precise frequency. frequency-transpose applies a frequency ratio.

Common Lisp
(defparameter *tuning*
  (equal-tuning 31
                :base-frequency 220))

(d1! (>> (degrees "0 6 12 -1")
         (tune *tuning*)
         (s "psin")))

Tuning is independent of temporal meter and independent of the MIDI receiver’s policy. A non-octave period is also representable.

MIDI pitch policies

MIDI output requires an explicitly selected and configured receiver. The available policies distinguish strict delivery, quantization, and pitch bend:

  • Plain-channel pitch bend is shared by overlapping notes on that channel.
  • MPE uses member channels for independent note bends.
  • The receiver’s bend sensitivity must match the sender’s declared range.

The individual policies and configuration examples for channel pitch bend and MPE are in MIDI and other outputs.

Source references

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

  • src/mini/pitch.lisp
  • src/mini/harmony-scales.lisp
  • src/mini/harmony-chords.lisp
  • src/mini/harmony-arpeggiation.lisp
  • src/mini/tuning.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.