7

I have the following LilyPond code:

\include "predefined-guitar-fretboards.ly"

verse_one_progression = \chordmode {
  \set chordChanges = ##t
  g4 g g8 g~ g4
  g4 g g8 g~ g4 \break
  \set chordChanges = ##t
  b4:sus2 b:sus2 b8:sus2 b:sus2 ~ b4:sus2 % want x24422
  b4:sus2 b:sus2 b8:sus2 b:sus2~ b4:sus2 \break
}

chorus = \chordmode {
  \set chordChanges = ##t
  d4 d d d
  g4 g g g \break
  \set chordChanges = ##t
  e4:m7 e:m7 e:m7 e:m7 % produces "wrong" fretboard
  g4 g g g \break
}

\score {
<<
  \new ChordNames {
    \repeat unfold 4 \verse_one_progression
  }
  \new FretBoards { 
    \repeat unfold 4 \verse_one_progression 
  }
  \new Voice = "verse1line1" { 
      \time 4/4
      \improvisationOn

      \repeat unfold 4 \verse_one_progression
  }
>>
}

The comment in line 8 indicates where I'm tying to add my fingering. LilyPond is displaying xx311/xiv, which I interpret to actually be x,x,16,14,14 (I'm assuming the xiv indicates the 14th fret is the top line). I would like to include a diagram for x24422. The docs don't show Bsus2 for guitar (https://lilypond.org/doc/v2.22/Documentation/notation/predefined-fretboard-diagrams), so I'm guessing that was either an oversight in the documentation or it is generating them automatically (I know just enough about music theory to understand that it is possible to do that, but not how to actually do it).

I can sort of follow the docs to figure out how to adjust sizes, etc. in the diagrams, but can't wrap my head around how I would go about creating a diagram for that specific fingering. Is there a way to create a definition in my file that will cause every instance of Bsus2 to render as I want it?

1 Answer 1

7

2.4.1 Common notation for fretted strings § Predefined fret diagrams

Fret diagrams can be added to the fret diagram table. To add a diagram, you must specify the hash table for the diagram, the chord for the diagram, the tuning to be used, and a definition for the diagram. Normally, the hash table will be default-fret-table. The diagram definition can be either a fret-diagram-terse definition string or a fret-diagram-verbose marking list.

The section that shows the command storePredefinedDiagram should probably provide you with what you need, but here's a full, written-out explanation:

\version "2.22.0"
\include "predefined-guitar-fretboards.ly"
\storePredefinedDiagram    <--- What we want to do.
  #default-fret-table      <--- Where to store the following diagram.
    \chordmode { b:sus2 }  <--- Which chord we want to (re-)define.
      #guitar-tuning #"    <--- Which string tuning will be used.
        x;                 <--- Lowest string. x is muted, o is open. 
        2-1-(;             <--- Semicolon separates strings. The usual
        4-3;               <--- pattern is fret-finger-barre. 2-1-( means
        4-4;               <--- 2nd fret, first finger, and opening the
        2-1;               <--- barre chord. The -) closes the barre.
        2-1-);             <--- Highest string.
      "
\storePredefinedDiagram
  #default-fret-table
    \chordmode { b:sus4 }
      #guitar-tuning #"
        x;
        2-1-(;
        2-1;
        4-3;
        5-4;
        2-1-);
      "
the-chords = \chordmode {
  b:sus2                   <--- Now, any b:sus2 and b:sus4 will use the 
  b:sus4                   <--- diagrams we defined.
}
\score {
  <<
    \new ChordNames \the-chords
    \new FretBoards \the-chords
  >>
}

Showing barre chord predefined definitions

1
  • 1
    This is a very clear and excellent explanation and will go a long way to helping me understand the rest of the documentation on that page. Thanks! Commented May 24, 2022 at 20:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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