]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/chord-entry.scm
* input/mutopia/F.Schubert/GNUmakefile: add morgenlied.ly
[lilypond.git] / scm / chord-entry.scm
index 3475ab122c2ec9e05b15a2f593f814633faa2eae..670ff646eb21a24c96947d41ae648a57e9f7510a 100644 (file)
@@ -14,16 +14,14 @@ Entry point for the parser.
 
 "
   (let*
-      (
-       (flat-mods (flatten-list modifications))
+      ((flat-mods (flatten-list modifications))
        (base-chord (stack-thirds (ly:make-pitch 0 4 0) the-canonical-chord))
        (complete-chord '())
        (bass #f)
        (inversion #f)
        (lead-mod #f)
        (explicit-11 #f)
-       (start-additions #t)
-       )
+       (start-additions #t))
 
     (define (interpret-inversion chord mods)
       "Read /FOO   part. Side effect: INVERSION is set."
@@ -67,6 +65,7 @@ Entry point for the parser.
     
     (define (interpret-additions  chord mods)
       "Interpret additions. TODO: should restrict modifier use?"
+      
       (cond
        ((null? mods) chord)
        ((ly:pitch? (car mods))
@@ -112,8 +111,8 @@ the bass specified.
                           (ly:pitch-alteration inversion))
                        )))
                 
-          (rest-of-chord (filter-out-list inv? complete-chord))
-          (inversion-candidates (filter-list inv? complete-chord))
+          (rest-of-chord (remove inv? complete-chord))
+          (inversion-candidates (filter inv? complete-chord))
           (down-inversion (pitch-octavated-strictly-below inversion root))
           )
 
@@ -149,6 +148,8 @@ the bass specified.
          (set! flat-mods (cdr flat-mods))
          ))
 
+    
+
     ;; extract first  number if present, and build pitch list.
     (if (and (pair? flat-mods)
             (ly:pitch?  (car flat-mods))
@@ -167,13 +168,12 @@ the bass specified.
     (if (procedure? lead-mod)
        (set! base-chord (lead-mod base-chord)))
 
-    
+
     (set! complete-chord
          (if start-additions
           (interpret-additions base-chord flat-mods)
           (interpret-removals base-chord flat-mods)
           ))
-
     
     (set! complete-chord (map (lambda (x) (ly:pitch-transpose x root))
                              (sort complete-chord ly:pitch<?)))
@@ -207,7 +207,7 @@ the bass specified.
          (write-me "bass: " bass)))
 
 
-    
+
     (if inversion
        (make-chord (cdr complete-chord) bass duration (car complete-chord)
                    inversion)
@@ -260,12 +260,12 @@ DURATION, and INVERSION."
 ; chord modifiers change the pitch list.
 
 (define (aug-modifier  pitches)
-  (set! pitches  (replace-step (ly:make-pitch 0 4 1) pitches))
+  (set! pitches  (replace-step (ly:make-pitch 0 4 SHARP) pitches))
   (replace-step (ly:make-pitch 0 2 0) pitches) 
   )
 
 (define (minor-modifier  pitches)
-  (replace-step (ly:make-pitch 0 2 -1) pitches)
+  (replace-step (ly:make-pitch 0 2 FLAT) pitches)
   )
 
 (define (maj7-modifier  pitches)
@@ -274,9 +274,9 @@ DURATION, and INVERSION."
   )
 
 (define (dim-modifier  pitches)
-  (set! pitches (replace-step (ly:make-pitch 0 2 -1) pitches))
-  (set! pitches (replace-step (ly:make-pitch 0 4 -1) pitches))
-  (set! pitches (replace-step (ly:make-pitch 0 6 -2) pitches))
+  (set! pitches (replace-step (ly:make-pitch 0 2 FLAT) pitches))
+  (set! pitches (replace-step (ly:make-pitch 0 4 FLAT) pitches))
+  (set! pitches (replace-step (ly:make-pitch 0 6 DOUBLE-FLAT) pitches))
   pitches
   )
 
@@ -299,7 +299,7 @@ DURATION, and INVERSION."
   (map
    (lambda (n)
      (define (nca x)
-       (if (= x 7) -1 0))
+       (if (= x 7) FLAT 0))
      (if (>= n 8)
         (ly:make-pitch 1 (- n 8) (nca n))
         (ly:make-pitch 0 (- n 1) (nca n))))