- [Class]
cmn
Holds note and staff expressions (variables and function calls) to manuscript with CMN streams.
cmn
supports the following slot initializations:
:time
number- The start time of the object in the score.
:staff
number- The identifier of the staff to which the expression is added. Defaults to 0.
:expr
expr-
The CMN expession to add to the staff. If the value is a note name or
keynum and a
:duration
for the object is specfied then a new CMN note definition is added to the staff at the current score time. Otherwise, the value of:expr
can be any CMN expression (function call list or variable name) to add to the staff. For sake of clarity the:expr
initialzation can also be specified as:note
. :duration
number-
The duration (in seconds) of a
:note
definition. :data
list- A list of additional expressions to add to the note or staff.
Examples:
Example 1. CMN expressions.
;;; a meter expression (new cmn :time 0 :expr '(meter 3 4)) ;;; a note defintion (new cmn :time 0 :note 'c4 :duration 3) ;;; a note in staff 3 with markup added (new cmn :staff 3 :expr 'c4 :duration .5 :data '(accent ff))
Example 2. Outputting CMN objects to scores.
(new seq :name 'sevens :subobjects (list (new cmn :time 0 :expr '(meter 7 8)) (new cmn :time 0 :expr 'cs-major) (new cmn :time 0 :note 'c4 :duration (rhythm 'h..) :data '(pppp)) (new cmn :time 3.5 :note 'df5 :duration (rhythm 'e) :data '(accent sfz)) (new cmn :time 4 :note 'f4 :duration 2 :data '(mp fermata)))) ;;; generate an .eps file (events #&sevens "sevens.eps") ;;; generate a .cmn input file (events #&sevens "sevens.cmn" :size 20) ;;; generate a .mid file (events #&sevens "sevens.mid")
(midi-file-print "sevens.mid") File: sevens.mid Format: 0 Tracks: 1 Division: 480 Track 0, length 52 0 #<Tempo Change 1000 ms> 0 #<Time Signature 7/8 (24 clocks, 8 32nds)> 0 #<Key Signature 7 sharps, major> 0 #<Note-On 0 60 64> 1680 #<Note-Off 0 60 127> 0 #<Note-On 0 73 64> 240 #<Note-Off 0 73 127> 0 #<Note-On 0 65 64> 960 #<Note-Off 0 65 127> "seven.mid"