(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))
(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))
)
(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))
(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))
(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<?)))
(= 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
(write-me "bass: " bass)))
-
+
(if inversion
(make-chord (cdr complete-chord) bass duration (car complete-chord)
inversion)