]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/chord-generic-names.scm
Update.
[lilypond.git] / scm / chord-generic-names.scm
index fb9c1d3b10b6bfe9ae9d187038905d4434d508f7..fed4cdff6823dc42c21f0f71adae97548f6fa3a8 100644 (file)
@@ -1,4 +1,4 @@
-;;;; double-plus-new-chord-name.scm -- Compile chord names
+;;;; chord-generic-names.scm -- Compile chord names
 ;;;;
 ;;;;  source file of the GNU LilyPond music typesetter
 ;;;; 
@@ -57,13 +57,13 @@ input/test/dpncnt.ly).
     (ly:pitch-transpose pitch
                        (ly:make-pitch 0 2 (if (or (= (step-nr pitch) 3)
                                                   (= (step-nr pitch) 5))
-                                              -1 0))))
+                                              FLAT 0))))
 
   (define (step-alteration pitch)
     (let* ((diff (ly:pitch-diff (ly:make-pitch 0 0 0) (car pitches)))
           (normalized-pitch (ly:pitch-transpose pitch diff))
           (alteration (ly:pitch-alteration normalized-pitch)))
-      (if (= (step-nr pitch) 7) (+ alteration 1) alteration)))
+      (if (= (step-nr pitch) 7) (+ alteration SEMI-TONE) alteration)))
     
   (define (pitch-unalter pitch)
     (let ((alteration (step-alteration pitch)))
@@ -84,11 +84,11 @@ input/test/dpncnt.ly).
       (make-simple-markup (number->string (step-nr pitch)))
       (make-simple-markup
        (case (step-alteration pitch)
-        ((-2) "--")
-        ((-1) "-")
-        ((0) "")
-        ((1) "+")
-        ((2) "++"))))))
+        ((DOUBLE-FLAT) "--")
+        ((FLAT) "-")
+        ((NATURAL) "")
+        ((SHARP) "+")
+        ((DOUBLE-SHARP) "++"))))))
   
   (define (step->markup-accidental pitch)
     (make-line-markup
@@ -113,7 +113,7 @@ input/test/dpncnt.ly).
     (make-line-markup (list (make-simple-markup "no") (step->markup pitch))))
                         
   (define (get-full-list pitch)
-    (if (<= (step-nr pitch) (step-nr (tail pitches)))
+    (if (<= (step-nr pitch) (step-nr (last pitches)))
        (cons pitch (get-full-list (next-third pitch)))
        '()))
 
@@ -139,7 +139,7 @@ input/test/dpncnt.ly).
     (if (pair? exceptions)
        (let* ((e (car exceptions))
               (e-pitches (car e)))
-         (if (equal? e-pitches (first-n (length e-pitches) pitches))
+         (if (equal? e-pitches (take pitches (length e-pitches) ))
              e
              (partial-match (cdr exceptions))))
        #f))
@@ -165,15 +165,15 @@ input/test/dpncnt.ly).
         ;; kludge alert: replace partial matched lower part of all with
         ;; 'normal' pitches from full
         ;; (all pitches)
-        (all (append (first-n (length partial-pitches) full)
-                     (butfirst-n (length partial-pitches) pitches)))
+        (all (append (take full (length partial-pitches) )
+                     (drop pitches (length partial-pitches) )))
              
-        (highest (tail all))
+        (highest (last all))
         (missing (list-minus full (map pitch-unalter all)))
         (consecutive (get-consecutive 1 all))
         (rest (list-minus all consecutive))
-        (altered (filter-list step-even-or-altered? all))
-        (cons-alt (filter-list step-even-or-altered? consecutive))
+        (altered (filter step-even-or-altered? all))
+        (cons-alt (filter step-even-or-altered? consecutive))
         (base (list-minus consecutive altered)))
         
 
@@ -260,7 +260,7 @@ input/test/dpncnt.ly).
               
               ;; kludge alert: omit <= 5
               ;;(markup-join (map step->markup
-              ;;                        (cons (tail base) cons-alt)) sep)
+              ;;                        (cons (last base) cons-alt)) sep)
               
               ;; This fixes:
               ;;  c     C5       -> C
@@ -269,7 +269,7 @@ input/test/dpncnt.ly).
               ;;  c:6.9 C5 6add9 -> C6 add 9 (add?)
               ;;  ch = \chords { c c:2 c:3- c:6.9^7 }
               (markup-join (map step->markup
-                                (let ((tb (tail base)))
+                                (let ((tb (last base)))
                                   (if (> (step-nr tb) 5)
                                       (cons tb cons-alt)
                                       cons-alt))) sep)