(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
(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
(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)))))))
+