+ (text-append
+ (let ((step (step->text-jazz (car additions))))
+ (if (or (pair? (cdr additions))
+ (pair? subtractions))
+ (text-append step "/")
+ step))
+ (chord::additions->text-jazz (cdr additions) subtractions))
+ '()))
+
+(define (chord::>5? x)
+ (or (> (car x) 0)
+ (> (cadr x) 4)))
+
+
+;; FIXME:
+;; Perhaps all logic like this should be done earlier,
+;; so that in this text-construction printing phase
+;; we can just blindly create text from all additions.
+;;
+;; This depends maybe on the fact of code sharing,
+;; in this layout, we can share the functions chord::additions
+;; and chord::subtractions with banter.
+(define (chord::additions->text-jazz additions subtractions)
+ (text-append
+ (chord::additions<=5->text-jazz (filter-out-list chord::>5? additions)
+ (filter-out-list chord::>5? subtractions))
+ (chord::additions>5->text-jazz (filter-list chord::>5? additions)
+ (filter-list chord::>5? subtractions))))
+
+;; FIXME
+(define (chord::additions<=5->text-jazz additions subtractions)
+ (let ((sus (chord::sus-four-jazz additions)))
+ (if (pair? sus)
+ (text-append '("sus") (step->text-jazz (car sus)))
+ '())))
+
+(define (chord::additions>5->text-jazz additions subtractions)
+ "
+Compose text of all additions
+
+ * if there's a subtraction:
+ - add `add'
+ - list all up to highest
+ * list all steps that are below an chromatically altered step
+ "
+ (text-append
+ (if (not (empty? subtractions)) "add" '())
+ (let ((radds (reverse additions)))
+ (reverse (chord::additions>5->text-jazz-helper
+ radds
+ subtractions
+ (if (or (empty? subtractions) (empty? radds))
+ #f (car radds)))))))
+
+(define (chord::additions>5->text-jazz-helper additions subtractions list-step)
+ "
+Create texts for all additions
+If list-step != #f, list all steps down to 5
+If we encounter a chromatically altered step, turn on list-step
+"
+
+ (if list-step
+ (if (not (member list-step subtractions))
+ (if (> 5 (cadr list-step))
+ (cons (step->text-jazz list-step)
+ (chord::additions>5->text-jazz-helper
+ additions
+ subtractions
+ (chord::get-create-step additions
+ (- (cadr list-step) 2))))
+ (step->text-jazz list-step))
+ (chord::get-create-step additions (- (cadr list-step) 2)))
+ (if (pair? additions)
+ (let ((step (car additions)))
+ (cons (step->text-jazz step)
+ (chord::additions>5->text-jazz-helper
+ (cdr additions)
+ subtractions
+ (if (or (and (!= 6 (cadr step)) (!= 0 (caddr step)))
+ (and (= 6 (cadr step)) (!= -1 (caddr step))))
+ (chord::get-create-step additions (- (cadr step) 2))
+ #f))))
+ '())))