letter)))
radius X)))
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; clipping
+
+(define-public (make-rhythmic-location bar-num num den)
+ (cons
+ bar-num (ly:make-moment num den)))
+
+(define-public (rhythmic-location? a)
+ (and (pair? a)
+ (integer? (car a))
+ (ly:moment? (cdr a))))
+
+(define-public (make-graceless-rhythmic-location loc)
+ (make-rhythmic-location
+ (car loc)
+ (ly:moment-main-numerator (rhythmic-location-measure-position loc))
+ (ly:moment-main-denominator (rhythmic-location-measure-position loc))))
+
+(define-public rhythmic-location-measure-position cdr)
+(define-public rhythmic-location-bar-number car)
+
+(define-public (rhythmic-location<? a b)
+ (cond
+ ((< (car a) (car b)) #t)
+ ((> (car a) (car b)) #f)
+ (else
+ (ly:moment<? (cdr a) (cdr b)))))
+
+(define-public (rhythmic-location<=? a b)
+ (not (rhythmic-location<? b a)))
+(define-public (rhythmic-location>=? a b)
+ (rhythmic-location<? a b))
+(define-public (rhythmic-location>? a b)
+ (rhythmic-location<? b a))
+
+(define-public (rhythmic-location=? a b)
+ (and (rhythmic-location<=? a b)
+ (rhythmic-location<=? b a)))
+
+(define-public (rhythmic-location->file-string a)
+ (ly:format "~a.~a.~a"
+ (car a)
+ (ly:moment-main-numerator (cdr a))
+ (ly:moment-main-denominator (cdr a))))
+
+(define-public (rhythmic-location->string a)
+ (ly:format "bar ~a ~a"
+ (car a)
+ (ly:moment->string (cdr a))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; break visibility
("'" . ("'" . ()))
("empty" . (() . ()))
("brace" . (() . "brace"))
- ("bracket" . (() . "bracket"))))
+ ("bracket" . (() . "bracket"))
+
+ ;; segno bar lines
+ ("S" . ("||" . "S"))
+ ("|S" . ("|" . "S"))
+ ("S|" . ("S" . ()))
+ (":|S" . (":|" . "S"))
+ (":|S." . (":|S" . ()))
+ ("S|:" . ("S" . "|:"))
+ (".S|:" . ("|" . "S|:"))
+ (":|S|:" . (":|" . "S|:"))
+ (":|S.|:" . (":|S" . "|:"))))
(define-public (bar-line::calc-glyph-name grob)
(let* ((glyph (ly:grob-property grob 'glyph))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Color
-(define-public color? list?)
+(define-public (color? x)
+ (and (list? x)
+ (= 3 (length x))
+ (apply eq? #t (map number? x))
+ (apply eq? #t (map (lambda (y) (<= 0 y 1)) x))))
+
(define-public (rgb-color r g b) (list r g b))
; predefined colors
(half-thickness 0.05) ; should it be a property?
(width 0.5) ; should it be a property?
(angularity 1.5) ; makes angle brackets
+ (white-padding 0.1) ; should it be a property?
(lp (ly:stencil-aligned-to
(ly:stencil-aligned-to
(make-parenthesis-stencil y-extent
angularity)
Y CENTER)
X RIGHT))
+ (lp-x-extent
+ (interval-widen (ly:stencil-extent lp X) white-padding))
(rp (ly:stencil-aligned-to
(ly:stencil-aligned-to
(make-parenthesis-stencil y-extent
width
angularity)
Y CENTER)
- X LEFT)))
-
+ X LEFT))
+ (rp-x-extent
+ (interval-widen (ly:stencil-extent rp X) white-padding)))
+ (set! lp (ly:make-stencil (ly:stencil-expr lp)
+ lp-x-extent
+ (ly:stencil-extent lp Y)))
+ (set! rp (ly:make-stencil (ly:stencil-expr rp)
+ rp-x-extent
+ (ly:stencil-extent rp Y)))
(list (stencil-whiteout lp)
(stencil-whiteout rp))))
(begin
(ly:grob-suicide! grob)
(list)))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; laissez-vibrer tie
+;;
+;; needed so we can make laissez-vibrer a pure print
+;;
+(define-public (laissez-vibrer::print grob)
+ (ly:tie::print grob))
+