]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/output-lib.scm
(bar-line::calc-glyph-name): add dashed liine
[lilypond.git] / scm / output-lib.scm
index 7eeefa3bad4adf6a2cb56f898d32d08e0e6e3141..2071541029972caf8643e8cb9fd9fe9a080f667b 100644 (file)
@@ -6,26 +6,7 @@
 ;;;; Han-Wen Nienhuys <hanwen@cs.uu.nl>
 
 
-
-(define-public (event-cause grob)
-  (let*
-      ((cause (ly:grob-property  grob 'cause)))
-    
-    (cond
-     ((ly:stream-event? cause) cause)
-     ((ly:grob? cause) (event-cause cause))
-     (else #f))))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; note heads
-
-(define-public (note-head::calc-duration-log grob)
-  (ly:duration-log
-   (ly:event-property (event-cause grob) 'duration)))
-
-(define-public (dots::calc-dot-count grob)
-  (ly:duration-dot-count
-   (ly:event-property (event-cause grob) 'duration)))
+;;; Tablature functions, by Jiba (jiba@tuxfamily.org)
 
 ;; The TabNoteHead stem attachment function.
 (define (note-head::calc-tablature-stem-attachment grob)
                  layout props (make-circle-markup text))))
     circle))
 
+
+;;(define (mm-to-pt x)
+;;  (* (/ 72.27 25.40) x))
+
+;; do nothing in .scm output
+
+(define-public (ly:numbers->string lst)
+  (string-join (map ly:number->string lst) " "))
+
+(define (number->octal-string x)
+  (let* ((n (inexact->exact x))
+         (n64 (quotient n 64))
+         (n8 (quotient (- n (* n64 64)) 8)))
+    (string-append
+     (number->string n64)
+     (number->string n8)
+     (number->string (remainder (- n (+ (* n64 64) (* n8 8))) 8)))))
+
+(define-public (ly:inexact->string x radix)
+  (let ((n (inexact->exact x)))
+    (number->string n radix)))
+
+(define-public (ly:number-pair->string c)
+  (string-append (ly:number->string (car c)) " "
+                (ly:number->string (cdr c))))
+
+
 ;; silly, use alist? 
 (define-public (note-head::calc-glyph-name grob)
   (let*
@@ -341,8 +349,7 @@ centered, X==1 is at the right, X == -1 is at the left."
        (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)))
+                    (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
@@ -395,27 +402,3 @@ centered, X==1 is at the right, X == -1 is at the left."
     (fold moment-min #f (map get-difference
                             (iota (1- (ly:grob-array-length cols)))))))
 
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; fingering
-
-(define-public (fingering::calc-text grob)
-  (let*
-      ((event (ly:grob-property grob 'cause))
-       (digit (ly:event-property event 'digit)))
-    
-    (if (> digit 5)
-       (ly:input-message (ly:music-property event 'origin)
-                         "Music for the martians"))
-
-    (number->string digit 10)
-  ))
-
-(define-public (string-number::calc-text grob)
-  (let*
-      ((event (ly:grob-property grob 'cause))
-       (digit (ly:event-property event 'string-number)))
-    
-    (number->string digit 10)
-  ))