Hi,

On Wed, 29 Nov 2006, Philip Chinery wrote:

> > Have you tried \germanChords?
> 
> Yes, I have, but it only changes B to H and such things, but our Goal ist to
> display "Am" as "a" while "A" remains "A".

Correct. And you cannot just override chordRootNamer, since that function 
is only passed a single pitch (not enough information).

Attached is my attempt at it. It is dirt simple, in that it only displays 
alower case letter for minor chords, and an upper case letter for all 
others. No triangles, numbers or symbols. But it's a start...

Ciao,
Dscho


\version "2.10.0"
\header {

texidoc = "Demonstrate German chord names"

}

chs =  \transpose c' c' 
{
        <c e g>1
        <c es g>% m = minor triad
        <c e gis>
        <c es ges> \break
\transpose c' d' {
        <c e g bes>
        <c es g bes>
        <c e g b>               % triangle = maj
        <c es ges beses> 
}
        <c es ges b> \break
\transpose c' es' {
        <c e gis bes>
        <c es g b>
}
        <c e gis b> 
        <c es ges bes>\break
        <c e g a>   % 6 = major triad with added sixth
        <c es g a>  % m6 = minor triad with added sixth
        <c e g bes d'> 
        <c es g bes d'> \break
        <c es g bes d' f' a' >
        <c es g bes d' f' >
        <c es ges bes d' > 
        <c e g bes des' > \break
        <c e g bes dis'>
        <c e g bes d' f'>
        <c e g bes d' fis'>
        <c e g bes d' f' a'>\break
        <c e g bes d' fis' as'>
        <c e gis bes dis'>
        <c e g bes dis' fis'>
        <c e g bes d' f' as'>\break
        <c e g bes des' f' as'>
        <c e g bes d' fis'>
        <c e g b d'>
        <c e g bes d' f' as'>\break
        <c e g bes des' f' as'>
        <c e g bes des' f' a'>
        <c e g b d'>
        <c e g b d' f' a'>\break
        <c e g b d' fis'>
        <c e g bes des' f ' a'>
        <c f g>
        <c f g bes>\break
        <c f g bes d'>
        <c e g d'>      % add9
        <c es g f'>
}

#(define (simple-german-chord-name pitches bass inversion context)
  "Return simple chord markup for PITCH, using german note names.
Use lower case for minor, otherwise upper case. Does not do any fancy
sub or superscripts.
"
  (let* ((pitch (car pitches))
         (pitch2 (cadr pitches))
         (diff (if (null? pitch2) (ly:make-pitch 0 0 0)
                (ly:pitch-diff pitch2 pitch)))
         (minor? (and (= (ly:pitch-notename diff) 2)
                  (= (ly:pitch-alteration diff) -2)))
         (name (ly:pitch-notename pitch))
         (short-alt? (or (= name 2) (= name 5)))
         (alt (ly:pitch-alteration pitch))
         (n-a (if (member (cons name alt) `((6 . ,FLAT) (6 . ,DOUBLE-FLAT)))
                 (cons 7 (+ SEMI-TONE alt))
                 (cons name alt))))
   (markup #:line
    ((string-append
      (vector-ref
       (if minor?
        #("c" "d" "e" "f" "g" "a" "h" "b")
        #("C" "D" "E" "F" "G" "A" "H" "B"))
       (car n-a))
      (list-ref
       (if short-alt?
        '("ses" "s" "" "is" "isis")
        '("eses" "es" "" "is" "isis"))
       (+ 2 (/ alt 2))))))))

germanChordProperties = \sequential { 
    \set chordNameFunction = #simple-german-chord-name
}

\score{
    <<
        \new ChordNames {
            \set instrumentName = #"Ignatzek (default)"
            \set shortInstrumentName = #"Def"
            \chs
        }
        
        \new ChordNames {
            \germanChordProperties
            \set instrumentName = #"Deutsch"
            \set shortInstrumentName = #"dt"
            \chs
        }

        \new Staff  \transpose c c' { \chs }
    >>
    \layout {
        indent = 3.\cm
        \context { 
            \ChordNames
            \consists Instrument_name_engraver
        }
    }
}

_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to