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.

1

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 }
  >>
}
  • 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 Apr 1 '18 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 Apr 2 '18 at 13:39
1

@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

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.