]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/chord-name.scm
* Documentation/user/notation.itely: fixed 2 typos
[lilypond.git] / scm / chord-name.scm
index f910d38df022c3898698d25aee1186ac9a8f350f..7986ba5c1c33c16b6c2f9d5731cd40a577d51eb2 100644 (file)
@@ -3,14 +3,14 @@
 ;;;
 ;;; source file of the GNU LilyPond music typesetter
 ;;; 
-;;; (c)  2000--2003 Jan Nieuwenhuizen <janneke@gnu.org>
+;;; (c)  2000--2004 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; Han-Wen Nienhuys <hanwen@cs.uu.nl>
 
 (define (natural-chord-alteration p)
   "Return the natural alteration for step P."
   (if (= (ly:pitch-steps p) 6)
-      -1
+      FLAT
       0))
 
 
@@ -20,7 +20,7 @@
 (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
@@ -53,7 +53,7 @@
   (let* ((name (ly:pitch-notename pitch))
          (alt (ly:pitch-alteration pitch))
         (n-a (if (member (cons name alt) `((6 . ,FLAT) (6 . ,DOUBLE-FLAT)))
-                (cons 7 (+ (if B-instead-of-Bb 1 0) alt))
+                (cons 7 (+ (if B-instead-of-Bb SEMI-TONE 0) alt))
                 (cons name alt))))
     (make-line-markup
      (list
 ;; fixme we should standardize on omit-root (or the other one.)
 ;; perhaps the  default should also be reversed --hwn
 (define-public (sequential-music-to-chord-exceptions seq . rest)
-  "Transform sequential music SEQ of type <<c d e>>-\markup{ foobar }
+  "Transform sequential music SEQ of type <<c d e>>-\\markup{ foobar }
 to (cons CDE-PITCHES FOOBAR-MARKUP), or to (cons DE-PITCHES
 FOOBAR-MARKUP) if OMIT-ROOT is given and non-false.
 "
 
   (define (chord-to-exception-entry m)
-    (let* ((elts (ly:get-mus-property m 'elements))
+    (let* ((elts (ly:music-property m 'elements))
           (omit-root (and (pair? rest) (car rest)))
-          (pitches (map (lambda (x) (ly:get-mus-property x 'pitch))
+          (pitches (map (lambda (x) (ly:music-property x 'pitch))
                         (filter
                          (lambda (y) (memq 'note-event
-                                           (ly:get-mus-property y 'types)))
+                                           (ly:music-property y 'types)))
                          elts)))
           (sorted (sort pitches ly:pitch<?))
           (root (car sorted))
@@ -107,10 +107,10 @@ FOOBAR-MARKUP) if OMIT-ROOT is given and non-false.
           ;; \chords has changed to c' too?
           (diff (ly:pitch-diff root (ly:make-pitch 0 0 0)))
           (normalized (map (lambda (x) (ly:pitch-diff x diff)) sorted))
-          (texts (map (lambda (x) (ly:get-mus-property x 'text))
+          (texts (map (lambda (x) (ly:music-property x 'text))
                       (filter
                        (lambda (y) (memq 'text-script-event
-                                         (ly:get-mus-property y 'types)))
+                                         (ly:music-property y 'types)))
                        elts)))
 
           (text (if (null? texts) #f (if omit-root (car texts) texts))))
@@ -118,10 +118,10 @@ 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)))))
+     (memq 'event-chord (ly:music-property m 'types))
+     (not (equal? ZERO-MOMENT (ly:music-length m)))))
 
-  (let* ((elts (filter is-req-chord? (ly:get-mus-property seq 'elements)))
+  (let* ((elts (filter is-req-chord? (ly:music-property seq 'elements)))
         (alist (map chord-to-exception-entry elts)))
     (filter (lambda (x) (cdr x)) alist)))