Frammenti LilyPond: Fretted strings

# Fretted strings

Fretted string instruments

## Adding fingerings to a score

Fingering instructions can be entered using a simple syntax.

    \relative c'' {
      c4-1 d-2 f-4 e-3
    }

## Adding fingerings to tablatures

To add fingerings to tablatures, use a combination of `\markup` and `\finger`.

    one = \markup { \finger 1 }
    two = \markup { \finger 2 }
    threeTwo = \markup {
      \override #'(baseline-skip . 2)
      \column {
        \finger 3
        \finger 2
      }
    }
    threeFour = \markup {
      \override #'(baseline-skip . 2)
      \column {
        \finger 3
        \finger 4
      }
    }

    \score {
      \new TabStaff {
        \tabFullNotation
        \stemUp
        e8\4^\one b\2 <g\3 e'\1>^>[ b\2 e\4]
        <a\3 fis'\1>^>^\threeTwo[ b\2 e\4]
      }
    }

## Adding markups in a tablature

By default markups does not show in a tablature.

To make them appear, simply use the command `\revert TabStaff.TextScript.stencil`

    %% http://lsr.di.unimi.it/LSR/Item?id=919
    % by P.P.Schneider on June 2014

    high  = { r4 r8 <g c'> q r8 r4 }

    low = { c4 r4 c8 r8 g,8 b, }

    pulse = { s8^"1" s^"&" s^"2" s^"&" s^"3" s^"&" s^"4" s^"&" }

    \score {
     \new TabStaff {
       \repeat unfold 2 << \high \\ \low \\ \pulse >>
      }
      \layout {
        \context {
          \TabStaff
          \clef moderntab
          \revert TextScript.stencil
          \override TextScript.font-series = #'bold
          \override TextScript.font-size = #-2
          \override TextScript.color = #red

        }
        \context {
          \Score
          proportionalNotationDuration = #(ly:make-moment 1/8)
        }
      }
    }

## Far sì che la diteggiatura appaia dentro il rigo

Per impostazione predefinita, le diteggiature orientate verticalmente sono poste fuori dal rigo; questo comportamento tuttavia può essere disabilitato. Occorre fare attenzione alle situazioni in cui le diteggiature e i gambi sono rivolti nella stessa direzione: normalmente le diteggiature evitano soltanto i gambi con travature. Questa impostazione predefinita può essere cambiata in modo da evitare tutti i gambi oppure nessuno. L’esempio seguente mostra queste due opzioni, così come tornare al comportamento predefinito.

    \relative c' {
      <c-1 e-2 g-3 b-5>2
      \override Fingering.staff-padding = #'()
      <c-1 e-2 g-3 b-5>4 g'-0
      a8[-1 b]-2 g-0 r
      \override Fingering.add-stem-support = ##f
      a[-1 b]-2 g-0 r
      \override Fingering.add-stem-support = ##t
      a[-1 b]-2 g-0 r
      \override Fingering.add-stem-support = #only-if-beamed
      a[-1 b]-2 g-0 r
    }

## Automatic Fretboards Barre

When automatic fretboards are used, barre indicators will be drawn whenever one finger is responsible for multiple strings.

If no finger indications are given in the chord from which the automatic fretboard is created, no barre indicators will be included, because there is no way to identify where barres should be placed.

    \new FretBoards {
      <f,-1 c-3 f-4 a-2 c'-1 f'-1>1
      <f, c f a c' f'>1
    }

## Cambiare l’orientamento della tastiera

I diagrammi dei tasti possono essere orientati in tre modi.

    \include "predefined-guitar-fretboards.ly"

    <<
      \chords {
        c1
        c1
        c1
      }
      \new FretBoards {
        \chordmode {
          c1
          \override FretBoard.fret-diagram-details.orientation =
            #'landscape
          c1
          \override FretBoard.fret-diagram-details.orientation =
            #'opposing-landscape
          c1
        }
      }
      \new Voice {
        c'1
        c'1
        c'
      }
    >>

## Glissando di accordi in intavolatura

I glissati (o slide) di accordi vengono indicati sia nel rigo (contesto `Staff`) sia nell’intavolatura (contesto `TabStaff`). I numeri di corda sono necessari per `TabStaff`, perché i calcoli automatici della corda sono diversi per gli accordi e per le note singole.

    myMusic = \relative c' {
      <c e g>1 \glissando <f a c>
    }

    \score {
      <<
        \new Staff {
          \clef "treble_8"
          \myMusic
        }
        \new TabStaff \myMusic
      >>
    }

    \score {
      <<
        \new Staff {
          \clef "treble_8"
          \myMusic
        }
        \new TabStaff \with { \override Glissando.style = #'none } {
          \myMusic
        }
      >>
    }

## Cambi di accordo nei diagrammi dei tasti

Si può impostare il contesto FretBoards in modo che mostri il diagramma solo quando l’accordo cambia o all’inizio di una nuova linea.

    \include "predefined-guitar-fretboards.ly"

    myChords = \chordmode {
      c1 c1 \break
      \set chordChanges = ##t
      c1 c1 \break
      c1 c1
    }

    <<
      \new ChordNames { \myChords }
      \new FretBoards { \myChords }
      \new Staff { \myChords }
    >>

## Chords with stretched fingering for FretBoards and TabVoice

Sometimes chords with a stretched fingering are required. If not otherwise specified the context-property `maximumFretStretch` is set to `4`, though. Resulting in a warning about "No string for pitch ..." and the note is omitted. You may set `maximumFretStretch` to an approppriate value or explecitely assign string-numbers to all notes of a chord.

    %% The code below will print two warnings, which may be omitted by uncommenting:
    %#(for-each (lambda (x) (ly:expect-warning "No string for pitch")) (iota 2))

    mus = {
      <c' bes'>
      <c'\2 bes'>
      \set maximumFretStretch = 5
      <c' bes'>
      <c'\2 bes'\1>
    }

    <<
      \new FretBoards \mus
      \new TabVoice \mus
    >>

## Controllare il posizionamento delle diteggiature di un accordo

Il posizionamento dei numeri della diteggiatura può essere regolato in modo preciso. Perché l’orientamento funzioni, occorre usare il costrutto per gli accordi <> anche per le note singole. Si può impostare in modo simile l’orientamento dei numeri di corda e delle diteggiature della mano destra.

    \relative c' {
      \set fingeringOrientations = #'(left)
      <c-1 e-3 a-5>4
      \set fingeringOrientations = #'(down)
      <c-1 e-3 a-5>4
      \set fingeringOrientations = #'(down right up)
      <c-1 e-3 a-5>4
      \set fingeringOrientations = #'(up)
      <c-1 e-3 a-5>4
      \set fingeringOrientations = #'(left)
      <c-1>2
      \set fingeringOrientations = #'(down)
      <e-3>2
      \set stringNumberOrientations = #'(up left down)
      <f\3 a\2 c\1>1
      \set strokeFingerOrientations = #'(down right up)
      <c\rightHandFinger #1 e\rightHandFinger #2 c'\rightHandFinger #4 >
    }

## Personalizzare la tastiera del diagramma dei tasti

Le proprietà del diagramma dei tasti possono essere impostate tramite `'fret-diagram-details`. Per i diagrammi dell’oggetto FretBoard, gli override vengono applicati all’oggetto `FretBoards.FretBoard`. Come `Voice`, `FretBoards` è un contesto di basso livello, dunque può essere omesso negli override delle proprietà.

    \include "predefined-guitar-fretboards.ly"
    \storePredefinedDiagram #default-fret-table \chordmode { c' }
                            #guitar-tuning
                            #"x;1-1-(;3-2;3-3;3-4;1-1-);"

    % shorthand
    oo = #(define-music-function
           (grob-path value)
           (list? scheme?)
           #{ \once \override $grob-path = #value #})

    <<
      \new ChordNames {
        \chordmode { c1 | c | c | d }
      }
      \new FretBoards {
        % Set global properties of fret diagram
        \override FretBoards.FretBoard.size = #'1.2
        \override FretBoard.fret-diagram-details.finger-code = #'in-dot
        \override FretBoard.fret-diagram-details.dot-color = #'white
        \chordmode {
          c
          \oo FretBoard.size #'1.0
          \oo FretBoard.fret-diagram-details.barre-type #'straight
          \oo FretBoard.fret-diagram-details.dot-color #'black
          \oo FretBoard.fret-diagram-details.finger-code #'below-string
          c'
          \oo FretBoard.fret-diagram-details.barre-type #'none
          \oo FretBoard.fret-diagram-details.number-type #'arabic
          \oo FretBoard.fret-diagram-details.orientation #'landscape
          \oo FretBoard.fret-diagram-details.mute-string #"M"
          \oo FretBoard.fret-diagram-details.label-dir #LEFT
          \oo FretBoard.fret-diagram-details.dot-color #'black
          c'
          \oo FretBoard.fret-diagram-details.finger-code #'below-string
          \oo FretBoard.fret-diagram-details.dot-radius #0.35
          \oo FretBoard.fret-diagram-details.dot-position #0.5
          \oo FretBoard.fret-diagram-details.fret-count #3
          d
        }
      }
      \new Voice {
        c'1 | c' | c' | d'
      }
    >>

## Personalizzare il diagramma dei tasti di tipo markup

Le proprietà del diagramma dei tasti si possono impostare tramite `'fret-diagram-details`. Per diagrammi di tipo markup, gli override possono essere applicati all’oggetto `Voice.TextScript` o direttamente al markup.

    <<
      \chords { c1 | c | c | d }

      \new Voice = "mel" {
        \textLengthOn
        % Set global properties of fret diagram
        \override TextScript.size = #'1.2
        \override TextScript.fret-diagram-details.finger-code = #'in-dot
        \override TextScript.fret-diagram-details.dot-color = #'white

        %% C major for guitar, no barre, using defaults
           % terse style
        c'1^\markup { \fret-diagram-terse "x;3-3;2-2;o;1-1;o;" }

        %% C major for guitar, barred on third fret
           % verbose style
           % size 1.0
           % roman fret label, finger labels below string, straight barre
        c'1^\markup {
          % standard size
          \override #'(size . 1.0) {
            \override #'(fret-diagram-details . (
                         (number-type . roman-lower)
                         (finger-code . in-dot)
                         (barre-type . straight))) {
              \fret-diagram-verbose #'((mute 6)
                                       (place-fret 5 3 1)
                                       (place-fret 4 5 2)
                                       (place-fret 3 5 3)
                                       (place-fret 2 5 4)
                                       (place-fret 1 3 1)
                                       (barre 5 1 3))
            }
          }
        }

        %% C major for guitar, barred on third fret
           % verbose style
           % landscape orientation, arabic numbers, M for mute string
           % no barre, fret label down or left, small mute label font
        c'1^\markup {
          \override #'(fret-diagram-details . (
                       (finger-code . below-string)
                       (number-type . arabic)
                       (label-dir . -1)
                       (mute-string . "M")
                       (orientation . landscape)
                       (barre-type . none)
                       (xo-font-magnification . 0.4)
                       (xo-padding . 0.3))) {
            \fret-diagram-verbose #'((mute 6)
                                     (place-fret 5 3 1)
                                     (place-fret 4 5 2)
                                     (place-fret 3 5 3)
                                     (place-fret 2 5 4)
                                     (place-fret 1 3 1)
                                     (barre 5 1 3))
          }
        }

        %% simple D chord
           % terse style
           % larger dots, centered dots, fewer frets
           % label below string
        d'1^\markup {
          \override #'(fret-diagram-details . (
                       (finger-code . below-string)
                       (dot-radius . 0.35)
                       (dot-position . 0.5)
                       (fret-count . 3))) {
            \fret-diagram-terse "x;x;o;2-1;3-2;2-3;"
          }
        }
      }
    >>

## Definire diagrammi dei tasti predefiniti per altri strumenti

Si possono aggiungere diagrammi dei tasti predefiniti per nuovi strumenti oltre a quelli standard per chitarra. Questo frammento mostra come farlo definendo una nuova accordatura e alcuni diagrammi predefiniti per il quatro venezuelano.

Mostra anche come includere le diteggiature negli accordi usati come punti di riferimento per la consultazione degli accordi e come mostrarle nel diagramma dei tasti e in `TabStaff`, ma non nella musica.

Questi diagrammi non sono trasponibili perché contengono informazioni sulle corde. È prevista una correzione in futuro.

    % add FretBoards for the Cuatro
    %   Note: This section could be put into a separate file
    %      predefined-cuatro-fretboards.ly
    %      and \included into each of your compositions

    cuatroTuning = #`(,(ly:make-pitch 0 6 0)
                      ,(ly:make-pitch 1 3 SHARP)
    		  ,(ly:make-pitch 1 1 0)
    		  ,(ly:make-pitch 0 5 0))

    dSix = { <a\4 b\1 d\3 fis\2> }
    dMajor = { <a\4 d\1 d\3 fis \2> }
    aMajSeven = { <a\4 cis\1 e\3 g\2> }
    dMajSeven = { <a\4 c\1 d\3 fis\2> }
    gMajor = { <b\4 b\1 d\3 g\2> }

    \storePredefinedDiagram #default-fret-table \dSix
                            #cuatroTuning
                            #"o;o;o;o;"
    \storePredefinedDiagram #default-fret-table \dMajor
                            #cuatroTuning
                            #"o;o;o;3-3;"
    \storePredefinedDiagram #default-fret-table \aMajSeven
                            #cuatroTuning
                            #"o;2-2;1-1;2-3;"
    \storePredefinedDiagram #default-fret-table \dMajSeven
                            #cuatroTuning
                            #"o;o;o;1-1;"
    \storePredefinedDiagram #default-fret-table \gMajor
                            #cuatroTuning
                            #"2-2;o;1-1;o;"

    % end of potential include file /predefined-cuatro-fretboards.ly

    #(set-global-staff-size 16)

    primerosNames = \chordmode {
      d:6 d a:maj7 d:maj7
      g
    }
    primeros = {
      \dSix \dMajor \aMajSeven \dMajSeven
      \gMajor
    }

    \score {
      <<
        \new ChordNames {
          \set chordChanges = ##t
          \primerosNames
        }

        \new Staff {
          \new Voice \with {
            \remove "New_fingering_engraver"
          }
          \relative c'' {
            \primeros
          }
        }

        \new FretBoards {
          \set Staff.stringTunings = #cuatroTuning
    %      \override FretBoard
    %        #'(fret-diagram-details string-count) = 4
          \override FretBoard.fret-diagram-details.finger-code = #'in-dot
          \primeros
        }

        \new TabStaff \relative c'' {
          \set TabStaff.stringTunings = #cuatroTuning
          \primeros
        }

      >>

      \layout {
        \context {
          \Score
          \override SpacingSpanner.base-shortest-duration =
            #(ly:make-moment 1 16)
        }
      }
      \midi { }
    }

## Faking a hammer in tablatures

A hammer in tablature can be faked with slurs.

    \score {
      \new TabStaff {
        \relative c'' {
          \tabFullNotation
          c4( d) d( d)
          d2( c)
        }
      }
    }

## Diteggiature, indicazioni di corda e diteggiature della mano destra

Questo esempio combina la diteggiatura per la mano sinistra, le indicazioni di stringa e la diteggiatura della mano destra.

    #(define RH rightHandFinger)

    \relative c {
      \clef "treble_8"
      <c-3\5\RH #1 >4
      <e-2\4\RH #2 >4
      <g-0\3\RH #3 >4
      <c-1\2\RH #4 >4
    }

## Flamenco notation

For flamenco guitar, special notation is used:

- a golpe symbol to indicate a slap on the guitar body with the nail of the ring finger
- an arrow to indicate (the direction of) strokes
- different letters for fingering (“p”: thumb, “i”: index finger, “m”: middle finger, “a”: ring finger and “x”: little finger)
- 3- and 4-finger rasgueados; stroke upwards with all fingers, ending with an up- and down using the index finger
- abanicos: strokes (in tuples) with thumb (down), little and index finger (both up). There’s also an abanico 2 where middle and ring finger are used instead of the little finger.
- alza pua: fast playing with the thumb

Most figures use arrows in combination with fingering; with abanicos and rasgueados, noteheads are printed only for the first chord.

This snippet contains some header-like code that can be copied as ‘`flamenco.ly`’ and included in source files.

    %%%%%%%  Cut here ----- Start 'flamenco.ly'

    % Text indicators :
    abanico = ^\markup\small { \italic Abanico }
    rasgueado = ^\markup\small { \italic Ras. }
    alzapua = ^\markup\small { \italic Alzapua }

    % Finger stroke symbols :
    strokeUp = \markup\combine\override #'(thickness . 1.3) \draw-line #'(0 . 2)\raise #2 \arrow-head #Y #UP ##f
    strokeDown = \markup\combine\arrow-head #Y #DOWN ##f \override #'(thickness . 1.3) \draw-line #'(0 . 2)

    % Golpe symbol :
    golpe = \markup {
      \filled-box #'(0 . 1) #'(0 . 1) #0
      \hspace #-1.6
      \with-color #white
      \filled-box #'(0.15 . 0.85) #'(0.15 . 0.85) #0
    }

    % Strokes, fingers and golpe command :
    RHp = \rightHandFinger #1
    RHi = \rightHandFinger #2
    RHm = \rightHandFinger #3
    RHa = \rightHandFinger #4
    RHx = \rightHandFinger #5
    RHu = \rightHandFinger \strokeUp
    RHd = \rightHandFinger \strokeDown
    RHg = \rightHandFinger \golpe

    % Just handy :)
    tupletOff = {
      \once \omit TupletNumber
      \once \omit TupletBracket
    }

    tupletsOff = {
      \omit TupletNumber
      \override TupletBracket.bracket-visibility = #'if-no-beam
    }

    tupletsOn = {
      \override TupletBracket.bracket-visibility = #'default
      \undo \omit TupletNumber
    }

    headsOff = {
      \hide TabNoteHead
      \hide NoteHead
      \override NoteHead.no-ledgers = ##t
    }

    headsOn = {
      \override TabNoteHead.transparent = ##f
      \override NoteHead.transparent = ##f
      \override NoteHead.no-ledgers = ##f
    }

    %%%%%%%  Cut here ----- End 'flamenco.ly'
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    part = \relative c' {
      \set strokeFingerOrientations = #'(up)
      \key a\major
      <a, e' a cis e\RHu\RHi>8
      <a e' a cis e\RHd\RHi>8
      r4
      r2^\markup\golpe
      <a e' a cis e\RHu\RHi>8
      <a e' a cis e\RHd\RHi>8
      <a e' a cis e\RHu\RHi\RHg>8
      <a e' a cis e\RHd\RHi>8
      r2
      <a e' a cis e\RHu\RHa>16\rasgueado
      \headsOff
      <a e' a cis e\RHu\RHm>
      <a e' a cis e\RHu\RHi>
      <a e' a cis e\RHd\RHi>~
      \headsOn
      <a e' a cis e>2
      r4
      \tupletOff
      \tuplet 5/4 {
        <a e' a cis e\RHu\RHx>16\rasgueado
        \headsOff
        <a e' a cis e\RHu\RHa>
        <a e' a cis e\RHu\RHm>
        <a e' a cis e\RHu\RHi>
        <a e' a cis e\RHd\RHi>~
        \headsOn
      }
      <a e' a cis e>2
      r4
      \tupletsOff
      \tuplet 3/2 {
        <a e' a cis e\RHd\RHp>8\abanico
        \headsOff
        <a e' a cis e\RHu\RHx>
        <a e' a cis e\RHu\RHi>
        \headsOn
      }
      \tuplet 3/2 {
        <a e' a cis e\RHd\RHp>8
        \headsOff
        <a e' a cis e\RHu\RHx>
        <a e' a cis e\RHu\RHi>
        \headsOn
      }
      \tuplet 3/2 {
        <a e' a cis e\RHd\RHp>8
        \headsOff
        <a e' a cis e\RHu\RHx>
        <a e' a cis e\RHu\RHi>
        \headsOn
      }
      \tuplet 3/2 {
        <a e' a cis e\RHd\RHp>8
        \headsOff
        <a e' a cis e\RHu\RHx>
        <a e' a cis e\RHu\RHi>
        \headsOn
      }
      \tupletsOff
      \override Beam.positions = #'(2 . 2)
      \tuplet 3/2 {
        a8\RHp\alzapua
        <e' a\RHu\RHg>
        <e a\RHd>
      }
      \tuplet 3/2 {
        a,8\RHp
        <e' a\RHu\RHg>
        <e a\RHd>
      }
      \tuplet 3/2 {
        a,8\RHp
        <e' a\RHu\RHg>
        <e a\RHd>
      }
      \tuplet 3/2 {
        a,8\RHp
        <e' a\RHu\RHg>
        <e a\RHd>
      }
      \tupletsOn
      <a, e' a\RHu\RHm>1
      \bar "|."
    }

    \score {
      \new StaffGroup <<
        \context Staff = "part" <<
          \clef "G_8"
          {
            \part
          }
        >>
        \context TabStaff {
          \part
        }
      >>
      \layout {
        ragged-right = ##t
      }
    }

## Fret diagrams explained and developed

This snippet shows many possibilities for obtaining and tweaking fret diagrams.

    <<
      \chords {
        a2 a
        \repeat unfold 3 {
          c c c d d
        }
      }

      \new Voice = "mel" {
        \textLengthOn
        % Set global properties of fret diagram
        \override TextScript.size = #1.2
        \override TextScript.fret-diagram-details.finger-code = #'below-string
        \override TextScript.fret-diagram-details.dot-color = #'black

        %% A chord for ukulele
        a'2^\markup {
          \override #'(fret-diagram-details . (
                       (string-count . 4)
                       (dot-color . white)
                       (finger-code . in-dot))) {
            \fret-diagram "4-2-2;3-1-1;2-o;1-o;"
          }
        }

        %% A chord for ukulele, with formatting defined in definition string
        %  1.2 * size, 4 strings, 4 frets, fingerings below string
        %  dot radius .35 of fret spacing, dot position 0.55 of fret spacing
        a'2^\markup {
          \override #'(fret-diagram-details . (
                       (dot-color . white)
                       (open-string . "o"))) {
            \fret-diagram "s:1.2;w:4;h:3;f:2;d:0.35;p:0.55;4-2-2;3-1-1;2-o;1-o;"
          }
        }

          %% These chords will be in normal orientation

        %% C major for guitar, barred on third fret
        %  verbose style
        %  roman fret label, finger labels below string, straight barre
        c'2^\markup {
          % 110% of default size
          \override #'(size . 1.1) {
            \override #'(fret-diagram-details . (
                         (number-type . roman-lower)
                         (finger-code . below-string)
                         (barre-type . straight))) {
              \fret-diagram-verbose #'((mute 6)
                                       (place-fret 5 3 1)
                                       (place-fret 4 5 2)
                                       (place-fret 3 5 3)
                                       (place-fret 2 5 4)
                                       (place-fret 1 3 1)
                                       (barre 5 1 3))
            }
          }
        }

        %% C major for guitar, barred on third fret
        %% Double barre used to test barre function
        %  verbose style
        c'2^\markup {
          % 110% of default size
          \override #'(size . 1.1) {
            \override #'(fret-diagram-details . (
                         (number-type . arabic)
                         (dot-label-font-mag . 0.9)
                         (finger-code . in-dot)
                         (fret-label-font-mag . 0.6)
                         (fret-label-vertical-offset . 0)
                         (label-dir . -1)
                         (mute-string . "M")
                         (xo-font-magnification . 0.4)
                         (xo-padding . 0.3))) {
              \fret-diagram-verbose #'((mute 6)
                                       (place-fret 5 3 1)
                                       (place-fret 4 5 2)
                                       (place-fret 3 5 3)
                                       (place-fret 2 5 4)
                                       (place-fret 1 3 1)
                                       (barre 4 2 5)
                                       (barre 5 1 3))
            }
          }
        }

        %% C major for guitar, with capo on third fret
        %  verbose style
        c'2^\markup {
          % 110% of default size
          \override #'(size . 1.1) {
            \override #'(fret-diagram-details . (
                         (number-type . roman-upper)
                         (dot-label-font-mag . 0.9)
                         (finger-code . none)
                         (fret-label-vertical-offset . 0.5)
                         (xo-font-magnification . 0.4)
                         (xo-padding . 0.3))) {
              \fret-diagram-verbose #'((mute 6)
                                       (capo 3)
                                       (open 5)
                                       (place-fret 4 5 1)
                                       (place-fret 3 5 2)
                                       (place-fret 2 5 3)
                                       (open 1))
            }
          }
        }

        %% simple D chord
        d'2^\markup {
          \override #'(fret-diagram-details . (
                       (finger-code . below-string)
                       (dot-radius . 0.35)
                       (string-thickness-factor . 0.3)
                       (dot-position . 0.5)
                       (fret-count . 3))) {
            \fret-diagram-terse "x;x;o;2-1;3-2;2-3;"
          }
        }

        %% simple D chord, large top fret thickness
        d'2^\markup  {
          \override #'(fret-diagram-details . (
                       (finger-code . below-string)
                       (dot-radius . 0.35)
                       (dot-position . 0.5)
                       (top-fret-thickness . 7)
                       (fret-count . 3))) {
            \fret-diagram-terse "x;x;o;2-1;3-2;2-3;"
          }
        }

          % These chords will be in landscape orientation
        \override TextScript.fret-diagram-details.orientation = #'landscape

        %% C major for guitar, barred on third fret
        %  verbose style
        %  roman fret label, finger labels below string, straight barre
        c'2^\markup {
          % 110% of default size
          \override #'(size . 1.1) {
            \override #'(fret-diagram-details . (
                         (number-type . roman-lower)
                         (finger-code . below-string)
                         (barre-type . straight))) {
              \fret-diagram-verbose #'((mute 6)
                                       (place-fret 5 3 1)
                                       (place-fret 4 5 2)
                                       (place-fret 3 5 3)
                                       (place-fret 2 5 4)
                                       (place-fret 1 3 1)
                                       (barre 5 1 3))
            }
          }
        }

        %% C major for guitar, barred on third fret
        %% Double barre used to test barre function
        %  verbose style
        c'2^\markup {
          % 110% of default size
          \override #'(size . 1.1) {
            \override #'(fret-diagram-details . (
                         (number-type . arabic)
                         (dot-label-font-mag . 0.9)
                         (finger-code . in-dot)
                         (fret-label-font-mag . 0.6)
                         (fret-label-vertical-offset . 0)
                         (label-dir . -1)
                         (mute-string . "M")
                         (xo-font-magnification . 0.4)
                         (xo-padding . 0.3))) {
              \fret-diagram-verbose #'((mute 6)
                                       (place-fret 5 3 1)
                                       (place-fret 4 5 2)
                                       (place-fret 3 5 3)
                                       (place-fret 2 5 4)
                                       (place-fret 1 3 1)
                                       (barre 4 2 5)
                                       (barre 5 1 3))
            }
          }
        }

        %% C major for guitar, with capo on third fret
        %  verbose style
        c'2^\markup {
          % 110% of default size
          \override #'(size . 1.1) {
            \override #'(fret-diagram-details . (
                         (number-type . roman-upper)
                         (dot-label-font-mag . 0.9)
                         (finger-code . none)
                         (fret-label-vertical-offset . 0.5)
                         (xo-font-magnification . 0.4)
                         (xo-padding . 0.3))) {
              \fret-diagram-verbose #'((mute 6)
                                       (capo 3)
                                       (open 5)
                                       (place-fret 4 5 1)
                                       (place-fret 3 5 2)
                                       (place-fret 2 5 3)
                                       (open 1))
            }
          }
        }

        %% simple D chord
        d'2^\markup {
          \override #'(fret-diagram-details . (
                       (finger-code . below-string)
                       (dot-radius . 0.35)
                       (dot-position . 0.5)
                       (fret-count . 3))) {
            \fret-diagram-terse "x;x;o;2-1;3-2;2-3;"
          }
        }

        %% simple D chord, large top fret thickness
        d'2^\markup {
          \override #'(fret-diagram-details . (
                       (finger-code . below-string)
                       (dot-radius . 0.35)
                       (dot-position . 0.5)
                       (top-fret-thickness . 7)
                       (fret-count . 3))) {
            \fret-diagram-terse "x;x;o;2-1;3-2;2-3;"
          }
        }

          % These chords will be in opposing-landscape orientation
        \override TextScript.fret-diagram-details.orientation = #'opposing-landscape

        %% C major for guitar, barred on third fret
        %  verbose style
        %  roman fret label, finger labels below string, straight barre
        c'2^\markup {
          % 110% of default size
          \override #'(size . 1.1) {
            \override #'(fret-diagram-details . (
                         (number-type . roman-lower)
                         (finger-code . below-string)
                         (barre-type . straight))) {
              \fret-diagram-verbose #'((mute 6)
                                       (place-fret 5 3 1)
                                       (place-fret 4 5 2)
                                       (place-fret 3 5 3)
                                       (place-fret 2 5 4)
                                       (place-fret 1 3 1)
                                       (barre 5 1 3))
            }
          }
        }

        %% C major for guitar, barred on third fret
        %% Double barre used to test barre function
        %  verbose style
        c'2^\markup {
          % 110% of default size
          \override #'(size . 1.1) {
            \override #'(fret-diagram-details . (
                         (number-type . arabic)
                         (dot-label-font-mag . 0.9)
                         (finger-code . in-dot)
                         (fret-label-font-mag . 0.6)
                         (fret-label-vertical-offset . 0)
                         (label-dir . -1)
                         (mute-string . "M")
                         (xo-font-magnification . 0.4)
                         (xo-padding . 0.3))) {
              \fret-diagram-verbose #'((mute 6)
                                       (place-fret 5 3 1)
                                       (place-fret 4 5 2)
                                       (place-fret 3 5 3)
                                       (place-fret 2 5 4)
                                       (place-fret 1 3 1)
                                       (barre 4 2 5)
                                       (barre 5 1 3))
            }
          }
        }

        %% C major for guitar, with capo on third fret
        %  verbose style
        c'2^\markup {
          % 110% of default size
          \override #'(size . 1.1) {
            \override #'(fret-diagram-details . (
                         (number-type . roman-upper)
                         (dot-label-font-mag . 0.9)
                         (finger-code . none)
                         (fret-label-vertical-offset . 0.5)
                         (xo-font-magnification . 0.4)
                         (xo-padding . 0.3))) {
              \fret-diagram-verbose #'((mute 6)
                                       (capo 3)
                                       (open 5)
                                       (place-fret 4 5 1)
                                       (place-fret 3 5 2)
                                       (place-fret 2 5 3)
                                       (open 1))
            }
          }
        }

        %% simple D chord
        d'2^\markup {
          \override #'(fret-diagram-details . (
                       (finger-code . below-string)
                       (dot-radius . 0.35)
                       (dot-position . 0.5)
                       (fret-count . 3))) {
            \fret-diagram-terse "x;x;o;2-1;3-2;2-3;"
          }
        }

        %% simple D chord, large top fret thickness
        d'2^\markup {
          \override #'(fret-diagram-details . (
                       (finger-code . below-string)
                       (dot-radius . 0.35)
                       (dot-position . 0.5)
                       (top-fret-thickness . 7)
                       (fret-count . 3))) {
            \fret-diagram-terse "x;x;o;2-1;3-2;2-3;"
          }
        }
      }
    >>

## Tabelle alternative per i diagrammi dei tasti

Si possono creare tabelle alternative per i diagrammi dei tasti. Queste possono essere usate per avere diagrammi alternativi per uno stesso accordo.

Per poter usare una tabella alternativa, deve prima essere creata. Quindi si aggiungono i diagrammi alla tabella.

La tabella può essere vuota oppure ricopiata da una tabella esistente.

La tabella da usare nel mostrare i diagrammi predefiniti viene selezionata dalla proprietà `\predefinedDiagramTable`.

    \include "predefined-guitar-fretboards.ly"

    % Make a blank new fretboard table
    #(define custom-fretboard-table-one
       (make-fretboard-table))

    % Make a new fretboard table as a copy of default-fret-table
    #(define custom-fretboard-table-two
       (make-fretboard-table default-fret-table))

    % Add a chord to custom-fretboard-table-one
    \storePredefinedDiagram #custom-fretboard-table-one
                            \chordmode {c}
                            #guitar-tuning
                            "3-(;3;5;5;5;3-);"

    % Add a chord to custom-fretboard-table-two
    \storePredefinedDiagram #custom-fretboard-table-two
                            \chordmode {c}
                            #guitar-tuning
                            "x;3;5;5;5;o;"

    <<
      \chords {
        c1 | d1 |
        c1 | d1 |
        c1 | d1 |
      }
      \new FretBoards {
        \chordmode {
          \set predefinedDiagramTable = #default-fret-table
          c1 | d1 |
          \set predefinedDiagramTable = #custom-fretboard-table-one
          c1 | d1 |
          \set predefinedDiagramTable = #custom-fretboard-table-two
          c1 | d1 |
        }
      }
      \new Staff {
        \clef "treble_8"
        <<
          \chordmode {
            c1 | d1 |
            c1 | d1 |
            c1 | d1 |
          }
          {
            s1_\markup "Default table" | s1 |
            s1_\markup \column {"New table" "from empty"} | s1 |
            s1_\markup \column {"New table" "from default"} | s1 |
          }
        >>
      }
    >>

## Armonici su corde premute in intavolatura

Questo frammento mostra come scrivere su intavolatura armonici su corde premute.

    pinchedHarmonics = {
       \textSpannerDown
       \override TextSpanner.bound-details.left.text =
          \markup {\halign #-0.5 \teeny "PH" }
          \override TextSpanner.style =
             #'dashed-line
       \override TextSpanner.dash-period = #0.6
       \override TextSpanner.bound-details.right.attach-dir = #1
       \override TextSpanner.bound-details.right.text =
          \markup { \draw-line #'(0 . 1) }
       \override TextSpanner.bound-details.right.padding = #-0.5
    }

    harmonics = {
      %artificial harmonics (AH)
      \textLengthOn
      <\parenthesize b b'\harmonic>4_\markup { \teeny "AH 16" }
      <\parenthesize g g'\harmonic>4_\markup { \teeny "AH 17" }
      <\parenthesize d' d''\harmonic>2_\markup { \teeny "AH 19" }
      %pinched harmonics (PH)
      \pinchedHarmonics
      <a'\harmonic>2\startTextSpan
      <d''\harmonic>4
      <e'\harmonic>4\stopTextSpan
      %tapped harmonics (TH)
      <\parenthesize g\4 g'\harmonic>4_\markup { \teeny "TH 17" }
      <\parenthesize a\4 a'\harmonic>4_\markup { \teeny "TH 19" }
      <\parenthesize c'\3 c''\harmonic>2_\markup { \teeny "TH 17" }
      %touch harmonics (TCH)
      a4( <e''\harmonic>2. )_\markup { \teeny "TCH" }
    }

    frettedStrings = {
      %artificial harmonics (AH)
      \harmonicByFret #4 g4\3
      \harmonicByFret #5 d4\4
      \harmonicByFret #7 g2\3
      %pinched harmonics (PH)
      \harmonicByFret #7 d2\4
      \harmonicByFret #5 d4\4
      \harmonicByFret #7 a4\5
      %tapped harmonics (TH)
      \harmonicByFret #5 d4\4
      \harmonicByFret #7 d4\4
      \harmonicByFret #5 g2\3
      %touch harmonics (TCH)
      a4 \harmonicByFret #9 g2.\3
    }

    \score {
      <<
        \new Staff
        \with { \omit StringNumber } {
          \new Voice {
            \clef "treble_8"
            \harmonics
          }
        }
        \new TabStaff {
          \new TabVoice {
            \frettedStrings
          }
        }
      >>
    }

## Guitar slides

Unlike glissandos, slides may go from an imprecise point of the fretboard to a specific fret. A good way to do this is to add a hidden grace note before the note which is actually played, as demonstrated in the following example.

    %% Hide fret number: useful to draw slide into/from a casual point of
    %% the fretboard.
    hideFretNumber = {
      \once \hide TabNoteHead
      \once \hide NoteHead
      \once \hide Stem
      \once \override NoteHead.no-ledgers = ##t
      \once \override Glissando.bound-details.left.padding = #0.3
    }

    music= \relative c' {
      \grace { \hideFretNumber d8\2 \glissando s2 } g2\2
      \grace { \hideFretNumber g8\2 \glissando s2 } d2 |

      \grace { \hideFretNumber c,8 \glissando s } f4\5^\markup \tiny { Slide into }
      \grace { \hideFretNumber f8 \glissando s } a4\4
      \grace { \hideFretNumber e'8\3 \glissando s } b4\3^\markup \tiny { Slide from }
      \grace { \hideFretNumber b'8 \glissando s2 } g4 |
    }

    \score {
      <<
        \new Staff {
          \clef "G_8"
          \music
        }
        \new TabStaff {
          \music
        }
      >>
    }

## Ritmi di accompagnamento per chitarra

Per la musica per chitarra, è possibile mostrare i ritmi di accompagnamento, insieme alle note della melodia e ai nomi e ai diagrammi degli accordi.

    \include "predefined-guitar-fretboards.ly"
    <<
      \new ChordNames {
        \chordmode {
          c1 | f | g | c
        }
      }
      \new FretBoards {
        \chordmode {
          c1 | f | g | c
        }
      }
      \new Voice \with {
        \consists "Pitch_squash_engraver"
      } {
        \relative c'' {
          \improvisationOn
          c4 c8 c c4 c8 c
          f4 f8 f f4 f8 f
          g4 g8 g g4 g8 g
          c4 c8 c c4 c8 c
        }
      }
      \new Voice = "melody" {
        \relative c'' {
          c2 e4 e4
          f2. r4
          g2. a4
          e4 c2.
        }
      }
      \new Lyrics {
        \lyricsto "melody" {
          This is my song.
          I like to sing.
        }
      }
    >>

## Martellato e strappato

Il martellato (hammer on) e lo strappato (pull off) si possono ottenere con le legature di portamento.

    \new TabStaff {
      \relative c' {
        d4( e\2)
        a( g)
      }
    }

## Martellato e strappato usando accordi

Quando il martellato o lo strappato si applicano a delle note in un accordo, viene disegnato un solo arco. Ma è possibile avere un “doppio arco” impostando la proprietà `doubleSlurs` su `#t`.

    \new TabStaff {
      \relative c' {
        % chord hammer-on and pull-off
        \set doubleSlurs = ##t
        <g' b>8( <a c> <g b>)
      }
    }

## Martellato e strappato usando le voci

L’arco del martellato o dello strappato è rivolto in alto nella prima e terza voce, mentre è rivolto in basso nella seconda e quarta voce.

    \new TabStaff {
      \relative c' {
        << { \voiceOne g2( a) }
        \\ { \voiceTwo a,( b) }
        >> \oneVoice
      }
    }

## How to change fret diagram position

If you want to move the position of a fret diagram, for example, to avoid collision, or to place it between two notes, you have various possibilities:

1) modify #’padding or #’extra-offset values (as shown in the first snippet)

2) you can add an invisible voice and attach the fret diagrams to the invisible notes in that voice (as shown in the second example).

If you need to move the fret according with a rythmic position inside the bar (in the example, the third beat of the measure) the second example is better, because the fret is aligned with the third beat itself.

    harmonies = \chordmode
    {
      a8:13
    % THE FOLLOWING IS THE COMMAND TO MOVE THE CHORD NAME
      \once \override ChordNames.ChordName.extra-offset = #'(10 . 0)
      b8:13 s2.
    % THIS LINE IS THE SECOND METHOD
        s4 s4  b4:13
    }

    \score
    {
      <<
        \new ChordNames \harmonies
        \new Staff
        {a8^\markup { \fret-diagram  "6-x;5-0;4-2;3-0;2-0;1-2;"  }
    % THE FOLLOWING IS THE COMMAND TO MOVE THE FRET DIAGRAM
         \once \override TextScript.extra-offset = #'(10 . 0)
         b4.~^\markup { \fret-diagram  "6-x;5-2;4-4;3-2;2-2;1-4;"  } b4. a8\break
    % HERE IS THE SECOND METHOD
         <<
           { a8 b4.~ b4. a8}
           { s4 s4 s4^\markup { \fret-diagram  "6-x;5-2;4-4;3-2;2-2;1-4;"  }
           }
         >>
       }
      >>
    }

## Modello per combo jazz

Ecco un modello piuttosto complesso, per un gruppo jazz. Si noti che tutti gli strumenti sono in `\key c \major`. Si tratta della tonalità reale; sarà trasposta automaticamente includendo la musica all’interno di una sezione `\transpose`.

    \header {
      title = "Song"
      subtitle = "(tune)"
      composer = "Me"
      meter = "moderato"
      piece = "Swing"
      tagline = \markup {
        \column {
          "LilyPond example file by Amelie Zapf,"
          "Berlin 07/07/2003"
        }
      }
    }
    % To make the example display in the documentation
    \paper {
      paper-width = 130
    }
    %#(set-global-staff-size 16)
    \include "english.ly"

    %%%%%%%%%%%% Some macros %%%%%%%%%%%%%%%%%%%

    sl = {
      \override NoteHead.style = #'slash
      \hide Stem
    }
    nsl = {
      \revert NoteHead.style
      \undo \hide Stem
    }
    crOn = \override NoteHead.style = #'cross
    crOff = \revert NoteHead.style

    %% insert chord name style stuff here.

    jazzChords = { }

    %%%%%%%%%%%% Keys'n'thangs %%%%%%%%%%%%%%%%%

    global = { \time 4/4 }

    Key = { \key c \major }

    % ############ Horns ############

    % ------ Trumpet ------
    trpt = \transpose c d \relative c'' {
      \Key
      c1 | c | c |
    }
    trpHarmony = \transpose c' d {
      \jazzChords
    }
    trumpet = {
      \global
      \clef treble
      <<
        \trpt
      >>
    }

    % ------ Alto Saxophone ------
    alto = \transpose c a \relative c' {
      \Key
      c1 | c | c |
    }
    altoHarmony = \transpose c' a {
      \jazzChords
    }
    altoSax = {
      \global
      \clef treble
      <<
        \alto
      >>
    }

    % ------ Baritone Saxophone ------
    bari = \transpose c a' \relative c {
      \Key
      c1
      c1
      \sl
      d4^"Solo" d d d
      \nsl
    }
    bariHarmony = \transpose c' a \chordmode {
      \jazzChords s1 s d2:maj e:m7
    }
    bariSax = {
      \global
      \clef treble
      <<
        \bari
      >>
    }

    % ------ Trombone ------
    tbone = \relative c {
      \Key
      c1 | c | c
    }
    tboneHarmony = \chordmode {
      \jazzChords
    }
    trombone = {
      \global
      \clef bass
      <<
        \tbone
      >>
    }

    % ############ Rhythm Section #############

    % ------ Guitar ------
    gtr = \relative c'' {
      \Key
      c1
      \sl
      b4 b b b
      \nsl
      c1
    }
    gtrHarmony = \chordmode {
      \jazzChords
      s1 c2:min7+ d2:maj9
    }
    guitar = {
      \global
      \clef treble
      <<
        \gtr
      >>
    }

    %% ------ Piano ------
    rhUpper = \relative c'' {
      \voiceOne
      \Key
      c1 | c | c
    }
    rhLower = \relative c' {
      \voiceTwo
      \Key
      e1 | e | e
    }

    lhUpper = \relative c' {
      \voiceOne
      \Key
      g1 | g | g
    }
    lhLower = \relative c {
      \voiceTwo
      \Key
      c1 | c | c
    }

    PianoRH = {
      \clef treble
      \global
      <<
        \new Voice = "one" \rhUpper
        \new Voice = "two" \rhLower
      >>
    }
    PianoLH = {
      \clef bass
      \global
      <<
        \new Voice = "one" \lhUpper
        \new Voice = "two" \lhLower
      >>
    }

    piano = {
      <<
        \new Staff = "upper" \PianoRH
        \new Staff = "lower" \PianoLH
      >>
    }

    % ------ Bass Guitar ------
    Bass = \relative c {
      \Key
      c1 | c | c
    }
    bass = {
      \global
      \clef bass
      <<
        \Bass
      >>
    }

    % ------ Drums ------
    up = \drummode {
      \voiceOne
      hh4 <hh sn> hh <hh sn>
      hh4 <hh sn> hh <hh sn>
      hh4 <hh sn> hh <hh sn>
    }
    down = \drummode {
      \voiceTwo
      bd4 s bd s
      bd4 s bd s
      bd4 s bd s
    }

    drumContents = {
      \global
      <<
        \new DrumVoice \up
        \new DrumVoice \down
      >>
    }

    %%%%%%%%% It All Goes Together Here %%%%%%%%%%%%%%%%%%%%%%

    \score {
      <<
        \new StaffGroup = "horns" <<
          \new Staff = "trumpet" \with { instrumentName = "Trumpet" }
          \trumpet
          \new Staff = "altosax" \with { instrumentName = "Alto Sax" }
          \altoSax
          \new ChordNames = "barichords" \with { instrumentName = "Trumpet" }
          \bariHarmony
          \new Staff = "barisax" \with { instrumentName = "Bari Sax" }
          \bariSax
          \new Staff = "trombone" \with { instrumentName = "Trombone" }
          \trombone
        >>

        \new StaffGroup = "rhythm" <<
          \new ChordNames = "chords" \gtrHarmony
          \new Staff = "guitar" \with { instrumentName = "Guitar" }
          \guitar
          \new PianoStaff = "piano" \with {
            instrumentName = "Piano"
            midiInstrument = "acoustic grand"
          }
          \piano
          \new Staff = "bass" \with { instrumentName = "Bass" }
          \bass
          \new DrumStaff \with { instrumentName = "Drums" }
          \drumContents
        >>
      >>
      \layout {
        \context { \Staff \RemoveEmptyStaves }
        \context {
          \Score
          \override BarNumber.padding = #3
          \override RehearsalMark.padding = #2
          skipBars = ##t
        }
      }
      \midi { }
    }

## Laissez vibrer ties

Laissez vibrer ties have a fixed size. Their formatting can be tuned using `'tie-configuration`.

    \relative c' {
      <c e g>4\laissezVibrer r <c f g>\laissezVibrer r
      <c d f g>4\laissezVibrer r <c d f g>4.\laissezVibrer r8

      <c d e f>4\laissezVibrer r
      \override LaissezVibrerTieColumn.tie-configuration
         = #`((-7 . ,DOWN)
              (-5 . ,DOWN)
              (-3 . ,UP)
              (-1 . ,UP))
      <c d e f>4\laissezVibrer r
    }

## Let TabStaff print the topmost string at bottom

In tablatures usually the first string is printed topmost. If you want to have it at the bottom change the `stringOneTopmost`-context-property. For a context-wide setting this could be done in `layout` as well.

    %\layout {
    %  \context {
    %    \Score
    %    stringOneTopmost = ##f
    %  }
    %  \context {
    %    \TabStaff
    %    tablatureFormat = #fret-letter-tablature-format
    %  }
    %}

    m = {
      \cadenzaOn
      e, b, e gis! b e'
      \bar "||"
    }

    <<
      \new Staff { \clef "G_8" <>_"default" \m <>_"italian (historic)"\m }
      \new TabStaff
      {
        \m
        \set Score.stringOneTopmost = ##f
        \set TabStaff.tablatureFormat = #fret-letter-tablature-format
        \m
      }
    >>

## Letter tablature formatting

Tablature can be formatted using letters instead of numbers.

    music = \relative c {
      c4 d e f
      g4 a b c
      d4 e f g
    }

    <<
      \new Staff {
        \clef "G_8"
        \music
      }
      \new TabStaff \with {
        tablatureFormat = #fret-letter-tablature-format
      }
      {
        \music
      }
    >>

## Armonici su corde a vuoto in intavolatura

Questo frammento mostra come scrivere armonici su corde a vuoto.

    openStringHarmonics = {
      \textSpannerDown
      \override TextSpanner.staff-padding = #3
      \override TextSpanner.dash-fraction = #0.3
      \override TextSpanner.dash-period = #1

      %first harmonic
      \override TextSpanner.bound-details.left.text =
        \markup\small "1st harm. "
      \harmonicByFret #12 e,2\6\startTextSpan
      \harmonicByRatio #1/2 e,\6\stopTextSpan

      %second harmonic
      \override TextSpanner.bound-details.left.text =
        \markup\small "2nd harm. "
      \harmonicByFret #7 e,\6\startTextSpan
      \harmonicByRatio #1/3 e,\6
      \harmonicByFret #19 e,\6
      \harmonicByRatio #2/3 e,\6\stopTextSpan
      %\harmonicByFret #19 < e,\6 a,\5 d\4 >
      %\harmonicByRatio #2/3 < e,\6 a,\5 d\4 >

      %third harmonic
      \override TextSpanner.bound-details.left.text =
        \markup\small "3rd harm. "
      \harmonicByFret #5 e,\6\startTextSpan
      \harmonicByRatio #1/4 e,\6
      \harmonicByFret #24 e,\6
      \harmonicByRatio #3/4 e,\6\stopTextSpan
      \break

      %fourth harmonic
      \override TextSpanner.bound-details.left.text =
        \markup\small "4th harm. "
      \harmonicByFret #4 e,\6\startTextSpan
      \harmonicByRatio #1/5 e,\6
      \harmonicByFret #9 e,\6
      \harmonicByRatio #2/5 e,\6
      \harmonicByFret #16 e,\6
      \harmonicByRatio #3/5 e,\6\stopTextSpan

      %fifth harmonic
      \override TextSpanner.bound-details.left.text =
        \markup\small "5th harm. "
      \harmonicByFret #3 e,\6\startTextSpan
      \harmonicByRatio #1/6 e,\6\stopTextSpan
      \break

      %sixth harmonic
      \override TextSpanner.bound-details.left.text =
        \markup\small "6th harm. "
      \harmonicByFret #2.7 e,\6\startTextSpan
      \harmonicByRatio #1/7 e,\6\stopTextSpan

      %seventh harmonic
      \override TextSpanner.bound-details.left.text =
        \markup\small "7th harm. "
      \harmonicByFret #2.3 e,\6\startTextSpan
      \harmonicByRatio #1/8 e,\6\stopTextSpan

      %eighth harmonic
      \override TextSpanner.bound-details.left.text =
        \markup\small "8th harm. "
      \harmonicByFret #2 e,\6\startTextSpan
      \harmonicByRatio #1/9 e,\6\stopTextSpan
    }

    \score {
      <<
        \new Staff
        \with { \omit StringNumber } {
          \new Voice {
            \clef "treble_8"
            \openStringHarmonics
          }
        }
        \new TabStaff {
          \new TabVoice {
            \openStringHarmonics
          }
        }
      >>
    }

## Posizionamento delle diteggiature della mano destra

È possibile avere un maggior controllo sul posizionamento delle diteggiature della mano destra impostando una specifica proprietà, come illustrato nell’esempio seguente.

    #(define RH rightHandFinger)

    \relative c {
      \clef "treble_8"

      \set strokeFingerOrientations = #'(up down)
      <c\RH #1 e\RH #2 g\RH #3 c\RH #4 >4

      \set strokeFingerOrientations = #'(up right down)
      <c\RH #1 e\RH #2 g\RH #3 c\RH #4 >4

      \set strokeFingerOrientations = #'(left)
      <c\RH #1 e\RH #2 g\RH #3 c\RH #4 >2

      \set strokeFingerOrientations = #'(right)
      c\RH #1
    }

## Polifonia in intavolatura

La polifonia in `TabStaff` funziona proprio come nel rigo normale.

    upper = \relative c' {
      \time 12/8
      \key e \minor
      \voiceOne
      r4. r8 e, fis g16 b g e e' b c b a g fis e
    }

    lower = \relative c {
      \key e \minor
      \voiceTwo
      r16 e d c b a g4 fis8 e fis g a b c
    }

    \score {
      <<
        \new StaffGroup = "tab with traditional" <<
          \new Staff = "guitar traditional" <<
            \clef "treble_8"
            \new Voice = "upper" \upper
            \new Voice = "lower" \lower
          >>
          \new TabStaff = "guitar tab" <<
            \new TabVoice = "upper" \upper
            \new TabVoice = "lower" \lower
          >>
        >>
      >>
    }

## Slides in tablature

Slides can be typeset in both `Staff` and `TabStaff` contexts:

    slides = {
      c'8\3(\glissando d'8\3)
      c'8\3\glissando d'8\3
      \hideNotes
      \grace { g16\glissando }
      \unHideNotes
      c'4\3
      \afterGrace d'4\3\glissando {
      \stemDown \hideNotes
      g16 }
      \unHideNotes
    }

    \score {
      <<
        \new Staff { \clef "treble_8" \slides }
        \new TabStaff { \slides }
      >>
      \layout {
        \context {
          \Score
          \override Glissando.minimum-length = #4
          \override Glissando.springs-and-rods =
                              #ly:spanner::set-spacing-rods
          \override Glissando.thickness = #2
          \omit StringNumber
          % or:
          %\override StringNumber.stencil = ##f
        }
      }
    }

## Comportamento di gambi e travature in intavolatura

La direzione dei gambi nell’intavolatura è regolata nello stesso modo della notazione tradizionale. Le travature possono essere rese orizzontali, come illustrato in questo esempio.

    \new TabStaff {
      \relative c {
        \tabFullNotation
        g16 b d g b d g b
        \stemDown
        \override Beam.concaveness = #10000
        g,,16 b d g b d g b
      }
    }

## String number extender lines

Make an extender line for string number indications, showing that a series of notes is supposed to be played all on the same string.

    stringNumberSpanner =
      #(define-music-function (StringNumber) (string?)
        #{
          \override TextSpanner.style = #'solid
          \override TextSpanner.font-size = #-5
          \override TextSpanner.bound-details.left.stencil-align-dir-y = #CENTER
          \override TextSpanner.bound-details.left.text =
            \markup { \circle \number $StringNumber }
        #})

    \relative c {
      \clef "treble_8"
      \stringNumberSpanner "5"
      \textSpannerDown
      a8\startTextSpan
      b c d e f\stopTextSpan
      \stringNumberSpanner "4"
      g\startTextSpan a
      bes4 a g2\stopTextSpan
    }

#### LilyPond — Frammenti v2.24.4 (ramo stabile).