Class
mode
Defines a transposable subset of a tuning in which the sequential keynums in
the mode map to non-sequential keynums, notes or hertz values in the
tuning. Every mode maps to exactly one tuning; if no tuning is
specified when the mode is created then it defaults to the standard chromatic scale. The
number of steps per octave as well as the mode's octave size are
determined from its interval specification when the mode is created.
A mode can be placed on any degree in the mode's tuning using the transpose function.
Modes can be used in place of tunings when generating frequency
information using the
note,
keynum and hertz functions.
mode supports the following slot initializations:
:name {string | symbol}:steps intervals
:degrees {notes | keynums}
:notes notes
:lowest note:tuning tuning;; Defining and transposing a mode. (define major (new mode :degrees '(d e fs g a b c d))) (note 35 :in major) ⇒ d4 (note 36 :in major) ⇒ e4 (transpose major 'af) ⇒ #<mode: (on af)> (note 35 :in major) ⇒ af4 ;; Modes smaller and larger than one octave. ;; a five note mode whose "octave" is a perfect 5th (define mini (new mode :steps '(2 1 2 1 1))) (loop for k from 35 repeat 14 collect (note k :in mini)) ⇒ (cs3 ef3 e3 fs3 g3 af3 bf3 b3 cs4 d4 ef4 f4 fs4 af4) ;; a 12 note mode that spans two octaves (define maxi (new mode :steps '(2 1 2 3 2 3 3 2 1 2 2 1))) (loop for k from 24 repeat 12 collect (note k :in maxi)) ⇒ (c3 d3 ef3 f3 af3 bf3 cs4 e4 fs4 g4 a4 b4)