]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/output-lib.scm
(make_trill): do set_parent also
[lilypond.git] / scm / output-lib.scm
index 561184cbe9f69337d6662d777d462334b29f8f24..66ffcb0314b5c3c734d1c0492b9b7f7cd7e79d28 100644 (file)
@@ -289,8 +289,7 @@ centered, X==1 is at the right, X == -1 is at the left."
 
 (define (parenthesize-elements grob . rest)
   (let*
-      (
-       (refp (if (null? rest)
+      ((refp (if (null? rest)
                 grob
                 (car rest)))
        (elts (ly:grob-object grob 'elements))
@@ -300,7 +299,7 @@ centered, X==1 is at the right, X == -1 is at the left."
        (lp (ly:font-get-glyph font "accidentals.leftparen"))
        (rp (ly:font-get-glyph font "accidentals.rightparen"))
        (padding (ly:grob-property grob 'padding 0.1)))
-
+    
     (ly:stencil-add
      (ly:stencil-translate-axis lp (- (car x-ext) padding) X)
      (ly:stencil-translate-axis rp (+ (cdr x-ext) padding) X))
@@ -345,7 +344,7 @@ centered, X==1 is at the right, X == -1 is at the left."
 
 (define-public (fall::print spanner)
   (let*
-      ((delta (ly:grob-property spanner 'delta-position))
+      ((delta-y (* 0.5 (ly:grob-property spanner 'delta-position)))
        (left-span (ly:spanner-bound spanner LEFT))
        (right-span (ly:spanner-bound spanner RIGHT))
        (thickness (* (ly:grob-property spanner 'thickness)
@@ -367,13 +366,38 @@ centered, X==1 is at the right, X == -1 is at the left."
                     rcurveto                
                     ,(/ dx 3)
                     0
-                    ,dx ,(* 0.66 delta)
-                    ,dx ,delta
+                    ,dx ,(* 0.66 delta-y)
+                    ,dx ,delta-y
                     ))))
        )
 
     (ly:make-stencil
      exp
      (cons 0 dx)
-     (cons (min 0 delta)
-          (max 0 delta)))))
+     (cons (min 0 delta-y)
+          (max 0 delta-y)))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; grace spacing
+
+
+(define-public (grace-spacing::calc-shortest-duration grob)
+  (let*
+     ((cols (ly:grob-object grob 'columns))
+      (get-difference
+       (lambda (idx)
+        (ly:moment-sub (ly:grob-property (ly:grob-array-ref cols (1+ idx)) 'when)
+                       (ly:grob-property (ly:grob-array-ref cols idx) 'when))))
+      
+      (moment-min (lambda (x y)
+                   (cond
+                    ((and x y)
+                     (if (ly:moment<? x y)
+                           x
+                           y))
+                    (x x)
+                    (y y)))))
+                    
+    (fold moment-min #f (map get-difference
+                            (iota (1- (ly:grob-array-length cols)))))))
+