X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fchord-entry.scm;h=1d41c973e80330876afc9de25d5e090e4bc223ef;hb=76efdcf765d2189ee79e390bf51cbb8fca3fb489;hp=6351db1a13a0eb52b3e633f37af5657aa65ab985;hpb=a57c72d1461560a1d06212808ad10fd63e5ef4d4;p=lilypond.git diff --git a/scm/chord-entry.scm b/scm/chord-entry.scm index 6351db1a13..1d41c973e8 100644 --- a/scm/chord-entry.scm +++ b/scm/chord-entry.scm @@ -33,6 +33,7 @@ Entry point for the parser." (lead-mod #f) (explicit-11 #f) (explicit-2/4 #f) + (omit-3 #f) (start-additions #t)) (define (interpret-inversion chord mods) @@ -50,7 +51,8 @@ Entry point for the parser." (set! bass (cadr mods)) (set! mods (cddr mods)))) (if (pair? mods) - (ly:warning (_ "Spurious garbage following chord: ~A") mods)) + (ly:parser-error + (format #f (_ "Spurious garbage following chord: ~A") mods))) chord) (define (interpret-removals chord mods) @@ -69,7 +71,8 @@ Entry point for the parser." ((ly:pitch? (car mods)) (case (pitch-step (car mods)) ((11) (set! explicit-11 #t)) - ((2 4) (set! explicit-2/4 #t))) + ((2 4) (set! explicit-2/4 #t)) + ((3) (set! omit-3 #f))) (interpret-additions (cons (car mods) (remove-step (pitch-step (car mods)) chord)) (cdr mods))) ((procedure? (car mods)) @@ -131,8 +134,10 @@ the bass specified. (ly:pitch? (car flat-mods)) (not (eq? lead-mod sus-modifier))) (begin - (if (= (pitch-step (car flat-mods)) 11) - (set! explicit-11 #t)) + (cond ((= (pitch-step (car flat-mods)) 11) + (set! explicit-11 #t)) + ((equal? (ly:make-pitch 0 4 0) (car flat-mods)) + (set! omit-3 #t))) (set! base-chord (stack-thirds (car flat-mods) the-canonical-chord)) (set! flat-mods (cdr flat-mods)))) @@ -156,6 +161,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))) + ;; if omit-3 has been set (and not reset by an explicit 3 + ;; somewhere), we remove the 3 + (if omit-3 + (set! complete-chord (remove-step 3 complete-chord))) ;; must do before processing inversion/bass, since they are ;; not relative to the root. (set! complete-chord (map (lambda (x) (ly:pitch-transpose x root))