[gsharp-cvs] CVS gsharp
crhodes
crhodes at common-lisp.net
Thu Jun 7 10:21:48 UTC 2007
Update of /project/gsharp/cvsroot/gsharp
In directory clnet:/tmp/cvs-serv16621
Modified Files:
drawing.lisp
Log Message:
Placement of semibreve rests when they are the only element in the bar
(conventionally meaning whole-bar rest): place them in the middle of the
bar. The semantic interpretation (e.g. by Play Segment) is unlikely to
respect this conventional meaning currently (noticeable if you use these
whole-bar rests in a piece in 3/4, say)
--- /project/gsharp/cvsroot/gsharp/drawing.lisp 2007/01/07 06:05:35 1.74
+++ /project/gsharp/cvsroot/gsharp/drawing.lisp 2007/06/07 10:21:47 1.75
@@ -311,6 +311,13 @@
finally (setf (elasticity-function measure) result)))
(reduce #'add-elasticities measures :key #'elasticity-function))
+(defun single-whole-rest-in-bar-p (element)
+ (let* ((bar (bar element))
+ (elements (elements bar)))
+ (and (null (cdr elements))
+ (typep element 'rest)
+ (eq (notehead element) :whole))))
+
(defun compute-measure-coordinates (measure x y force)
(loop with timelines = (timelines measure)
for i from 0 below (flexichain:nb-elements timelines)
@@ -320,7 +327,9 @@
(* force (elasticity timeline))))
do (loop for element in (elements timeline)
do (setf (final-absolute-element-xoffset element)
- (round (+ xx (score-pane:staff-step (xoffset element)))))))
+ (if (single-whole-rest-in-bar-p element)
+ (round (+ x (/ (size-at-force (elasticity-function measure) force) 2)))
+ (round (+ xx (score-pane:staff-step (xoffset element))))))))
(loop for bar in (measure-bars measure)
do (compute-bar-coordinates bar x y (size-at-force (elasticity-function measure) force))))
@@ -487,10 +496,6 @@
(values best-splits best-min best-max))))))))
(split-aux sequence 0 (length sequence) n)))
-
-
-
-
(defun layout-page (measures n method)
(if (<= (length measures) n)
(mapcar #'list measures)
More information about the Gsharp-cvs
mailing list