2

I have created the following Lilypond code:

% one octave above middle c
song = {
  \relative c'' {
    \time 4/4
    \tempo 4 = 66
    c c d e
    f1
    f4 f c d
    e1 | \break
    e4 e f e
    d e d2
    c4 d c a
    g1 | \break
    d'2 d4 b
    c1
    e4 f e d
    c1 | \break
    c4 d e f
    g2 e
    f4 e d c
    c1 \bar "|."
  }
}

\score {
  <<
    \chords {
      c d:m f:m c
      a:m d f:m c
      g c d f
      f:m c2 a d:m g c
    }
    \new Staff { \song }
    \new TabStaff { \song }
  >>
}

which produces both the melody in the staves and the backing chords:

enter image description here

I want to add fret diagrams for the backing chords by using

\include "predefined-guitar-fretboards.ly"

but if I use ChordMode, then it seems that the notes in the staves become the chords.

2 Answers 2

2

Here's how I would do it:

\version "2.18.2"

\include "predefined-guitar-fretboards.ly"

% one octave above middle c
song = {
  \relative c'' {
    \time 4/4
    \tempo 4 = 66
    c c d e
    f1
    f4 f c d
    e1 | \break
    e4 e f e
    d e d2
    c4 d c a
    g1 | \break
    d'2 d4 b
    c1
    e4 f e d
    c1 | \break
    c4 d e f
    g2 e
    f4 e d c
    c1 \bar "|."
  }
}

theChords = \chordmode {
  c d:m f:m c
  a:m d f:m c
  g c d f
  f:m c2 a d:m g c
}

\score {
  <<
    \new ChordNames { \theChords }
    \new FretBoards { \theChords }
    \new Staff { \song }
    \new TabStaff { \song }
  >>
}
2
  • Thanks but this is what I tried earlier. The fretboards appear but the melody notes are now interpreted as half notes. Twiddling things to see if I can get this to all work.
    – timbo
    Commented Apr 1, 2018 at 0:53
  • @timbo: The chord names in theChords variable don't have endurance values (e.g c1 d2:m, etc.) Add these and you should be fine.
    – ksnortum
    Commented Apr 2, 2018 at 13:39
2

@ksnortum's answer structures the chords in a variable, but curiously:

  • the melody notes timing changes unexpectedly from quarter notes to half notes
  • the chords are presumed to be four per measure

enter image description here

Setting the timings explicitly on the first note and first chord produces the desired result:

theChords = \chordmode {
  c1 d:m f:m c
  a:m d f:m c
  g c d f
  f:m c2 a d:m g c
}

% one octave above middle c
song = {
  \relative c'' {
    \time 4/4
    \tempo 4 = 66
    c4 c d e
    f1
    f4 f c d
    e1 | \break
    e4 e f e
    d e d2
    c4 d c aes
    g1 | \break
    d'2 d4 b
    c1
    e4 f e d
    c1 | \break
    c4 d e f
    g2 e
    f4 e d c
    c1 \bar "|."
  }
}

\score {
  <<
    \new ChordNames { \theChords }
    \new FretBoards { \theChords }
    \new Staff { \song }
    \new TabStaff { \song }
  >>
}

enter image description here

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