((get-step 6 pitches) (set! main-name (get-step 6 pitches)))
((get-step 5 pitches) (set! main-name (get-step 5 pitches)))
((get-step 4 pitches) (set! main-name (get-step 4 pitches)))
- ((get-step 3 pitches) (set! main-name (get-step 3 pitches)))
- )
-
- (let*
- (
- (3-diff? (lambda (x y)
- (= (- (pitch-step y) (pitch-step x)) 2)))
- (split (split-at-predicate 3-diff? (remove-uptil-step 5 pitches)))
- )
+ ((get-step 3 pitches) (set! main-name (get-step 3 pitches))))
+
+ (let* ((3-diff? (lambda (x y)
+ (= (- (pitch-step y) (pitch-step x)) 2)))
+ (split (split-at-predicate
+ 3-diff? (remove-uptil-step 5 pitches))))
(set! alterations (append alterations (car split)))
(set! add-steps (append add-steps (cdr split)))
(set! alterations (delq main-name alterations))
(map is-natural-alteration? alterations)))
(begin
(set! main-name (last alterations))
- (set! alterations '())
- ))
-
- (ignatzek-format-chord-name root prefixes main-name alterations add-steps suffixes bass-note)
- )))
- ))
-
+ (set! alterations '())))
+ (ignatzek-format-chord-name
+ root prefixes main-name alterations add-steps suffixes bass-note))))))
(else
(set-car! acc (cons (car lst) (car acc)))
(set-cdr! acc (cdr lst))
- acc))
- (let* ((c (cons '() '())))
- (inner-split predicate lst c)
- (set-car! c (reverse! (car c)))
- c)))
+ acc)))
+
+ (let* ((c (cons '() '())))
+ (inner-split predicate lst c)
+ (set-car! c (reverse! (car c)))
+ c))
(define-public (split-list lst sep?)
- "(display (split-list '(a b c / d e f / g) (lambda (x) (equal? x '/))) )
+ "(display (split-list '(a b c / d e f / g) (lambda (x) (equal? x '/))) )
=>
((a b c) (d e f) (g))
"
- ;; " Emacs is broken
- (define (split-one sep? lst acc)
- "Split off the first parts before separator and return both parts."
- (if (null? lst)
- (cons acc '())
- (if (sep? (car lst))
- (cons acc (cdr lst))
- (split-one sep? (cdr lst) (cons (car lst) acc)))))
-
- (if (null? lst)
- '()
- (let* ((c (split-one sep? lst '())))
- (cons (reverse! (car c) '()) (split-list (cdr c) sep?)))))
+ ;; " Emacs is broken
+ (define (split-one sep? lst acc)
+ "Split off the first parts before separator and return both parts."
+ (if (null? lst)
+ (cons acc '())
+ (if (sep? (car lst))
+ (cons acc (cdr lst))
+ (split-one sep? (cdr lst) (cons (car lst) acc)))))
+
+ (if (null? lst)
+ '()
+ (let* ((c (split-one sep? lst '())))
+ (cons (reverse! (car c) '()) (split-list (cdr c) sep?)))))
(define-public (offset-add a b)
(cons (+ (car a) (car b))