]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/chord-generic-names.scm
* scm/new-font.scm: new file. Tree based font lookup.
[lilypond.git] / scm / chord-generic-names.scm
index 8caaa4c8d0ea304f56c923a574e93f565be19c24..c51b8c7438fa399503f7f2d95f4befd35553ac9a 100644 (file)
@@ -1,8 +1,8 @@
-;;;; double-plus-new-chord-name.scm -- Compile chord names
+;;;; chord-generic-names.scm -- Compile chord names
 ;;;;
 ;;;;  source file of the GNU LilyPond music typesetter
 ;;;; 
-;;;; (c) 2003 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;; (c) 2003-2004 Jan Nieuwenhuizen <janneke@gnu.org>
 
 
 ;;;; NOTE: this is experimental code
@@ -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
@@ -99,7 +99,7 @@ input/test/dpncnt.ly).
     (make-line-markup
      (if (and (= (step-nr pitch) 7)
              (= (step-alteration pitch) 1))
-        (list (ly:get-context-property context 'majorSevenSymbol))
+        (list (ly:context-property context 'majorSevenSymbol))
         (list (accidental->markup (step-alteration pitch))
               (make-simple-markup (number->string (step-nr pitch)))))))
         
@@ -147,11 +147,11 @@ input/test/dpncnt.ly).
   (if #f (begin  
           (write-me "pitches: " pitches)))
   (let* ((full-exceptions
-         (ly:get-context-property context 'chordNameExceptionsFull))
+         (ly:context-property context 'chordNameExceptionsFull))
         (full-exception (full-match full-exceptions))
         (full-markup (if full-exception (cadr full-exception) '()))
         (partial-exceptions
-         (ly:get-context-property context 'chordNameExceptionsPartial))
+         (ly:context-property context 'chordNameExceptionsPartial))
         (partial-exception (partial-match partial-exceptions))
         (partial-pitches (if partial-exception (car partial-exception) '()))
         (partial-markup-prefix
@@ -196,15 +196,15 @@ input/test/dpncnt.ly).
        ;;    + steps:altered + (highest all -- if not altered)
        ;;    + subs:missing
        
-       (let* ((root->markup (assoc-get-default
+       (let* ((root->markup (assoc-get
                              'root->markup options note-name->markup))
-             (step->markup (assoc-get-default
+             (step->markup (assoc-get
                             'step->markup options step->markup-plusminus))
-             (sub->markup (assoc-get-default
+             (sub->markup (assoc-get
                            'sub->markup options
                            (lambda (x)
                              (step-based-sub->markup step->markup x))))
-             (sep (assoc-get-default
+             (sep (assoc-get
                    'separator options (make-simple-markup "/"))))
         
         (if
@@ -234,16 +234,16 @@ input/test/dpncnt.ly).
        ;;    + steps:(highest base) + cons-alt
        ;;    + 'add'
        ;;    + steps:rest
-       (let* ((root->markup (assoc-get-default
+       (let* ((root->markup (assoc-get
                              'root->markup options note-name->markup))
              (step->markup
-              (assoc-get-default
+              (assoc-get
                ;; FIXME: ignatzek
                ;;'step->markup options step->markup-accidental))
                'step->markup options step->markup-ignatzek))
-             (sep (assoc-get-default
+             (sep (assoc-get
                    'separator options (make-simple-markup " ")))
-             (add-prefix (assoc-get-default 'add-prefix options
+             (add-prefix (assoc-get 'add-prefix options
                                             (make-simple-markup " add"))))
         
         (if