[Function]
(object->cmn object)

Converts object into a list of CMN data. The connection between CMN and any event object is made by implemeting a method on this generic function. The method can return a list one of two formats. The first format produces CMN note infomation:

(id duration note ... )

where id is an integer identifying the staff that the display should appear in. If there is currently no staff for that id then one is automatically created. Duration is the duration of the cmn note and note is a note name like 'cs4'. The ... args are anything else that should be attached to the cmn note. These are symbols or expressions that will be evaluaed in the context of CMN's variable and function names.

The second possible format for the data list is:

(id cmn-variable/expr)

This adds a single cmn variable or expression to the staff belonging to id.

cm> (defmethod object->cmn (obj) 
      (list (midi-channel obj)
            (midi-duration obj)
            (note (midi-keynum obj))))
cm>

See Also: