(else fret)))))))
+; default tunings for common string instruments
(define-public guitar-tuning '(4 -1 -5 -10 -15 -20))
+(define-public guitar-open-g-tuning '(2 -1 -5 -10 -17 -22))
(define-public bass-tuning '(-17 -22 -27 -32))
+(define-public mandolin-tuning '(16 9 2 -5))
;; tunings for 5-string banjo
(define-public banjo-open-g-tuning '(2 -1 -5 -10 7))
(define-public banjo-modal-tuning '(2 0 -5 -10 7))
(define-public banjo-open-d-tuning '(2 -3 -6 -10 9))
(define-public banjo-open-dm-tuning '(2 -3 -6 -10 9))
-;; convert 5-string banjo tunings to 4-string tunings by
-;; removing the 5th string
-;;
-;; example:
-;; \set TabStaff.stringTunings = #(four-string-banjo banjo-open-g-tuning)
+;; convert 5-string banjo tuning to 4-string by removing the 5th string
(define-public (four-string-banjo tuning)
(reverse (cdr (reverse tuning))))
(ly:grob-translate-axis! g 3.5 X)))
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Tuplets
+
+(define-public (tuplet-number::calc-denominator-text grob)
+ (let*
+ ((ev (ly:grob-property grob 'cause)))
+
+ (number->string (ly:event-property ev 'denominator))))
+
+
+(define-public (tuplet-number::calc-fraction-text grob)
+ (let*
+ ((ev (ly:grob-property grob 'cause)))
+ (format "~a:~a"
+ (ly:event-property ev 'denominator)
+ (ly:event-property ev 'numerator))))
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Color
(define-public red '(1.0 0.0 0.0))
(define-public green '(0.0 1.0 0.0))
(define-public blue '(0.0 0.0 1.0))
-(define-public cyan '(1.0 1.0 0.0))
+(define-public cyan '(0.0 1.0 1.0))
(define-public magenta '(1.0 0.0 1.0))
-(define-public yellow '(0.0 1.0 1.0))
+(define-public yellow '(1.0 1.0 0.0))
(define-public grey '(0.5 0.5 0.5))
(define-public darkred '(0.5 0.0 0.0))
(define-public darkgreen '(0.0 0.5 0.0))
(define-public darkblue '(0.0 0.0 0.5))
-(define-public darkcyan '(0.5 0.5 0.0))
+(define-public darkcyan '(0.0 0.5 0.5))
(define-public darkmagenta '(0.5 0.0 0.5))
-(define-public darkyellow '(0.0 0.5 0.5))
+(define-public darkyellow '(0.5 0.5 0.0))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; * Pitch Trill Heads
value)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; falls
+
+(define-public (fall::print spanner)
+ (let*
+ ((delta (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)
+ (ly:output-def-lookup (ly:grob-layout spanner) 'line-thickness)))
+ (padding (ly:grob-property spanner 'padding 0.5))
+ (common (ly:grob-common-refpoint right-span
+ (ly:grob-common-refpoint spanner
+ left-span X)
+ X))
+ (left-x (+ padding (interval-end (ly:grob-robust-relative-extent left-span common X))))
+ (right-x (- (interval-start (ly:grob-robust-relative-extent right-span common X)) padding))
+ (self-x (ly:grob-relative-coordinate spanner common X))
+ (dx (- right-x left-x))
+ (exp (list 'path thickness
+ `(quote
+ (rmoveto
+ ,(- left-x self-x) 0
+
+ rcurveto
+ ,(/ dx 3)
+ 0
+ ,dx ,(* 0.66 delta)
+ ,dx ,delta
+ ))))
+ )
+
+ (ly:make-stencil
+ exp
+ (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)))))))
+