alteration-pitches
addition-pitches
suffix-modifiers
- bass-pitch)
+ bass-pitch
+ lowercase-root?)
"Format for the given (lists of) pitches. This is actually more
work than classifying the pitches."
(define (prefix-modifier->markup mod)
(if (and (= 3 (pitch-step mod))
(= FLAT (ly:pitch-alteration mod)))
- (make-simple-markup "m")
+ (make-simple-markup (if lowercase-root? "" "m"))
(make-simple-markup "huh")))
(define (filter-alterations alters)
(make-line-markup total)))
(let* ((sep (ly:context-property context 'chordNameSeparator))
- (root-markup (name-root root))
+ (root-markup (name-root root lowercase-root?))
(add-markups (map (lambda (x) (glue-word-to-step "add" x))
addition-pitches))
(filtered-alterations (filter-alterations alteration-pitches))
(define (ignatzek-format-exception
root
exception-markup
- bass-pitch)
+ bass-pitch
+ lowercase-root?)
(make-line-markup
`(
- ,(name-root root)
+ ,(name-root root lowercase-root?)
,exception-markup
.
,(if (ly:pitch? bass-pitch)
(list (ly:context-property context 'chordNameSeparator)
- (name-note bass-pitch))
+ (name-note bass-pitch #f))
'()))))
(let* ((root (car in-pitches))
(pitches (map (lambda (x) (ly:pitch-diff x root)) (cdr in-pitches)))
+ (lowercase-root?
+ (and (ly:context-property context 'chordNameLowercaseMinor)
+ (let ((third (get-step 3 pitches)))
+ (and third (= (ly:pitch-alteration third) FLAT)))))
(exceptions (ly:context-property context 'chordNameExceptions))
(exception (assoc-get pitches exceptions))
(prefixes '())
(alterations '()))
(if exception
- (ignatzek-format-exception root exception bass-note)
+ (ignatzek-format-exception root exception bass-note lowercase-root?)
(begin
;; no exception.
(set! alterations '())))
(ignatzek-format-chord-name
- root prefixes main-name alterations add-steps suffixes bass-note))))))
+ root prefixes main-name alterations add-steps suffixes bass-note
+ lowercase-root?))))))
FLAT
0))
-;;
+(define (conditional-string-downcase str condition)
+ (if condition
+ (string-downcase str)
+ str))
+
+;;
;; TODO: make into markup.
-;;
+;;
(define-public (alteration->text-accidental-markup alteration)
-
+
(make-smaller-markup
(make-raise-markup
(if (= alteration FLAT)
0.6)
(make-musicglyph-markup
(assoc-get alteration standard-alteration-glyph-name-alist "")))))
-
+
(define (accidental->markup alteration)
"Return accidental markup for ALTERATION."
(if (= alteration 0)
(make-hspace-markup (if (= alteration SHARP) 0.2 0.1))
))))
-(define-public (note-name->markup pitch)
+(define-public (note-name->markup pitch lowercase?)
"Return pitch markup for PITCH."
(make-line-markup
(list
(make-simple-markup
- (vector-ref #("C" "D" "E" "F" "G" "A" "B") (ly:pitch-notename pitch)))
- (accidental->markup (ly:pitch-alteration pitch)))))
+ (conditional-string-downcase
+ (vector-ref #("C" "D" "E" "F" "G" "A" "B") (ly:pitch-notename pitch))
+ lowercase?))
+ (accidental->markup (ly:pitch-alteration pitch)))))
(define (pitch-alteration-semitones pitch)
(inexact->exact (round (* (ly:pitch-alteration pitch) 2))))
-(define-safe-public ((chord-name->german-markup B-instead-of-Bb) pitch)
+(define-safe-public ((chord-name->german-markup B-instead-of-Bb)
+ pitch lowercase?)
"Return pitch markup for PITCH, using german note names.
If B-instead-of-Bb is set to #t real german names are returned.
Otherwise semi-german names (with Bb and below keeping the british names)
(make-line-markup
(list
(make-simple-markup
- (vector-ref #("C" "D" "E" "F" "G" "A" "H" "B") (car n-a)))
+ (conditional-string-downcase
+ (vector-ref #("C" "D" "E" "F" "G" "A" "H" "B") (car n-a))
+ lowercase?))
(make-normal-size-super-markup
(accidental->markup (/ (cdr n-a) 2)))))))
-(define-safe-public (note-name->german-markup pitch)
+(define-safe-public (note-name->german-markup pitch lowercase?)
(let* ((name (ly:pitch-notename pitch))
(alt-semitones (pitch-alteration-semitones pitch))
(n-a (if (member (cons name alt-semitones) `((6 . -1) (6 . -2)))
(list-ref '( "ses" "s" "" "is" "isis") (+ 2 (cdr n-a)))
(list-ref '("eses" "es" "" "is" "isis") (+ 2 (cdr n-a)))))))))
-(define-public ((chord-name->italian-markup re-with-eacute) pitch)
+(define-public ((chord-name->italian-markup re-with-eacute) pitch lowercase?)
"Return pitch markup for PITCH, using italian/french note names.
If re-with-eacute is set to #t, french 'ré' is returned for D instead of 're'
"
(make-line-markup
(list
(make-simple-markup
- (vector-ref
- (if re-with-eacute
- #("Do" "Ré" "Mi" "Fa" "Sol" "La" "Si")
- #("Do" "Re" "Mi" "Fa" "Sol" "La" "Si"))
- name))
+ (conditional-string-downcase
+ (vector-ref
+ (if re-with-eacute
+ #("Do" "Ré" "Mi" "Fa" "Sol" "La" "Si")
+ #("Do" "Re" "Mi" "Fa" "Sol" "La" "Si"))
+ name)
+ lowercase?))
(accidental->markup-italian alt)
))))
elts)))
(sorted (sort pitches ly:pitch<?))
(root (car sorted))
-
+
;; ugh?
;;(diff (ly:pitch-diff root (ly:make-pitch -1 0 0)))
;; FIXME. This results in #<Pitch c> ...,