]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/chord-entry.scm
(music_property_def): oops. SCM_UNDEFINED
[lilypond.git] / scm / chord-entry.scm
index 7c9bbfe8398faa0430e2f66dfd69aec63b2995f2..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,10 +65,11 @@ 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))
-       (if (= (ly:pitch-steps (car mods)) 11)
+       (if (= (pitch-step (car mods)) 11)
            (set! explicit-11 #t))
        (interpret-additions
         (cons (car mods) (remove-step (pitch-step (car mods)) chord))
@@ -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))
@@ -157,7 +158,7 @@ the bass specified.
        
        (begin
          (if (=  (pitch-step (car flat-mods)) 11)
-             (set! explicit-11  #t))
+             (set! explicit-11 #t))
          (set! base-chord
                (stack-thirds (car flat-mods) the-canonical-chord))
          (set! flat-mods (cdr 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<?)))
@@ -186,8 +186,10 @@ the bass specified.
             (= 0 (ly:pitch-alteration (get-step 11 complete-chord)))
             (= 0 (ly:pitch-alteration (get-step 3 complete-chord)))
             )
-            
-       (set! complete-chord (remove-step 11  complete-chord))
+       (begin
+         (set! complete-chord (remove-step 11  complete-chord))
+         )
+         
        )
 
     (if inversion
@@ -205,7 +207,7 @@ the bass specified.
          (write-me "bass: " bass)))
 
 
-    
+
     (if inversion
        (make-chord (cdr complete-chord) bass duration (car complete-chord)
                    inversion)
@@ -258,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)
@@ -272,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
   )
 
@@ -297,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))))