diff implementations/midi/midifile-import.lisp @ 212:619194befdd4

add identifier and timebase slots to midifile composition class Ignore-this: 4e72a0860344399452bea196c3739bbf darcs-hash:20090524150506-16a00-bce845ccf20a9289a4015fb58287f25ebfa178ad.gz committer: Jamie Forth <j.forth@gold.ac.uk>
author j.forth <j.forth@gold.ac.uk>
date Thu, 24 Feb 2011 11:23:17 +0000
parents 1f3873585a5d
children de60993404c1
line wrap: on
line diff
--- a/implementations/midi/midifile-import.lisp	Thu Feb 24 11:23:17 2011 +0000
+++ b/implementations/midi/midifile-import.lisp	Thu Feb 24 11:23:17 2011 +0000
@@ -13,9 +13,10 @@
 
 (defmethod get-composition ((identifier midifile-identifier))
   (%initialise-midifile-composition (midi:read-midi-file
-				     (midifile-identifier-pathname identifier))))
+				     (midifile-identifier-pathname identifier))
+				    identifier))
 
-(defun %initialise-midifile-composition (midifile)
+(defun %initialise-midifile-composition (midifile identifier)
   ;; Takes a midifile object (from the "MIDI" package)
   ;; and returns an amuse midi object
   ;; FIXME: gets it wrong if patch changes in mid-note
@@ -129,7 +130,9 @@
 							   (list (make-standard-time-signature-period
 								  4 4 0 (/ last-time division))))
 				      :tempi (sort tempi #'time<)
-				      :key-signatures (sort key-sigs #'time<))))
+				      :key-signatures (sort key-sigs #'time<)
+				      :identifier identifier
+				      :midi-timebase division)))
       (sequence:adjust-sequence composition
 				(length notes)
 				:initial-contents (sort notes #'time<)))))