My goal is to engrave music for accordion and I would like to have my chords symbols as follows:

Bass tone: always uppercase: e.g. A E D

Chords: always lower case: e.g. major chords a e d; minor chords am em dm

And together: A am E e D d7

In Lilypond you can force the lowercase only for the minors: \set chordNameLowercaseMinor = ##t

But I would like to have this possibility for the majors, sevens etc. as well...The bass tone is always uppercase, which is fine.

  • You can probably achieve something by overriding chordRootNamer and chordNoteNamer. Can you create a small snippet to show how you want to encode it with lilypond ? – Olivier Samyn Nov 30 '16 at 12:59
  • Is this a standard chord format for accordian music? Lead sheets typically follow the guitar chord convention of using upper case for the primary note of the chord, followed by a combination of #, b (flat), m (minor), aug (augmented), maj (major), dim (diminished) etc, and then if an inversion is to be applied, a forward slash and the bass note. For example, D/F# would be first inversion of D, i.e. an F# bass tone with a D chord. This is easy to achieve in Lilypond as is the default behaviour for chords. – richhallstoke Jan 3 '17 at 16:57

(This was asked and answered elsewhere, but in case it helps any future visitors, I'll add their results.)

Fix #1

\version "2.19.58"

\layout {
  \context {
    chordNoteNamer = #note-name->markup
    chordRootNamer =
      #(lambda (pitch lowercase?) (note-name->markup pitch #t))

\new ChordNames \chordmode { c:7 c:m7 c:7/+c c:m7/+c } 

But this one has some problems with single bass pitch inputs, resulting in

Fix #2

\version "2.19.58"

#(define-public (my-note-name->german-markup pitch lowercase?)
  (let* ((name (ly:pitch-notename pitch))
         (alt-semitones (inexact->exact (round (* (ly:pitch-alteration
pitch) 2))))
         (n-a (if (member (cons name alt-semitones) `((6 . -1) (6 . -2)))
                  (cons 7 (+ 1 alt-semitones))
                  (cons name alt-semitones)))
         (basic-list '("c" "d" "e" "f" "g" "a" "h" "b"))
           (if lowercase?
               (map string-upcase basic-list))))

       (list-ref list-to-use (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)))))))))

\layout {
  \context {
    chordNameFunction =
      #(lambda (in-pitches bass inversion context)
        (if (= (length in-pitches) 1)
            (my-note-name->german-markup (car in-pitches) #f)
              in-pitches bass inversion context)))
    chordNoteNamer =
      #(lambda (pitch lowercase?)
      (my-note-name->german-markup pitch #f))
    chordRootNamer =
      #(lambda (pitch lowercase?)
      (my-note-name->german-markup pitch #t))

\new ChordNames \chordmode { cis:7 cis:m7 c:7/+c c:m7/+c <ces> cis:1 } 

This allows for single pitch inputs as <c> and c:1. Note that this latter example uses German notation, which one can adjust as necessary in the Scheme code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.