]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/output-lib.scm
add breakableSeparationItem to extra encompass for slurs. This fixes
[lilypond.git] / scm / output-lib.scm
index f6ff77c55884c0c0fd225b295d1a0ade212602e7..0087169af5f6eefe0ce879e856d013ee50a10744 100644 (file)
@@ -317,8 +317,6 @@ centered, X==1 is at the right, X == -1 is at the left."
        (ly:grob-relative-coordinate me y-ref Y))))
     ))
 
-       
-       
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; 
@@ -345,10 +343,14 @@ centered, X==1 is at the right, X == -1 is at the left."
        (padding (ly:grob-property spanner 'padding 0.5))
        (common (ly:grob-common-refpoint right-span
                                        (ly:grob-common-refpoint spanner
-                                               left-span X)
+                                                                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))
+       (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 
@@ -379,8 +381,10 @@ centered, X==1 is at the right, X == -1 is at the left."
      ((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))))
+        (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
@@ -418,13 +422,15 @@ centered, X==1 is at the right, X == -1 is at the left."
     (number->string digit 10)
   ))
 
-(define-public (string-finger::calc-text grob)
+
+(define-public (stroke-finger::calc-text grob)
   (let*
-      ((digit (ly:event-property (event-cause  grob) 'digit))
-       (texts (ly:grob-property grob 'digit-names))
-       )
-    (vector-ref texts  (1- (max (min 5 digit) 1)))
-    ))
+      ((digit (ly:event-property (event-cause grob) 'digit))
+       (text (ly:event-property (event-cause grob) 'text)))
+
+    (if (string? text)
+       text
+       (vector-ref (ly:grob-property grob 'digit-names)  (1- (max (min 5 digit) 1))))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; dynamics
@@ -454,3 +460,43 @@ centered, X==1 is at the right, X == -1 is at the left."
 
 (define-public (lyric-text::calc-text grob)
    (ly:event-property (event-cause grob) 'text))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; fret boards
+
+(define (string-frets->description string-frets string-count)
+  (let*
+      ((desc (list->vector
+             (map (lambda (x) (list 'mute  (1+ x)))
+                  (iota string-count)))))
+       
+       (for-each (lambda (sf)
+                  (let*
+                      ((string (car sf))
+                       (fret (cadr sf))
+                       (finger (caddr sf)))
+
+                    
+                    (vector-set! desc (1- string)
+                                 (if (= 0 fret)
+                                     (list 'open string)
+                                     (if finger
+                                         (list 'place-fret string fret finger) 
+                                         (list 'place-fret string fret))
+                                         
+
+                                     ))
+                    ))
+                string-frets)
+
+       (vector->list desc)))
+
+(define-public (fret-board::calc-stencil grob)
+  (let* ((string-frets (ly:grob-property grob 'string-fret-finger-combinations))
+        (string-count (ly:grob-property grob 'string-count))
+        (layout (ly:grob-layout grob))
+        (defs (ly:output-def-lookup layout 'text-font-defaults))
+        (props (ly:grob-alist-chain grob defs)))
+
+    (make-fret-diagram layout props
+                      (string-frets->description string-frets 6))))