# HG changeset patch # User David Lewis # Date 1187694218 -3600 # Node ID d041118612d410ae238b367ade661064b599740b # Parent bfe5afcad1837f26ff7dfab360b44a64371a9a50 Fixed monody import for geerdes darcs-hash:20070821110338-f76cc-6958b98c5ece929c14f7faa5bc837810254621b9.gz diff -r bfe5afcad183 -r d041118612d4 implementations/geerdes/constructors.lisp --- a/implementations/geerdes/constructors.lisp Mon Aug 20 15:44:32 2007 +0100 +++ b/implementations/geerdes/constructors.lisp Tue Aug 21 12:03:38 2007 +0100 @@ -24,7 +24,9 @@ (%fast-duration row timebase) (%fast-id row))))) (when (%fast-monodyp row) - (push note monody-notes)) + (let ((monody-note (copy-event note))) + (setf (duration monody-note) (%fast-monody-duration row timebase)) + (push monody-note monody-notes))) (when (> (timepoint (cut-off note)) last-time) (setf last-time (timepoint (cut-off note)))) (push note notes) @@ -92,6 +94,8 @@ (eighth event-row)) (defun %fast-monodyp (event-row) (ninth event-row)) +(defun %fast-monody-duration (event-row timebase) + (/ (tenth event-row) timebase)) (defun %fast-tempo (tp-row) (eighth tp-row)) @@ -147,7 +151,7 @@ :velocity velocity :patch patch :id id))) -(defmethod copy-event ((event geerdes-percussive-event)) +(defmethod copy-event ((event geerdes-percussive-event)) (with-slots ((channel amuse-midi::channel) (track amuse-midi::track) (time amuse::time) @@ -157,7 +161,7 @@ (sound amuse-midi::sound) id) event (make-instance 'geerdes-percussive-event - :channel channel + :channel channel :track track :time time :interval interval diff -r bfe5afcad183 -r d041118612d4 implementations/geerdes/methods.lisp --- a/implementations/geerdes/methods.lisp Mon Aug 20 15:44:32 2007 +0100 +++ b/implementations/geerdes/methods.lisp Tue Aug 21 12:03:38 2007 +0100 @@ -84,7 +84,7 @@ (defun get-db-events (file-id) (clsql:query (concatenate 'string " - SELECT track, channel, start, duration, patch, pitch, velocity, id, event_id + SELECT track, channel, start, duration, patch, pitch, velocity, id, event_id, mel_duration FROM midi_event LEFT JOIN derived_midi_monody ON (id=event_id) WHERE file_id=" (princ-to-string file-id) " ORDER BY start")))