# HG changeset patch # User David Lewis # Date 1283947617 -3600 # Node ID 23b97270de8b94d0e62fc555b3d95d7e83e765ec # Parent 3e7b33ae3a0d1f5e49977fff7f293acbaef4e749 Changes to gsharp import to accommodate mensural notation. N.B. This won't work without my branch of GSharp committer: David Lewis diff -r 3e7b33ae3a0d -r 23b97270de8b implementations/gsharp/gsharp-import.lisp --- a/implementations/gsharp/gsharp-import.lisp Wed Sep 08 13:06:57 2010 +0100 +++ b/implementations/gsharp/gsharp-import.lisp Wed Sep 08 13:06:57 2010 +0100 @@ -36,15 +36,27 @@ sum (gsharp-buffer:duration (gsharp-buffer:cluster n)))) (defun events-from-element (element index time) - (when (typep element 'gsharp-buffer:cluster) - (mapcar (lambda (note) - (make-instance 'gsharp-pitched-event - :note note - :slice-index index - :number (gsharp-play::midi-pitch note) - :time time - :interval (* 4 (compute-duration note)))) - (remove-if #'gsharp-buffer:tie-left (gsharp-buffer:notes element))))) + (cond + ((typep element 'gsharp-buffer:cluster) + (mapcar (lambda (note) + (make-instance 'gsharp-pitched-event + :note note + :slice-index index + :number (gsharp-play::midi-pitch note) + :time time + :interval (* 4 (compute-duration note)))) + (remove-if #'gsharp-buffer:tie-left (gsharp-buffer:notes element)))) + ((typep element 'gsharp-buffer::mensural-element) + (mapcan (lambda (note) + (prog1 + (make-instance 'gsharp-pitched-event + :note note + :slice-index index + :number (gsharp-play::midi-pitch note) + :time time + :interval (* 4 (compute-duration note))) + (incf time (* 4 (compute-duration note))))) + (gsharp-buffer::contents element))))) (defun events-from-bar (bar index time) (mapcan (lambda (element)