]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/chord-name.scm
release commit
[lilypond.git] / scm / chord-name.scm
index c15cb36ec5869d27d0fe16aae375d368ff9864b9..1bc5ba99ef24b0acf1295f8c33cc496f9572ad45 100644 (file)
 (define (natural-chord-alteration p)
   "Return the natural alteration for step P."
   (if (= (ly:pitch-steps p) 6)
-      -1
+      FLAT
       0))
 
 
+;; 
+;; TODO: make into markup.
+;; 
 (define-public (alteration->text-accidental-markup alteration)
   (make-smaller-markup
    (make-raise-markup
-    (if (= alteration -1)
+    (if (= alteration FLAT)
        0.3
        0.6)
     (make-musicglyph-markup
@@ -29,7 +32,7 @@
       (make-line-markup (list empty-markup))
       (conditional-kern-before
        (alteration->text-accidental-markup alteration)
-       (= alteration -1) 0.2
+       (= alteration FLAT) 0.2
        )))
 
 
@@ -49,7 +52,7 @@
 "
   (let* ((name (ly:pitch-notename pitch))
          (alt (ly:pitch-alteration pitch))
-        (n-a (if (member (cons name alt) '((6 . -1) (6 . -2)))
+        (n-a (if (member (cons name alt) `((6 . ,FLAT) (6 . ,DOUBLE-FLAT)))
                 (cons 7 (+ (if B-instead-of-Bb 1 0) alt))
                 (cons name alt))))
     (make-line-markup
 (define-public (note-name->german-markup  pitch)
   (let* ((name (ly:pitch-notename pitch))
         (alt (ly:pitch-alteration pitch))
-        (n-a (if (member (cons name alt) '((6 . -1) (6 . -2)))
-                 (cons 7 (+ 1 alt))
+        (n-a (if (member (cons name alt) `((6 . ,FLAT) (6 . ,DOUBLE-FLAT)))
+                 (cons 7 (+ SEMI-TONE alt))
                  (cons name alt))))
     (make-line-markup
      (list
       (string-append
-       (list-ref '("c" "d" "e" "f" "g" "a" "h" "b") (car n-a))
+       (list-ref '("c" "d" "e" "f" "g" "a" "h" "b")  (car n-a) )
        (if (or (equal? (car n-a) 2) (equal? (car n-a) 5))
-          (list-ref '( "ses"  "s" "" "is" "isis") (+ 2 (cdr n-a)))
-          (list-ref '("eses" "es" "" "is" "isis") (+ 2 (cdr n-a)))))))))
+          (list-ref '( "ses"  "s" "" "is" "isis") (+ 2 (/ (cdr n-a) 2) ))
+          (list-ref '("eses" "es" "" "is" "isis") (+ 2 (/ (cdr n-a) 2) ))
+          ))))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;
@@ -115,7 +119,7 @@ FOOBAR-MARKUP) if OMIT-ROOT is given and non-false.
   (define (is-req-chord? m)
     (and
      (memq 'event-chord (ly:get-mus-property m 'types))
-     (not (equal? (ly:make-moment 0 1) (ly:get-music-length m)))))
+     (not (equal? ZERO-MOMENT (ly:music-length m)))))
 
   (let* ((elts (filter is-req-chord? (ly:get-mus-property seq 'elements)))
         (alist (map chord-to-exception-entry elts)))