]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/lily-library.scm
Center harmonic heads if stem is invisible. Fixes #140
[lilypond.git] / scm / lily-library.scm
index acb29bb8530a25702fbfe01f305d0fb48feeb217..7bdf96d05d542a73b97e5a2a9d5f5b1d45e83c87 100644 (file)
@@ -4,7 +4,7 @@
 ;;;;  source file of the GNU LilyPond music typesetter
 ;;;; 
 ;;;; (c) 1998--2006 Jan Nieuwenhuizen <janneke@gnu.org>
-;;;; Han-Wen Nienhuys <hanwen@cs.uu.nl>
+;;;; Han-Wen Nienhuys <hanwen@xs4all.nl>
 
 
 (define-public X 0)
@@ -228,7 +228,24 @@ found."
     m))
 
 ;;;;;;;;;;;;;;;;
-; list
+;; list
+
+
+(define-public (list-join lst intermediate)
+  "put INTERMEDIATE  between all elts of LST."
+
+  (fold-right
+   (lambda (elem prev)
+           (if (pair? prev)
+               (cons  elem (cons intermediate prev))
+               (list elem)))
+         '() lst))
+
+(define-public (filtered-map proc lst)
+  (filter
+   (lambda (x) x)
+   (map proc lst)))
+
 
 (define (flatten-list lst)
   "Unnest LST" 
@@ -391,6 +408,13 @@ found."
 ;;
 
 
+(define-public (string-encode-integer i)
+  (cond
+   ((= i  0) "o")
+   ((< i 0)   (string-append "n" (string-encode-integer (- i))))
+   (else (string-append
+         (make-string 1 (integer->char (+ 65 (modulo i 26))))
+         (string-encode-integer (quotient i 26))))))
 
 (define-public (ly:numbers->string lst)
   (string-join (map ly:number->string lst) " "))
@@ -476,7 +500,6 @@ possibly turned off."
 
 (define-public (car< a b) (< (car a) (car b)))
 
-
 (define-public (symbol<? lst r)
   (string<? (symbol->string lst) (symbol->string r)))