Class
cmn-fileImplements CMN manuscript output to .eps files and .cmn source files. This class is automatically chosen when you specify a file with a .eps or .cmn extension to the events function.
cmn-file supports the following slot
initializations:
:versioning boolean:play boolean:exact boolean:staffing list:channel value of a midi object or the :staff value of a cmn object.) Each staff description in
list is a list in the format:
(id [:name string] [:clef symbol] [:meter list])
where id is an integer staff identifier followed by
optional keyword and value pairs. The value of :name is a string name for the staff and
defaults to "staff-n" where n is the staff id.
The value of :clef is a keyword clef
name: :treble, :bass, :alto,
etc., or a list of clef names. If a clef not specified then CMN will
choose whatever clef(s) it thinks best as it manuscripts the objects
in the score. If the clef is :both then
you get a grand staff. If the value is a list it these choices will
limit CMN's clef choices to that list. The value of :meter is a meter list for the staff like (3
4), (7 8) and so on. See below for an example of a staffing list.
cmn-file
will pass on any CMN
score attribute. The most common of these are:
:size integer:title string:metronome integerConsult the CMN manual for more information.
Example 1. Outputting to CMN scores.
(define (testit stf len nts) ;; midi channel numbers map to staves. (let ((nts (new heap :notes nts)) (rhy (new weighting :of (list 1 (new cycle :of '(1/2 1/2)))))) (process while (< (now) len) for n = (next nts) for r = (next rhy) output (new midi :time (now) :duration r :keynum n :channel stf) wait r))) ;;; define staff descriptions (define staffs '((0 :name "Viola" :clef :alto :meter (4 4)) (2 :name "Flute" :clef :treble :meter (4 4)))) ;;; generate an .eps file (events (list (testit 0 12 '(c3 d ef f g)) (testit 1 12 '(c5 d ef f g))) "testit.eps" :staffing staffs :size 24 :exact true :title "Hiho!") ;;; another way to set score properties (io "duet.cmn" :staffing staffs :size 20 :exact true :title "Duet") ;;; generate a .cmn file (events (list (testit 0 12 '(c3 d ef f g)) (testit 1 12 '(c5 d ef f g))) "duet.cmn")
cmn [Class]