;;;; This file is part of LilyPond, the GNU music typesetter.
;;;;
-;;;; Copyright (C) 2004--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>
+;;;; Copyright (C) 2004--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
;;;;
;;;; LilyPond is free software: you can redistribute it and/or modify
;;;; it under the terms of the GNU General Public License as published by
(inversion #f)
(lead-mod #f)
(explicit-11 #f)
+ (explicit-2/4 #f)
(start-additions #t))
(define (interpret-inversion chord mods)
"Interpret additions. TODO: should restrict modifier use?"
(cond ((null? mods) chord)
((ly:pitch? (car mods))
- (if (= (pitch-step (car mods)) 11)
- (set! explicit-11 #t))
+ (case (pitch-step (car mods))
+ ((11) (set! explicit-11 #t))
+ ((2 4) (set! explicit-2/4 #t)))
(interpret-additions (cons (car mods) (remove-step (pitch-step (car mods)) chord))
(cdr mods)))
((procedure? (car mods))
(if start-additions
(interpret-additions base-chord flat-mods)
(interpret-removals base-chord flat-mods)))
+ ;; if sus has been given neither 2 or 4, we add 4.
+ (if (and (eq? lead-mod sus-modifier)
+ (not explicit-2/4))
+ (set! complete-chord (cons (ly:make-pitch 0 4 0) complete-chord)))
(set! complete-chord (sort complete-chord ly:pitch<?))
;; If natural 11 + natural 3 is present, but not given explicitly,
;; we remove the 11.