]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/chord-ignatzek-names.scm
Run `make grand-replace'.
[lilypond.git] / scm / chord-ignatzek-names.scm
index a3c3aa1c8f1a33c2a7c6a648e1191a524e9984c4..25e9c1a07af4b5f11960ef8e717b518808fcb5ab 100644 (file)
@@ -1,9 +1,8 @@
-;;;
-;;; chord-ignatzek-names.scm --  chord name utility functions
-;;;
-;;; source file of the GNU LilyPond music typesetter
-;;; 
-;;; (c)  2000--2004  Han-Wen Nienhuys <hanwen@cs.uu.nl>
+;;;; chord-ignatzek-names.scm --  chord name utility functions
+;;;;
+;;;; source file of the GNU LilyPond music typesetter
+;;;; 
+;;;; (c) 2000--2008  Han-Wen Nienhuys <hanwen@xs4all.nl>
 
 
 
@@ -72,7 +71,7 @@
   (define name-note 
     (let ((nn (ly:context-property context 'chordNoteNamer)))
       (if (eq? nn '())
-                                       ; replacing the next line with name-root gives guile-error...? -rz
+         ;; replacing the next line with name-root gives guile-error...? -rz
 
          ;; apparently sequence of defines is equivalent to let, not let* ? -hwn
          (ly:context-property context 'chordRootNamer)   
@@ -80,8 +79,7 @@
          nn)))
 
   (define (is-natural-alteration? p)
-    (= (natural-chord-alteration p)  (ly:pitch-alteration p)))
-  
+    (= (natural-chord-alteration p) (ly:pitch-alteration p)))
   
   (define (ignatzek-format-chord-name
           root
@@ -157,32 +155,32 @@ work than classifying the pitches."
        
        (make-line-markup total)))
 
-    (let*
-       (
-        (sep (ly:context-property context 'chordNameSeparator))
-        (root-markup (name-root root))
-        (add-markups (map (lambda (x)
-                            (glue-word-to-step "add" x))
-                          addition-pitches))
-        (filtered-alterations (filter-alterations alteration-pitches))
-        (alterations (map name-step filtered-alterations))
-        (suffixes (map suffix-modifier->markup suffix-modifiers))
-        (prefixes (map prefix-modifier->markup prefix-modifiers))
-        (main-markups (filter-main-name main-name))
-        (to-be-raised-stuff (markup-join
-                             (append
-                              main-markups
-                              alterations
-                              suffixes
-                              add-markups) sep))
-        (base-stuff (if (ly:pitch? bass-pitch)
-                        (list sep (name-note bass-pitch))
-                        '())))
+    (let* ((sep (ly:context-property context 'chordNameSeparator))
+          (root-markup (name-root root))
+          (add-markups (map (lambda (x) (glue-word-to-step "add" x))
+                            addition-pitches))
+          (filtered-alterations (filter-alterations alteration-pitches))
+          (alterations (map name-step filtered-alterations))
+          (suffixes (map suffix-modifier->markup suffix-modifiers))
+          (prefixes (map prefix-modifier->markup prefix-modifiers))
+          (main-markups (filter-main-name main-name))
+          (to-be-raised-stuff (markup-join
+                               (append
+                                main-markups
+                                alterations
+                                suffixes
+                                add-markups) sep))
+          (base-stuff (if (ly:pitch? bass-pitch)
+                          (list sep (name-note bass-pitch))
+                          '())))
 
       (set! base-stuff
            (append
             (list root-markup
-                  (markup-join prefixes sep)
+                  (conditional-kern-before (markup-join prefixes sep)
+                                           (and (not (null? prefixes))
+                                                (= (ly:pitch-alteration root) NATURAL))
+                                           (ly:context-property context 'chordPrefixSpacer))
                   (make-super-markup to-be-raised-stuff))
             base-stuff))
       (make-line-markup base-stuff)))
@@ -217,12 +215,12 @@ work than classifying the pitches."
         (alterations '()))
     
     (if exception
-       (ignatzek-format-exception  root exception bass-note)
+       (ignatzek-format-exception root exception bass-note)
        
-       (begin                          ; no exception.
-         
-                                       ; handle sus4 and sus2 suffix: if there is a 3 together with
-                                       ; sus2 or sus4, then we explicitly say  add3.
+       (begin
+         ;; no exception.
+         ;; handle sus4 and sus2 suffix: if there is a 3 together with
+         ;; sus2 or sus4, then we explicitly say add3.
          (map
           (lambda (j)
             (if (get-step j pitches)
@@ -231,8 +229,8 @@ work than classifying the pitches."
                       (begin
                         (set! add-steps (cons (get-step 3 pitches) add-steps))
                         (set! pitches (remove-step 3 pitches))))
-                  (set! suffixes  (cons (get-step j pitches) suffixes))))
-            ) '(2 4) )
+                  (set! suffixes (cons (get-step j pitches) suffixes)))))
+          '(2 4))
 
          ;; do minor-3rd modifier.
          (if (and (get-step 3 pitches)