%% Generated by lilypond-book
%% Options: [exampleindent=10.16\mm,indent=0\mm,line-width=160\mm,paper-height=845.047\pt,paper-width=597.508\pt,papersize='(cons (* 597.508 pt) (* 845.047 pt))]
\include "lilypond-book-preamble.ly"


% ****************************************************************
% Start cut-&-pastable-section
% ****************************************************************

#(ly:set-option 'eps-box-padding 3.000000)



\paper {
  #(set-paper-size '(cons (* 597.508 pt) (* 845.047 pt)))
  indent = 0\mm
  line-width = 160\mm
  % offset the left padding, also add 1mm as lilypond creates cropped
  % images with a little space on the right
  line-width = #(- line-width (* mm  3.000000) (* mm 1))
}

\layout {
  
}




% ****************************************************************
% ly snippet:
% ****************************************************************
\sourcefilename "/lilypond-2.26.0/input/regression/musicxml/71e-TabStaves.xml"
\sourcefileline 0
\version "2.26.0"
% automatically converted by musicxml2ly from -
\pointAndClickOff

%% additional definitions required by the score:
hideNote =
  \tweak Dots.transparent ##t
  \tweak NoteHead.transparent ##t
  \tweak NoteHead.no-ledgers ##t
  \tweak Stem.transparent ##t
  \tweak Accidental.transparent ##t
  \tweak Rest.transparent ##t
  \tweak TabNoteHead.transparent ##t \etc

% Change the number of staff lines to `num-lines`.
%
% The argument `clef` makes the function emit a clef with the given
% name.  If `clef` contains the substring `"percussion"` or `"tab"`,
% use both even and odd staff line positions.  If set to `""`, do the
% same but don't set `Staff.clefPosition` (which means that no clef
% gets triggered).  If `clef` is set to any other value, use even
% staff line positions only and set `Staff.clefPosition`, which
% triggers a clef if its value changes.
%
% The optional argument `properties` is an alist of properties to
% control the appearance of both the staff and the clef:
%
% * `details` is a list of staff line numbers that should be
%   displayed.  An empty list suppresses any display of staff lines;
%   omitting the argument means to display all lines.
% * `staff-color` holds the color of the staff.
% * `clef-font-size` holds the font size of the clef
% * `clef-color` holds the color of the clef.
%
% \staffLines [<properties>] <clef> <num-lines>

staffLines =
#(define-music-function (properties clef num-lines)
                        ((alist? '()) string? index?)
   (let* ((details (assoc-get 'details properties #f))
          (staff-color (assoc-get 'staff-color properties #f))
          (clef-color (assoc-get 'clef-color properties #f))
          (clef-font-size (assoc-get 'clef-font-size properties #f))
          (lines (or details (iota num-lines 1)))
          (only-even-pos (not (or (equal? clef "")
                                  (string-contains clef "percussion")
                                  (string-contains clef "tab"))))
          (offset (if only-even-pos
                      (if (even? num-lines) 1 0)
                      0))
          ;; MusicXML counts staff lines from the bottom.
          (delta (- -1 num-lines offset))
          (positions (filter (lambda (x) (<= x num-lines))
                             lines))
          (positions (map (lambda (x) (+ delta (* x 2)))
                      positions)))
     #{
       \stopStaff

       #(if staff-color
            #{
              \once \override Staff.StaffSymbol.color = #staff-color
            #})
       #(if clef-color
            #{
              \once \override Staff.Clef.color = #clef-color
            #})
       #(if clef-font-size
            #{
              \once \override Staff.Clef.font-size = #clef-font-size
            #})

       #(if (equal? clef "")
            #{
              \unset Staff.middleCPosition
              \unset Staff.middleCClefPosition
              % To suppress the clef inserted by default by LilyPond at the
              % beginning of a piece.
              \once \omit Staff.Clef
            #}
            #{ \clef #clef #})

       \override Staff.StaffSymbol.line-positions = #positions

       \applyContext
       #(lambda (ctx)
          (let* ((c (ly:context-find ctx 'Staff))
                 (clef-p (ly:context-property c 'clefPosition))
                 (middle-c-p (ly:context-property c 'middleCPosition))
                 (middle-c-clef-p (ly:context-property c 'middleCClefPosition))
                 (use-offset (not (string-contains clef "percussion")))
                 (delta (+ delta (if use-offset 6 0))))
            (when only-even-pos
              (ly:context-set-property! c 'clefPosition (+ clef-p delta))
              (ly:context-set-property! c 'forceClef #t))
            (ly:context-set-property! c 'middleCPosition (+ middle-c-p delta))
            (ly:context-set-property! c 'middleCClefPosition
                                      (+ middle-c-clef-p delta))))
       \startStaff
     #}))

D = \tweak Stem.direction #DOWN \etc
U = \tweak Stem.direction #UP \etc


\header {
  texidoc = "Some tablature staves, with explicit fingering information and
    different string tunings given in the MusicXML file."
}
\layout {
  \context {
    \Staff
    printKeyCancellation = ##f
  }
  \context {
    \Score
    autoBeaming = ##f
  }
}
PartPOneVoiceOne = \relative g {
  \staffLines "tab" 6 \key c \major \tweak Stem.transparent ##t g4 \4 \tweak
  Stem.transparent ##t e''4 \2 \tweak Stem.transparent ##t c,4 \2 \tweak
  Stem.transparent ##t e,4 \4 | % 1
  \tweak Stem.transparent ##t <gis, fis' g>4 \6 \4 \3 \tweak Stem.transparent
  ##t d'4 \5 \tweak Stem.transparent ##t gis4 \3 \tweak Stem.transparent ##t e'4
  \1 \bar "|."
}

PartPTwoVoiceOne = \relative dis' {
  \staffLines "tab" 6 \key c \major \U dis4 \2 \U gis,4 \3 \U c,4 \5 r4 | % 1
  \U fis'4 \1 \U g,4 \3 \U g4 \4 \U fis,4 \6 \bar "|."
}

PartPThreeVoiceOne = \relative ais {
  \staffLines "tab" 6 \key c \major \tweak Stem.transparent ##t ais4 \2 \tweak
  Stem.transparent ##t b,8 \5 \tweak Stem.transparent ##t a'8 \3 \hideNote r2 | % 1
  \tweak Stem.transparent ##t gis'4 \1 \tweak Stem.transparent ##t d4 \2 \tweak
  Stem.transparent ##t gis,,4 \6 \tweak Stem.transparent ##t d'4 \4 \bar "|."
}

PartPFourVoiceOne = \relative b {
  \staffLines "tab" 6 \key c \major \tweak Stem.transparent ##t b8 \3 \tweak
  Stem.transparent ##t <d, d, g a a>8 \5 \6 \6 \5 \5 \hideNote r4 \hideNote r2 | % 1
  \tweak Stem.transparent ##t d'4 \1 \tweak Stem.transparent ##t d,4 \4 \tweak
  Stem.transparent ##t a4 \5 \tweak Stem.transparent ##t d,4 \6 \bar "|."
}

PartPFiveVoiceOne = \relative g, {
  \staffLines "tab" 4 \key c \major \tweak Stem.transparent ##t g4 \1 \tweak
  Stem.transparent ##t e,4 \4 \tweak Stem.transparent ##t d'4 \2 \tweak
  Stem.transparent ##t ais'4 \2 | % 1
  \tweak Stem.transparent ##t a,4 \3 \tweak Stem.transparent ##t a4 \3 \tweak
  Stem.transparent ##t a4 \3 \tweak Stem.transparent ##t a4 \3 \bar "|."
}

PartPSixVoiceOne = \relative dis' {
  \staffLines "tab" 5 \key c \major \U dis4 \2 \U d,4 \4 \U d'4 \1 r4 | % 1
  \U g,4 \3 \U g'4 \5 \U g4 \5 \U g4 \5 \bar "|."
}

PartPSevenVoiceOne = \relative cis' {
  \staffLines "tab" 6 \key c \major \U cis4 \3 \U cis,4 \5 \U a''4 \1 \U e4 \3 | % 1
  \U d4 \2 \U f,4 \4 \U g,4 \6 \U c4 \5 \bar "|."
}

PartPEightVoiceOne = \relative e''' {
  \staffLines "tab" 4 \key c \major \U e4 \3 \U b,4 \1 \U c,4 \2 \U e4 \3 | % 1
  \U c4 \2 \U c4 \2 \U c4 \2 \U c4 \2 \bar "|."
}


% The score definition
\score {
  <<
    \new StaffGroup <<
      \new TabStaff = "P1" \with {
        stringTunings = #`( ,(ly:make-pitch 0 2 0) ,(ly:make-pitch -1 6 0)
        ,(ly:make-pitch -1 4 0) ,(ly:make-pitch -1 1 0) ,(ly:make-pitch -2 5 0)
        ,(ly:make-pitch -2 2 0) )
      } <<
        \set TabStaff.instrumentName = "Guitar"
        \set TabStaff.shortInstrumentName = "Gtr."
        \context TabStaff <<
          \mergeDifferentlyDottedOn
          \mergeDifferentlyHeadedOn
          \context TabVoice = "PartPOneVoiceOne" {
            \PartPOneVoiceOne
          }
        >>
      >>
      \new TabStaff = "P2" \with {
        stringTunings = #`( ,(ly:make-pitch 0 2 0) ,(ly:make-pitch -1 6 0)
        ,(ly:make-pitch -1 4 0) ,(ly:make-pitch -1 1 0) ,(ly:make-pitch -2 5 0)
        ,(ly:make-pitch -2 2 0) )
      } <<
        \set TabStaff.instrumentName = "Guitar"
        \set TabStaff.shortInstrumentName = "Gtr."
        \context TabStaff <<
          \mergeDifferentlyDottedOn
          \mergeDifferentlyHeadedOn
          \context TabVoice = "PartPTwoVoiceOne" {
            \PartPTwoVoiceOne
          }
        >>
      >>
      \new TabStaff = "P3" \with {
        stringTunings = #`( ,(ly:make-pitch 0 2 0) ,(ly:make-pitch -1 5 0)
        ,(ly:make-pitch -1 3 1) ,(ly:make-pitch -1 1 0) ,(ly:make-pitch -2 5 0)
        ,(ly:make-pitch -2 1 0) )
      } <<
        \set TabStaff.instrumentName = "Guitar"
        \set TabStaff.shortInstrumentName = "Gtr."
        \context TabStaff <<
          \mergeDifferentlyDottedOn
          \mergeDifferentlyHeadedOn
          \context TabVoice = "PartPThreeVoiceOne" {
            \PartPThreeVoiceOne
          }
        >>
      >>
      \new TabStaff = "P4" \with {
        stringTunings = #`( ,(ly:make-pitch 0 1 0) ,(ly:make-pitch -1 6 0)
        ,(ly:make-pitch -1 4 0) ,(ly:make-pitch -1 1 0) ,(ly:make-pitch -2 5 0)
        ,(ly:make-pitch -2 1 0) )
      } <<
        \set TabStaff.instrumentName = "Guitar"
        \set TabStaff.shortInstrumentName = "Gtr."
        \context TabStaff <<
          \mergeDifferentlyDottedOn
          \mergeDifferentlyHeadedOn
          \context TabVoice = "PartPFourVoiceOne" {
            \PartPFourVoiceOne
          }
        >>
      >>
      \new TabStaff = "P5" \with {
        stringTunings = #`( ,(ly:make-pitch -2 4 0) ,(ly:make-pitch -2 1 0)
        ,(ly:make-pitch -3 5 0) ,(ly:make-pitch -3 2 0) )
      } <<
        \set TabStaff.instrumentName = "Bass Guitar"
        \set TabStaff.shortInstrumentName = "Bass"
        \context TabStaff <<
          \mergeDifferentlyDottedOn
          \mergeDifferentlyHeadedOn
          \context TabVoice = "PartPFiveVoiceOne" {
            \PartPFiveVoiceOne
          }
        >>
      >>
      \new TabStaff = "P6" \with {
        stringTunings = #`( ,(ly:make-pitch 0 1 0) ,(ly:make-pitch 0 0 0)
        ,(ly:make-pitch -1 4 0) ,(ly:make-pitch -1 1 0) ,(ly:make-pitch 0 4 0) )
      } <<
        \set TabStaff.instrumentName = "Banjo"
        \set TabStaff.shortInstrumentName = "Bjo."
        \context TabStaff <<
          \mergeDifferentlyDottedOn
          \mergeDifferentlyHeadedOn
          \context TabVoice = "PartPSixVoiceOne" {
            \PartPSixVoiceOne
          }
        >>
      >>
      \new TabStaff = "P7" \with {
        stringTunings = #`( ,(ly:make-pitch 0 4 0) ,(ly:make-pitch 0 1 0)
        ,(ly:make-pitch -1 5 0) ,(ly:make-pitch -1 3 0) ,(ly:make-pitch -1 0 0)
        ,(ly:make-pitch -2 4 0) )
      } <<
        \set TabStaff.instrumentName = "Lute"
        \set TabStaff.shortInstrumentName = "L."
        \context TabStaff <<
          \mergeDifferentlyDottedOn
          \mergeDifferentlyHeadedOn
          \context TabVoice = "PartPSevenVoiceOne" {
            \PartPSevenVoiceOne
          }
        >>
      >>
      \new TabStaff = "P8" \with {
        stringTunings = #`( ,(ly:make-pitch 0 4 0) ,(ly:make-pitch 0 0 0)
        ,(ly:make-pitch 0 2 0) ,(ly:make-pitch 0 5 0) )
      } <<
        \set TabStaff.instrumentName = "Ukulele"
        \set TabStaff.shortInstrumentName = "Uk."
        \context TabStaff <<
          \override Staff.BarLine.allow-span-bar = ##f
          \mergeDifferentlyDottedOn
          \mergeDifferentlyHeadedOn
          \context TabVoice = "PartPEightVoiceOne" {
            \PartPEightVoiceOne
          }
        >>
      >>
    >>
  >>
  \layout {}
  % To create MIDI output, uncomment the following line:
  % \midi { \tempo 4 = 100 }
}




% ****************************************************************
% end ly snippet
% ****************************************************************
