comparison implementations/midi/midifile-import.lisp @ 145:b5b18959c301

implementations/midi/midifile-import.lisp: fix note-off bug darcs-hash:20070924154439-c0ce4-38d4d3b24c15c74ac914e70ff5eacd33a26f865d.gz
author Marcus Pearce <m.pearce@gold.ac.uk>
date Mon, 24 Sep 2007 16:44:39 +0100
parents fd85f52d9f9d
children 4a0e15e2829a
comparison
equal deleted inserted replaced
144:70c716a6eb72 145:b5b18959c301
45 (= (midi:message-velocity event) 0))) 45 (= (midi:message-velocity event) 0)))
46 (let ((pitch (midi:message-key event)) 46 (let ((pitch (midi:message-key event))
47 (channel (midi:message-channel event)) 47 (channel (midi:message-channel event))
48 (t-off (midi:message-time event))) 48 (t-off (midi:message-time event)))
49 (if (aref ons channel pitch) 49 (if (aref ons channel pitch)
50 (push (make-event-from-on-off-pair (aref ons channel pitch) 50 (progn
51 t-off 51 (push (make-event-from-on-off-pair (aref ons channel pitch)
52 division 52 t-off
53 track-no 53 division
54 (aref patches channel)) 54 track-no
55 notes) 55 (aref patches channel))
56 notes)
57 (setf (aref ons channel pitch) nil))
56 ;; if there's no matching on, wait until the beat 58 ;; if there's no matching on, wait until the beat
57 ;; is done. 59 ;; is done.
58 (push event offs)))) 60 (push event offs))))
59 ((typep event 'midi:note-on-message) 61 ((typep event 'midi:note-on-message)
60 (let ((pitch (midi:message-key event)) 62 (let ((pitch (midi:message-key event))