[CM] bringing midifiles into CM

Drew Krause drkrause@mindspring.com
Sun, 17 Oct 2004 12:25:58 -0400

I'm writing the following CM function, which lists the keynums, 
start-times and durations for each event in a midi file. The keynums and 
durations work fine, but what should #'mystery-value be -- or how must 
start-times otherwise be handled? All help much appreciated!

Drew Krause

(defun midi-in (midifile)
  (let ((mytracks (import-events midifile :meta-exclude t))
        (pits '())
        (durs '())
        (starts '()))
    (map-subobjects #'(lambda (x) (push x pits)) mytracks :key 
#'midi-keynum :type 'midi)
    (map-subobjects #'(lambda (x) (push x durs)) mytracks :key 
#'midi-duration :type 'midi)
    (map-subobjects #'(lambda (x) (push x starts)) mytracks :key 
#'mystery-value :type 'midi)
    (list (nreverse pits) (nreverse starts) (nreverse durs))))