X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fchord-name.scm;h=7986ba5c1c33c16b6c2f9d5731cd40a577d51eb2;hb=22ec58a860e744f90ab8900ab00576e5d1a78d16;hp=3e5c9f0ea7c908da8f5d5b8a09e0288e7574a474;hpb=d84e3d676a91ba1cb617c2467c5775f93fd48a32;p=lilypond.git diff --git a/scm/chord-name.scm b/scm/chord-name.scm index 3e5c9f0ea7..7986ba5c1c 100644 --- a/scm/chord-name.scm +++ b/scm/chord-name.scm @@ -3,21 +3,24 @@ ;;; ;;; source file of the GNU LilyPond music typesetter ;;; -;;; (c) 2000--2003 Jan Nieuwenhuizen +;;; (c) 2000--2004 Jan Nieuwenhuizen ;;; ;;; Han-Wen Nienhuys (define (natural-chord-alteration p) "Return the natural alteration for step P." (if (= (ly:pitch-steps p) 6) - -1 + FLAT 0)) +;; +;; TODO: make into markup. +;; (define-public (alteration->text-accidental-markup alteration) (make-smaller-markup (make-raise-markup - (if (= alteration -1) + (if (= alteration FLAT) 0.3 0.6) (make-musicglyph-markup @@ -29,7 +32,7 @@ (make-line-markup (list empty-markup)) (conditional-kern-before (alteration->text-accidental-markup alteration) - (= alteration -1) 0.2 + (= alteration FLAT) 0.2 ))) @@ -49,8 +52,8 @@ " (let* ((name (ly:pitch-notename pitch)) (alt (ly:pitch-alteration pitch)) - (n-a (if (member (cons name alt) '((6 . -1) (6 . -2))) - (cons 7 (+ (if B-instead-of-Bb 1 0) alt)) + (n-a (if (member (cons name alt) `((6 . ,FLAT) (6 . ,DOUBLE-FLAT))) + (cons 7 (+ (if B-instead-of-Bb SEMI-TONE 0) alt)) (cons name alt)))) (make-line-markup (list @@ -63,16 +66,17 @@ (define-public (note-name->german-markup pitch) (let* ((name (ly:pitch-notename pitch)) (alt (ly:pitch-alteration pitch)) - (n-a (if (member (cons name alt) '((6 . -1) (6 . -2))) - (cons 7 (+ 1 alt)) + (n-a (if (member (cons name alt) `((6 . ,FLAT) (6 . ,DOUBLE-FLAT))) + (cons 7 (+ SEMI-TONE alt)) (cons name alt)))) (make-line-markup (list (string-append - (list-ref '("c" "d" "e" "f" "g" "a" "h" "b") (car n-a)) + (list-ref '("c" "d" "e" "f" "g" "a" "h" "b") (car n-a) ) (if (or (equal? (car n-a) 2) (equal? (car n-a) 5)) - (list-ref '( "ses" "s" "" "is" "isis") (+ 2 (cdr n-a))) - (list-ref '("eses" "es" "" "is" "isis") (+ 2 (cdr n-a))))))))) + (list-ref '( "ses" "s" "" "is" "isis") (+ 2 (/ (cdr n-a) 2) )) + (list-ref '("eses" "es" "" "is" "isis") (+ 2 (/ (cdr n-a) 2) )) + )))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; @@ -80,18 +84,18 @@ ;; fixme we should standardize on omit-root (or the other one.) ;; perhaps the default should also be reversed --hwn (define-public (sequential-music-to-chord-exceptions seq . rest) - "Transform sequential music SEQ of type <>-\markup{ foobar } + "Transform sequential music SEQ of type <>-\\markup{ foobar } to (cons CDE-PITCHES FOOBAR-MARKUP), or to (cons DE-PITCHES FOOBAR-MARKUP) if OMIT-ROOT is given and non-false. " (define (chord-to-exception-entry m) - (let* ((elts (ly:get-mus-property m 'elements)) + (let* ((elts (ly:music-property m 'elements)) (omit-root (and (pair? rest) (car rest))) - (pitches (map (lambda (x) (ly:get-mus-property x 'pitch)) - (filter-list + (pitches (map (lambda (x) (ly:music-property x 'pitch)) + (filter (lambda (y) (memq 'note-event - (ly:get-mus-property y 'types))) + (ly:music-property y 'types))) elts))) (sorted (sort pitches ly:pitch