*default-midi-pathname* | [Variable] |
The default pathname for MIDI file operations. Initially set to "test.midi" in the directory returned by (user-homedir). All MIDI file functions merge a supplied file name with *default-midi-pathname* to form the fully specified pathname.
See Also:
MIDIdefinstrument {name | (name {keyword value}*)} ({parameters}+) {form}* | [Macro] |
Defines a CLM instrument and a note class of the same name for composing with the instrument. name is the name of the instrument, and may be specified as a list together with optional keywords that provide control over the exact behavior of definstrument. In addtion to the keywords suported by CLM, Common Music adds three keywords of its own:
See Also:
CLM, Working with CLM, tutorials/stella/fm.insdefmode {name | (name} {option value})} {step}+ | [Macro] |
Defines a named, transposable subset of a scale. Modes may replace scales when specifying notes, pitches, degrees or intervals and may function as "filters" by using mode-note, mode-degree, or mode-pitch.
Name is the name of the new mode. Following name comes by zero or more option value pairs.
defmode supports the following options:
Example:
? (setf m (defmode (major on 'c4) 2 2 1 2 2 2 1)) #<MODE: Major (on C)> ? (note 0 m) C00 ? (note 7 m) C0 ? (setf x (intervals 0 1 2 3 4 5 6 7 from (notes c4 fs) of m returning note)) #<CYCLIC-INTERVAL-STREAM 133753451> ? (read-items x 16) (C4 D4 E4 F4 G4 A4 B4 C5 FS4 GS4 AS4 B4 CS5 DS5 F5 FS5) ? (transpose m 'D4) #<MODE: Major (on D)> ? (loop for i from 35 repeat 15 collect (note i m)) (D4 E4 FS4 G4 A4 B4 CS5 D5 E5 FS5 G5 A5 B5 CS6 D6) ? (setf m (defmode funny-mode c0 d e fs gs as c1 cs ds e fs g a bf c2)) #<MODE: Funny-mode (on C0)> ? (loop for i from (degree 'c4) below (degree 'c6) by 1 collect (mode-note i m)) (C4 C4 D4 D4 E4 E4 FS4 FS4 GS4 GS4 AS4 AS4 C5 CS5 CS5 DS5 E5 E5 FS5 G5 G5 A5 AS5 AS5) ;;; ;;; a few common mode definitions ;;; (defmode pentatonic 2 3 2 2 3) (defmode whole-tone 2 2 2 2 2 2) (defmode octatonic1 1 2 1 2 1 2 1 2) (defmode octatonic2 2 1 2 1 2 1 2 1) (defmode dorian 2 1 2 2 2 1 2) (defmode phrygian 1 2 2 2 1 2 2) (defmode lydian 2 2 2 1 2 2 1) (defmode mixolydian 2 2 1 2 2 1 2) (defmode aeolian 2 1 2 2 1 2 2) (defmode locrian 1 2 2 1 2 2 2) (defmode ionian 2 2 1 2 2 2 1)
See Also:
defscale, mode-note, mode-pitch, mode-degree, transpose, defscales.lispdefmultiple-item name ({field}+) ({keyword value})* | [Macro] |
Defines a class of item with component fields. Multiple items enumerate their fields in parallel, regardless of what type of pattern the multiple-item appears in. Fields may contain constant values or item streams. name is the name for the multiple item. Each field declares a component of the multiple item. Following the field specification comes zero or more option lists:
(lambda (x y) (list x (degree y))
Example:
? (defmultiple-item gesture (pit rhy) (:element-period :all) (:element-parser (lambda (n r) (list (note n) (rhythm r))))) #<Standard-Class GESTURE 137535711> ? (setf x (items (gesture c4 q) (gesture (notes c5 c6 in random) w) (gesture b3 (rhythms s e for 1)) in heap for 10)) #<HEAP-ITEM-STREAM 137443141> ? (read-items x) ((C4 1.0) (C5 4.0) (C5 4.0) (B3 0.25) (B3 0.5) (C6 4.0) (C5 4.0) (C4 1.0) (C4 1.0) (B3 0.25) (C5 4.0) (C5 4.0) (C4 1.0))
See Also:
Item Streams, multiple-item-binddefobject name ({super}*) ({slot}*) {option}* | [Macro] |
Defines a new class of object. name is the name for the new class. Following name comes a list of zero or more superclasses. The new object will inherit slots and behavior from each super in the list. Following this list comes the slot specification list. Each slot in the list is either the name of a slot or a list of the form:
(slot &key :initform :accessor :reader :writer)Following the slot specification list comes zero or more options. Each option is a list of the form:
(option {value}*)Where option is the keyword option name and value is a value.
defobject supports the following options:
defobject expressions should always be compiled before using.
See Also:
i1.lispdefscale name ({keywords}*) {degree}+ | [Macro] |
Defines a musical scale. Three types of scales are supported: equal tempered scales have a fixed ratio between scale degrees and scale octaves; gapped scales have a fixed ratio between octaves, but not between intervals within an octave; and general scales have no fixed ratio between either intervals or octaves. The type of scale defined is normally determined automatically by defscale when it examines the keywords and degree forms that collectively define the scale's "prototype octave".
defscale supports the following keywords:
((&rest note-names) &key :pitch :scaler :ratio)note-names are all the possible (enharmonic) note names for the prototype degree. If there is only one note name for the entry it is not necessary to specify that name in a list. :pitch, :scaler, and :ratio are mutually exclusive ways for specifying a floating point pitch of a prototype degree. Use :pitch to directly specify the floating point frequency of the entry, but it is easier and safer to specify a pitch value indirectly, using either the :scaler or :ratio keywords. :scaler is a multiplier for the :lowest-pitch keyword for the scale. A :scaler value for the first degree in the prototype octave must therefore be 1.0. :ratio is a ratio distance to the next scale entry from the current one. The :ratio value for the last entry is ignored. :ratio is really syntactic sugar that is automatically converted to an absolute :scaler value. If no :scaler, :pitch or :ratio value is supplied (i.e. the scale is an equal tempered scale), then the surrounding () for note-names may be omitted.
The symbolic rest name Rindicating silence is automatically added to all scales.
Example:
;; a 4 octave equal tempered scale, 5 notes per octave, with ;; octaves slightly stretched: ? (defscale foo (:lowest-pitch 123.45 :number-of-octaves 4 :octave-ratio 2.1) i ii iii iv v) #<EQUAL-TEMPERED-SCALE Foo 137653271> ? (in-scale 'foo) #<EQUAL-TEMPERED-SCALE Foo 137653271> ? (read-items (pitches i0 i1 ii2 iii3 v1)) (123.45 259.245 631.5002 1538.2844 469.33813) (in-scale 'chromatic-scale) #<EQUAL-TEMPERED-SCALE Chromatic-Scale>
See Also:
defscales.lisp, find-scale, in-scale, list-all-scales, *standard-scale*degree | [Item Type] |
The integer position of an entry in a musical scale. Scale entries have three different aspects: a note, or symbolic note name, a pitch, or floating point frequency, and a degree, or ordinal position.
Each of these reference types is supported by a function for converting to that type and a macro for creating item streams of that type.
See Also:
degree [Function], degrees, note, pitchdegree reference &optional scale | [Function] |
Returns the integer scale position of reference in scale. Reference may be a note, degree, or pitch. If scale is omitted it defaults to *standard-scale*.
Example:
? (degree 'a4) 69 ? (degree 440.0) 69 ? (degree 69) 69
See Also:
degree [Item Type], degrees, note, notes, pitch, pitches, *standard-scale*degrees {reference}+ {option value}* | [Macro] |
Creates an item stream of integer scale positions. Each reference may be a note, degree, pitch or item stream.
degrees implements the following option value pairs:
Example:
? (setf x (degrees c4 d e f in random for 8)) #<RANDOM-DEGREE-STREAM 131443131> ? (read-items x) (65 64 64 60 65 62 64 64)
See Also:
degree, Item Streams, note, notes, pitch, pitchesdiminuendo {from amplitude} {to amplitude} {in integer}{beat amplitude}* | [Macro] |
Creates a cyclic amplitude stream. Amplitudes start at from and move to to over in number of beat type beats. from, to and in must be specified but may appear in any order.
Example:
? (setf x (diminuendo in 8 from .8 to .2)) #<CYCLIC-AMPLITUDE-STREAM 133753451> ? (read-items x) (0.8 0.71428573 0.62857145 0.5428571 0.45714286 0.37142858 0.2857143 0.2)
See Also:
amplitude, amplitudes, crescendodoitems ({var | (var1 var2)} {stream} {keyword value}*) {form}* | [Macro] |
Binds varto succesive items in stream. If var is a list of two variables, then the first variable is bound to successive items and the second variable is bound to successive states.
doitems supports the following keyword value pairs:
Example:
? (doitems (x (items foo bar baz in random for 6)) (format t " ~A" x)) BAR FOO BAZ BAZ FOO BAZ NIL
See Also:
item, Item Streams, read-items