-;;;; double-plus-new-chord-name.scm -- Compile chord names
+;;;; chord-generic-names.scm -- Compile chord names
;;;;
;;;; source file of the GNU LilyPond music typesetter
;;;;
(ly:pitch-transpose pitch
(ly:make-pitch 0 2 (if (or (= (step-nr pitch) 3)
(= (step-nr pitch) 5))
- -1 0))))
+ FLAT 0))))
(define (step-alteration pitch)
(let* ((diff (ly:pitch-diff (ly:make-pitch 0 0 0) (car pitches)))
(normalized-pitch (ly:pitch-transpose pitch diff))
(alteration (ly:pitch-alteration normalized-pitch)))
- (if (= (step-nr pitch) 7) (+ alteration 1) alteration)))
+ (if (= (step-nr pitch) 7) (+ alteration SEMI-TONE) alteration)))
(define (pitch-unalter pitch)
(let ((alteration (step-alteration pitch)))
(make-simple-markup (number->string (step-nr pitch)))
(make-simple-markup
(case (step-alteration pitch)
- ((-2) "--")
- ((-1) "-")
- ((0) "")
- ((1) "+")
- ((2) "++"))))))
+ ((DOUBLE-FLAT) "--")
+ ((FLAT) "-")
+ ((NATURAL) "")
+ ((SHARP) "+")
+ ((DOUBLE-SHARP) "++"))))))
(define (step->markup-accidental pitch)
(make-line-markup
(make-line-markup (list (make-simple-markup "no") (step->markup pitch))))
(define (get-full-list pitch)
- (if (<= (step-nr pitch) (step-nr (tail pitches)))
+ (if (<= (step-nr pitch) (step-nr (last pitches)))
(cons pitch (get-full-list (next-third pitch)))
'()))
(if (pair? exceptions)
(let* ((e (car exceptions))
(e-pitches (car e)))
- (if (equal? e-pitches (first-n (length e-pitches) pitches))
+ (if (equal? e-pitches (take pitches (length e-pitches) ))
e
(partial-match (cdr exceptions))))
#f))
;; kludge alert: replace partial matched lower part of all with
;; 'normal' pitches from full
;; (all pitches)
- (all (append (first-n (length partial-pitches) full)
- (butfirst-n (length partial-pitches) pitches)))
+ (all (append (take full (length partial-pitches) )
+ (drop pitches (length partial-pitches) )))
- (highest (tail all))
+ (highest (last all))
(missing (list-minus full (map pitch-unalter all)))
(consecutive (get-consecutive 1 all))
(rest (list-minus all consecutive))
- (altered (filter-list step-even-or-altered? all))
- (cons-alt (filter-list step-even-or-altered? consecutive))
+ (altered (filter step-even-or-altered? all))
+ (cons-alt (filter step-even-or-altered? consecutive))
(base (list-minus consecutive altered)))
;; kludge alert: omit <= 5
;;(markup-join (map step->markup
- ;; (cons (tail base) cons-alt)) sep)
+ ;; (cons (last base) cons-alt)) sep)
;; This fixes:
;; c C5 -> C
;; c:6.9 C5 6add9 -> C6 add 9 (add?)
;; ch = \chords { c c:2 c:3- c:6.9^7 }
(markup-join (map step->markup
- (let ((tb (tail base)))
+ (let ((tb (last base)))
(if (> (step-nr tb) 5)
(cons tb cons-alt)
cons-alt))) sep)