2

Suppose I have one melody line that is repeated (e.g., singing multiple verses), but the chords should be different the second and third times through. I want these to be defined in their own variables in LilyPond:

melody = \relative c' { ... }
chords_a = \chordmode { ... }
chords_b = \chordmode { ... }
chords_c = \chordmode { ... }

Now, with multiple ChordNames contexts, that can use a lot of vertical space:

\score { <<
  \new ChordNames \chords_a
  \new ChordNames \chords_b
  \new ChordNames \chords_c
  \new Staff \melody
>> }

ChordNames, stacked on top of each other

What I'm looking to do instead is something like this:

ChordNames, stacked side-by-side

I am able to do this part of the way:

\score { <<
   \new ChordNames \chords_a
   \new ChordNames \with {
     \override ChordName.font-size
     \override ChordName.X-offset
     \override ChordName.Y-offset
   } \chords_b
   \new ChordNames ...
>> }

ChordNames, moved somewhat

(Modifying the VerticalAxisGroup, instead, might be the key here.)

I was able to achieve it more fully, however, by using a Lyrics context instead of ChordNames and manually entering the chord properties as markup (code simplified here):

chord_kludge_a = \lyricmode {
  \markup {
    C
    \column {
      B♭
      D
    }
  }1
}
chord_kludge_b = ...
chord_kludge_c = ...

chord_kludge_collection = {
  \chord_kludge_a 
  \chord_kludge_b
  \chord_kludge_c
}

\score { <<
  \new Lyrics \chord_kludge_collection
  \new Staff \melody
>> }

Lyrics and melody

But in doing so, it (1) is manually laborious, and (2) lacks the flexibility of regular ChordName functions, like transpositions and alternative chords (e.g., redefining all augmented chords to read aug rather than +).

Is there any possible way to keep all the chords in their own variables, yet display them in a single context, where one is normal-sized on the left, and two more are smaller and stacked, one on top of the other, on the right? I believe the closest way to do it is by modifying the VerticalAxisGroup, but my knowledge of its properties and keys is limited mostly to guessing and trial-and-error. (Moreover, if Scheme is involved, my knowledge of it, too, is even more scant.)

2
  • Oh, so the context you're using them in is not showing the transposing instrument versions of chords?
    – Dekkadeci
    Aug 26 '21 at 11:50
  • @Dekkadeci - Correct. Those were really just dummy chords I used, specifically to include flats, sharps, minor, and slash.
    – Neal
    Aug 26 '21 at 11:57

Your Answer

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

Browse other questions tagged or ask your own question.