Update of /project/gsharp/cvsroot/gsharp In directory common-lisp.net:/tmp/cvs-serv26245
Modified Files: drawing.lisp Log Message: Multi-staff clusters in a beam group now seem to be drawn correctly.
Date: Thu Nov 10 23:55:45 2005 Author: rstrandh
Index: gsharp/drawing.lisp diff -u gsharp/drawing.lisp:1.14 gsharp/drawing.lisp:1.15 --- gsharp/drawing.lisp:1.14 Thu Nov 10 23:29:15 2005 +++ gsharp/drawing.lisp Thu Nov 10 23:55:45 2005 @@ -324,19 +324,23 @@ (bot-note-pos (reduce #'min elements :key #'element-minpos))) (if (>= (- top-note-pos 4) (- 4 bot-note-pos)) :down :up))))
+;;; the dominating note among a bunch of notes is the +;;; one that is closest to the beam, i.e. the one +;;; the one that is closest to the end of the stem that +;;; is not attached to a notehead. (defun dominating-note (notes stem-direction) (reduce (lambda (n1 n2) (let ((yoff1 (staff-yoffset (staff n1))) (yoff2 (staff-yoffset (staff n2)))) (if (eq stem-direction :up) - (if (> yoff1 yoff2) + (if (< yoff1 yoff2) n1 - (if (< yoff1 yoff2) + (if (> yoff1 yoff2) n2 (if (> (pitch n1) (pitch n2)) n1 n2))) - (if (< yoff1 yoff2) + (if (> yoff1 yoff2) n1 - (if (> yoff1 yoff2) + (if (< yoff1 yoff2) n2 (if (< (pitch n1) (pitch n2)) n1 n2)))))) notes))