"
(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."
(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)
; 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)
)
(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
)
(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))))