+2003-04-20 Rune Zedeler <rune@zedeler.dk>
+
+ * input/test/chord-names-german.ly: modified.
+
+ * scm/chords-ignatzek.scm:
+ chord-name->german-markup: Added
+ note-name->german-markup: Changed (now producing lowercase notenames)
+
+ * lily/chord-name-engraver.cc: Reads property chordNoteNamer
+
2003-04-20 Han-Wen Nienhuys <hanwen@cs.uu.nl>
* ly/german-chords-init.ly: remove file
alteration. The transformation from pitch to letter is done by this
function. An application of setting this function, is providing chord
names with german notation for the root.
-@end table
+@item chordNoteNamer
+The default is to print single notes (as for instance the bass note)
+using the chordRootNamer. However, by setting this function to a non-null
+value you can specify a different function. I.e. you could use letters
+in lower case for the base note.
+
+@end table
@seealso
dnl aclocal.m4 -*-shell-script-*-
-dnl WARNING WARNING WARNING
-dnl do not edit! this is aclocal.m4, generated from /home/hanwen/usr/src/lilypond/stepmake/aclocal.m4
-dnl aclocal.m4 -*-shell-script-*-
dnl StepMake subroutines for configure.in
-\version "1.7.16"
+\version "1.7.17"
\header {
texidoc = "By setting @code{ChordNames.chordRootNamer}, the root
}
-scm = \chords { c4 b bes }
+scm = \chords { c4/c cis/cis cisis/cisis ces/ces ceses/ceses b/b bis/bis bes/bes beses/beses }
\score {
-
< \context ChordNames \chords <
- \property ChordNames. chordRootNamer = #note-name->german-markup
+ % #t gives true german chord-names
+ % #f gives semi-german chord-names -
+ % - with Bb and below keeping the english names
+ \property ChordNames. chordRootNamer = #(chord-name->german-markup #f)
+ \property ChordNames. chordNoteNamer = #note-name->german-markup
\scm >
\context Voice \scm >
-\paper { raggedright = ##t }
}
/* accepts */ "note-event",
/* acks */ "",
/* reads */ "chordChanges chordNameExceptions chordNameFunction "
-"chordRootNamer chordNameExceptions majorSevenSymbol",
+"chordNoteNamer chordRootNamer chordNameExceptions majorSevenSymbol",
/* write */ "");
majorSevenSymbol = #whiteTriangleMarkup
chordNameSeparator = #(make-simple-markup "/")
chordNameExceptions = #ignatzekExceptions
+ chordNoteNamer = #'()
chordRootNamer = #note-name->markup
%% tablature:
(accidental->markup (ly:pitch-alteration pitch))))))
-(define-public (note-name->german-markup pitch)
- "Return pitch markup for PITCH, using german note names."
- (make-line-markup
- (list
- (make-simple-markup
- (vector-ref #("C" "D" "E" "F" "G" "A" "H") (ly:pitch-notename pitch)))
- (make-normal-size-super-markup
- (accidental->markup (ly:pitch-alteration pitch))))))
-
-
+(define-public ((chord-name->german-markup B-instead-of-Bb) pitch)
+ "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)
+"
+ (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))
+ (cons name alt))))
+ (make-line-markup
+ (list
+ (make-simple-markup
+ (vector-ref #("C" "D" "E" "F" "G" "A" "H" "B") (car n-a)))
+ (make-normal-size-super-markup
+ (accidental->markup (cdr n-a)))))))
+
+
+(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))
+ (cons name alt))))
+ (make-line-markup
+ (list
+ (string-append
+ (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)))))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
)
)
(define name-root (ly:get-context-property context 'chordRootNamer))
+ (define name-note
+ (let ((nn (ly:get-context-property context 'chordNoteNamer)))
+ (if (eq? nn '())
+ ; replacing the next line with name-root gives guile-error...? -rz
+ (ly:get-context-property context 'chordRootNamer)
+ nn)))
(define (is-natural-alteration? p)
(= (natural-chord-alteration p) (ly:pitch-alteration p))
suffixes
add-markups) sep))
(base-stuff (if bass-pitch
- (list sep (name-root bass-pitch))
+ (list sep (name-note bass-pitch))
'()))
)
(translator-property-description
'chordNameFunction procedure?
"The function that converts lists of pitches to chord names.")
+(translator-property-description
+ 'chordNoteNamer procedure?
+ "Function that converts from a pitch object to a text markup. Used for single pitches.")
(translator-property-description
'chordRootNamer procedure?
- "Function that converts from a pitch object to a text markup.")
+ "Function that converts from a pitch object to a text markup. Used for chords.")
(translator-property-description
'chordNameExceptions list?
"Alist of chord exceptions. Contains (CHORD . MARKUP) entries.")