Mercurial > hg > amuse
changeset 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 | 70c716a6eb72 |
children | a74494a94be9 |
files | implementations/midi/midifile-import.lisp |
diffstat | 1 files changed, 9 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- 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)))))