### 2.4.2 Guitar

Most of the notational issues associated with guitar music are covered sufficiently in the general fretted strings section, but there are a few more worth covering here. Occasionally users want to create songbook-type documents having only lyrics with chord indications above them. Since LilyPond is a music typesetter, it is not recommended for documents that have no music notation in them. A better alternative is a word processor, text editor, or, for experienced users, a typesetter like GuitarTeX.

#### Indicating position and barring

This example demonstrates how to include guitar position and barring indications.

>     \clef "treble_8"
>     b16 d g b e
>     \textSpannerDown
>     \override TextSpanner.bound-details.left.text = #"XII "
>     g16\startTextSpan
>     b16 e g e b g\stopTextSpan
>     e16 b g d

#### See also

Notation Reference: Text spanners.

Snippets: Fretted strings, Expressive marks.

#### Indicating harmonics and dampened notes

Special note heads can be used to indicate dampened notes or harmonics. Harmonics are normally further explained with a text markup.

>     \relative c' {
>       \clef "treble_8"
>       \override Staff.NoteHead.style = #'harmonic-mixed
>       d^\markup { \italic { \fontsize #-2 { "harm. 12" }}} <g b>1
>     }

Dampened notes (also called dead notes) are supported within normal and tablature staves:

>     music = \relative c' {
>       < a\3 \deadNote c\2 a'\1 >4
>       < b\3 \deadNote d\2 b'\1 >
>       < c\3 \deadNote e\2 c'\1 >
>       \deadNotesOn
>       \tuplet 3/2 { g8 b e }
>       \deadNotesOff
>       < a,\3 c\2 e\1 >1
>     }
>     \new StaffGroup <<
>       \new Staff {
>         \clef "treble_8"
>         \music
>       }
>       \new TabStaff {
>         \music
>       }
>     >>

Another playing technique (especially used on electric guitars) is called palm mute. The string is hereby partly muted by the palm of the striking hand (hence the name). Lilypond supports the notation of palm mute-style notes by changing the note head to a triangle shape.

>     \new Voice { % Warning: explicit Voice instantiation is
>                  %    required to have palmMuteOff work properly
>                  %    when palmMuteOn comes at the beginning of
>                  %    the piece.
>       \relative c, {
>         \clef "G_8"
>         \palmMuteOn
>         e8^\markup { \musicglyph #"noteheads.u2do"  = palm mute }
>         < e b' e > e
>         \palmMuteOff
>         e e  \palmMute e e e |
>         e8 \palmMute { e e e } e e e e |
>         < \palmMute e b' e >8 \palmMute { e e e } < \palmMute e b' e >2
>       }
>     }

#### See also

Snippets: Fretted strings.

Notation Reference: Special note heads, Note head styles.

#### Indicating power chords

Power chords and their symbols can be engraved in chord mode or as chord constructs:

>     ChordsAndSymbols = {
>       \chordmode {
>         \powerChords
>         e,,1:1.5
>         a,,1:1.5.8
>         \set minimumFret = #8
>         c,1:1.5
>         f,1:1.5.8
>       }
>       \set minimumFret = #5
>       <a, e>1
>       <g d' g'>1
>     }
>     \score {
>       <<
>         \new ChordNames {
>         \ChordsAndSymbols
>         }
>         \new Staff {
>           \clef "treble_8"
>           \ChordsAndSymbols
>         }
>         \new TabStaff {
>           \ChordsAndSymbols
>         }
>       >>
>     }

Power chord symbols are automatically switched off as soon as one of the other common chord modifier is used:

>     mixedChords = \chordmode {
>       c,1
>       \powerChords
>       b,,1:1.5
>       fis,,1:1.5.8
>       g,,1:m
>     }
>     \score {
>       <<
>         \new ChordNames {
>           \mixedChords
>         }
>         \new Staff {
>           \clef "treble_8"
>           \mixedChords
>         }
>         \new TabStaff {
>           \mixedChords
>         }
>       >>
>     }

#### See also

Music Glossary: power chord.

Notation Reference: Extended and altered chords, Printing chord names.

Snippets: Fretted strings.

其他语言：deutsch, español, français, italiano, 日本語。
About automatic language selection.

#### LilyPond — Notation Reference v2.18.2 (稳定分支).