# HG changeset patch # User Marcus Pearce # Date 1190648679 -3600 # Node ID b5b18959c301d94107cfea7e96baa07d713fcb22 # Parent 70c716a6eb72a7a6e9fa354ce3f7d03e0536ec0d implementations/midi/midifile-import.lisp: fix note-off bug darcs-hash:20070924154439-c0ce4-38d4d3b24c15c74ac914e70ff5eacd33a26f865d.gz diff -r 70c716a6eb72 -r b5b18959c301 implementations/midi/midifile-import.lisp --- a/implementations/midi/midifile-import.lisp Mon Sep 24 12:33:52 2007 +0100 +++ b/implementations/midi/midifile-import.lisp Mon Sep 24 16:44:39 2007 +0100 @@ -47,12 +47,14 @@ (channel (midi:message-channel event)) (t-off (midi:message-time event))) (if (aref ons channel pitch) - (push (make-event-from-on-off-pair (aref ons channel pitch) - t-off - division - track-no - (aref patches channel)) - notes) + (progn + (push (make-event-from-on-off-pair (aref ons channel pitch) + t-off + division + track-no + (aref patches channel)) + notes) + (setf (aref ons channel pitch) nil)) ;; if there's no matching on, wait until the beat ;; is done. (push event offs)))) @@ -156,4 +158,4 @@ divisions) :velocity (midi:message-velocity note-on) :patch patch - :number (midi:message-key note-on))))) \ No newline at end of file + :number (midi:message-key note-on)))))