]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/output-lib.scm
(datadir): remove LILYPONDPREFIX support.
[lilypond.git] / scm / output-lib.scm
index 572fcaff4399bd710087719b44dfb862381b9fc2..2496763397fd36deaf92990a186c2e07ecb456bf 100644 (file)
@@ -248,17 +248,17 @@ centered, X==1 is at the right, X == -1 is at the left."
 
 (define-public (tuplet-number::calc-denominator-text grob)
   (let*
-      ((mus (ly:grob-property grob 'cause)))
+      ((ev (ly:grob-property grob 'cause)))
     
-    (number->string (ly:music-property mus 'denominator))))
+    (number->string (ly:event-property ev 'denominator))))
 
 
 (define-public (tuplet-number::calc-fraction-text grob)
   (let*
-      ((mus (ly:grob-property grob 'cause)))
+      ((ev (ly:grob-property grob 'cause)))
     (format "~a:~a" 
-      (ly:music-property mus 'denominator)
-      (ly:music-property mus 'numerator))))
+      (ly:event-property ev 'denominator)
+      (ly:event-property ev 'numerator))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Color
@@ -361,13 +361,15 @@ centered, X==1 is at the right, X == -1 is at the left."
        (dx (- right-x left-x))
        (exp (list 'path thickness 
                  `(quote
-                   (,(- left-x self-x) 0
-                    rmoveto
+                   (rmoveto
+                    ,(- left-x self-x) 0
+
+                    rcurveto                
                     ,(/ dx 3)
                     0
                     ,dx ,(* 0.66 delta)
                     ,dx ,delta
-                    rcurveto)))) 
+                    ))))
        )
 
     (ly:make-stencil
@@ -375,3 +377,28 @@ centered, X==1 is at the right, X == -1 is at the left."
      (cons 0 dx)
      (cons (min 0 delta)
           (max 0 delta)))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 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)))))))
+