[CM] about output to cmn file

Anders Vinjar andersvi@ulrik.uio.no
Tue, 11 May 2004 13:35:15 +0200

The most flexible way, giving you access to whatever
cmn-manuscripting you might want from CM, is to define a
'cmn-data object and letting it pass your meter-change to cmn.

    (defobject cmn-data ()
      ((time :accessor object-time)
       (staff :initform 0)
       (data :initform nil)))

    (defmethod object->cmn (cmn-data)
      (list (cmn-data-staff cmn-data)
            (cmn-data-data cmn-data)))

    (defmethod object->midi (cmn-data) nil)

Giving access to statements like

  (new cmn-data time (now) data (meter 4 4))

or whatever in a cm-process.

This will let you state the following process in CM:

    (defprocess xy ()
      (process repeat 80
               for counter from 0
               with notes = (new heap :of '(0 1 2 3 4 5 6 7 8))
               and keys = (new heap :of '(c-major cs-major d-major))
               (progn (when (zerop counter)
                         (new cmn-data time (now) data (list 'meter 4 4)))) 
                      (progn (when (zerop (random 20))
                               (output (new cmn-data time (now) data (list 'meter (between 1 7) 4))))
                             (when (zerop (random 20))
                               (output (new cmn-data time (now) data (next keys))))))
               output (new midi time (now) duration .25
                           keynum (note (+ 55 (next notes))))

               wait .25))

-and have everything rendered directly out by cmn:

    (events (xy) "xy2.cmn" :size 20)


     > But, I'd like to output (display) meterchange into certain
     > staff into cmn-file (every time i call my process-function
     > to output events of next phrase) Is there something for
     > this task ?? (set-meter ...)??  I'm using cmucl-cm-clm-cmn
     > combination.

     > Thanks, Ville Isomöttönen

     > _______________________________________________ Cmdist
     > mailing list Cmdist@ccrma.stanford.edu
     > http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist