%% DO NOT EDIT this file manually; it was automatically
%% generated from the LilyPond Wiki
%% (https://wiki.lilypond.community).
%%
%% Make any changes in the Wiki itself, or in
%% `Documentation/snippets/new/`, then run
%% `scripts/auxiliar/makelsr.pl`.
%%
%% This file is in the public domain.

\version "2.24.0"

\header {
  categories = "Headword"

  texidoc = "
Fretted headword.
"

  doctitle = "Fretted headword"
} % begin verbatim


% Johann Kaspar Mertz, Opern-Revue op. 8
% No. 17 ("Bellini, Norma")
% measures 123 - 133

%%%% shortcuts
% fingering orientations
sfol = \set fingeringOrientations = #'(left)
sfor = \set fingeringOrientations = #'(right)
sfod = \set fingeringOrientations = #'(down)
sfou = \set fingeringOrientations = #'(up)

% string number orientations
ssnol = \set stringNumberOrientations = #'(left)  %(down right up)
ssnou = \set stringNumberOrientations = #'(up)
ssnod = \set stringNumberOrientations = #'(down)
ssnor = \set stringNumberOrientations = #'(right)

% define fingering offset
FO = #(define-music-function (offsetX offsetY) (number? number?)
#{
  \once \override Voice.Fingering.extra-offset = #(cons offsetX offsetY)
#})

% markups
rit = \markup \bold \italic "rit."
dimin = \markup \italic "dim."
benmarcato = \markup \italic \bold "il canto ben marcato"
pdolce = #(make-dynamic-script
           (markup #:line (#:dynamic "p" #:normal-text #:italic "dol.")))

% triplet
T = \tuplet 3/2 \etc


%%% THE MUSIC %%%

melody = \relative c {
  \voiceOne
  \clef "treble_8"
  \key d \major
  \once \omit Staff.TimeSignature
  \time 4/4

  \sfol
  e,32[ a' c e] e,[ a c e] e,,[ a' c e] e,[ a c e]
    f4\rest <e'-4>4-> | % m. 1
  e,,,32[ gis' b e] e,[ gis b e] e,,[ gis' b e] e,[ gis b e]
    f4\rest \FO #0.4 #0.5 <gis-1 e'-4>4 | % m. 2
  d4\rest <b e>-> d4\rest^\rit <b e>4-> | % m. 3
  <gis b e>1 \bar "||" % m. 4

  \tempo \markup \larger \italic "Andantino"
  \key a \minor
  \time 4/4
  R1 | % m. 5
  e'4^\benmarcato e8. d16-4
    d4-4 \T { \sfou \FO #-0.3 #0.6 <c-2>4 b8 } | % m. 6
  \FO #-0.3 #0.3 <a-3>4 \T { c4 b8 } a4 e'8. e16 | % m. 7
  \FO #-0.3 #0.3 <g-4>4 \T { \sfol \FO #0.3 #0.0 <f-1>4 e8 }
    e4 \T { \sfou <d-4>4 c8 } | % m. 8
  b4 \T { d4-4 c8 } \sfou \FO #-1.7 #-1.5 <b-0>4 e | % m. 9
  e4 e8. d16-4 d4 \T { c4 b8 } | % m. 10
  \T { a4 a8 b4 c8 }
    \sfou \FO #-0.3 #0.3 <d-4>4^\< \T { e4 <d f>8\! } | % m. 11
}

bass = \relative c {
  \voiceTwo
  \key d \major
  \time 4/4

  e,8\fp[ e'] e,[ e'] e, \sfol <c''-1> <a'-2> c, | % m. 1
  e,,8\fp[ e'] e,[ e']
    e, \sfod \FO #0.2 #-0.2 <b''-1> \sfol \FO #0.3 #0.0 <e-1> b | % m. 2
  e,,8 e' gis e e, e' gis_\dimin e | % m. 3
  e,1 | % m. 4

  \T { a8\p e' a c a e a, e' a c a e } | % m. 5
  \T { a,8\pdolce e' a c a e }
    \T { e,8 \sfou <e'-3> <gis-1> c gis e } | % m. 6
  \T { a,8 <e'-2> a c e, b' a, e' a c a e } | % m. 7
  \T { f,8 f' a \sfol \FO #0.3 #-0.5 <d-4> a f }
    \T { fis, d' a' d a d, } | % m. 8
  \T { <g,-3>8 d' g d' g, d }
    \T { \sfod <gis,-4> \sfou <e'-2> <gis-1> b gis e } | % m. 9
  \T { a,8 e' a c a e e, e' gis c gis e } | % m. 10
  \T { a,8 e' a b a e f, f' a d a f } | % m. 11
}

\new Staff = "guitar" <<
  \context Voice = "upper" { \melody }
  \context Voice = "lower" { \bass }
>>

\layout {
  \context {
    \Score
    \remove "Bar_number_engraver"
    \override Fingering.staff-padding = #'()
    \omit TupletNumber
    \override TupletBracket.bracket-visibility = ##f
  }
}

\paper {
  system-system-spacing.padding = 3
}
