Preludium H Moll

Zur Navigation springen Zur Suche springen

#(define sop-1 #{ \relative {
  \repeat unfold 2 { h'16 d e fis e fis e d }
                  }
   #})

sop =
\relative {
  \key d \major

  $sop-1
  \repeat unfold 2 { h'16 e fis g fis g fis e }
  \repeat unfold 2 { ais,16 cis d e d e d cis }
  $sop-1
  \voiceOne
  g2 fis fis e
  e d g g
  g fis e e'
  d h g c
  h g e a
  g d' cis h
  ais ais a!-\markup \italic \fontsize #-1 { sempre rit. e dimenuendo }
  gis
  g! fis eis fis
  fis-\markup \italic \fontsize #-1 { sempre piú rit. al fine } h h ais
  \bar ":|."
  \oneVoice
  < h fis dis >1\fermata
  \bar "|."
}

alt = \relative {
  s1 * 4
  \voiceTwo
  g'16 cis d e d e d cis
  fis, cis' d e d e d cis
  fis, h cis d cis d cis h
  e, h' cis d cis d cis h
  e, cis' d e d e d cis d, d' e fis e fis e d
  g, h cis d cis d cis h g cis d e d e d cis
  g e' fis g fis g fis e fis, fis' g a g a g fis
  e, gis' a h a h a gis e ais h cis h cis h ais
  d, h' cis d cis d cis h h, d e fis e fis e d
  g, e' fis g fis g fis e c fis g a g a g fis
  h, g' a h a h a g g, h cis d cis d cis h
  e, cis' d e d e d cis a dis e fis e fis e dis
  g, e' fis g fis g fis e d e fis g fis g fis e
  cis e fis g fis g fis e h e fis g fis g fis e
  ais, e' fis g fis g fis e ais, e' fis g fis g fis e
  a, dis e fis e fis e dis gis, h cis d cis d cis h
  g cis d e d e d cis fis, h cis d cis d cis h
  eis, h' cis d cis d cis h
  fis cis' d e d e d cis
  fis, h cis d cis d cis h h dis e fis e fis e dis
  h e fis g fis g fis e ais, e fis g fis g fis e
}

ten = \relative {
  \key d \major
  \clef bass
  \voiceOne
  h2 d < e >1
  cis2 e h1
  \oneVoice
  < d e, h >4\arpeggio r < cis e, a, >\arpeggio r
  < cis d, a >\arpeggio r < h d, g, >\arpeggio r
  < a cis, g >\arpeggio r < a d, fis, >\arpeggio r
  < g h, e, >\arpeggio r < cis e, a, >\arpeggio r
  < e, a, d, >\arpeggio r < d' a fis d >\arpeggio r
  < h gis e d >\arpeggio r < fis' ais, fis cis >\arpeggio r
  < d fis, h, >\arpeggio r < fis d h fis >\arpeggio r
  < c g e h >\arpeggio r < d fis, d a >\arpeggio r
  < h d, g, >\arpeggio r < d h g d >\arpeggio r
  < a e cis g >\arpeggio r < h dis, h fis >\arpeggio r
  < g h, e, >\arpeggio r < h g e h >\arpeggio r
  < cis g e ais, >\arpeggio r < d h g d >\arpeggio r
  < e ais, g cis, >\arpeggio r < ais, e fis, >\arpeggio r
  \stemUp
  fis,32( dis' h'16) r8 r4 eis,,32( h' gis'16) r8 r4
  e,!32( h' g'!16) r8 r4 fis,32( d' h'16) r8 r4
  \omit TupletBracket
  \tupletDown
  \tuplet 3/2 { fis,32([ cis' gis' } h16)] r8 r4
  \tuplet 3/2 { fis,32([ cis' fis } ais16)] r8 r4
  \tuplet 3/2 { h,,32([ h' fis' } d'16)] r8 r4
  \stemDown \tupletUp
  \tuplet 3/2 { h,32([ fis' a! } dis16)] r8 r4
  \tuplet 3/2 { h,32([ e g } e'16)] r8 r4
  \tuplet 3/2 { h,32([ e g } cis16)] r8 r4
  < h fis h, >1\fermata
}

bas = \relative {
  \voiceTwo
  \arp #-1.5 #3
  < fis d h >4\arpeggio r
  \arp #0 #4
  < fis h >4\arpeggio r
  \arp #-1.5 #4
  < g e h >4\arpeggio r r2
  \arp #-1.5 #3
  < fis h, >4\arpeggio r
  \arp #0.5 #4
  < fis cis' >\arpeggio r
  \arp #-1.5 #3
  < fis h, >\arpeggio r r2
}

Dyn = {
  s1\p\< s\!
  \hrechts #18
  s1\> s2 s\!
  s\mp
  \hrechts #3
  s\> s s\!
  \hlinks #4
  s1\< s\!
  s\>
  \hlinks #6
  s\mf\<
  \hrechts #3
  s2\>
  s4\!
  \hrechts #3
  s\< s2 s\!
  \hrechts #3
  s2\> s\!
  s1\< s2\!
  s\f s1
  s\> s\mf
  s s s s s\pp
}

ped = {
  \repeat unfold 2 {
    \repeat unfold 2 { s4-\markup { \musicglyph #"pedal.Ped" } s32 s-\markup { \musicglyph #"pedal.*" } s16 s8 }
    s2-\markup { \musicglyph #"pedal.Ped" } s32 s-\markup { \musicglyph #"pedal.*" } s16 s8 s4
  }
  \repeat unfold 2 { s4-\markup { \musicglyph #"pedal.Ped" } s32 s-\markup { \musicglyph #"pedal.*" } s16 s8 }
  s1-\markup \italic sim.
}

Struktur = {
  \override Score.NonMusicalPaperColumn.page-break-permission = ##f
  \time 4/4
  \tempo 2=50
  \mark \markup \fontsize #-2 \italic { sempre legato }
  s1 * 10 \pageBreak
}

mypaper =
\paper {
  top-margin = 20\mm
  ragged-bottom = ##t
  ragged-last-bottom = ##t
  bottom-margin = 20\mm
  indent = #0
  line-width = 170\mm
  markup-system-spacing.padding = #4
}

kopf=\header {
  title = "Preludium H Moll"
  subtitle = "nach Bach BWV 855a"
  composer = "Alexander Siloti (1863-1945)"
}

\bookpart {
  \kopf
  \mypaper
  \tocItem \markup "Preludium H Moll (Alexander Siloti nach Bach)"
  \indexItem "Preludium H Moll (Siloti nach Bach)" \markup "Preludium H Moll (Siloti nach Bach)"
  \score
  {
    \klavierpd \sop \alt \ten \bas \Struktur \Dyn \ped
  }
  \markup { piú = mehr }
}

#(define sop-1 #{ \relative {
  \repeat unfold 2 { h'16 d e fis e fis e d }
                  }
   #})

sop =
\relative {
  \key d \major

  $sop-1
  \repeat unfold 2 { h'16 e fis g fis g fis e }
  \repeat unfold 2 { ais,16 cis d e d e d cis }
  $sop-1
  \voiceOne
  g2 fis fis e
  e d g g
  g fis e e'
  d h g c
  h g e a
  g d' cis h
  ais ais a!-\markup \italic \fontsize #-1 { sempre rit. e dimenuendo }
  gis
  g! fis eis fis
  fis-\markup \italic \fontsize #-1 { sempre piú rit. al fine } h h ais
  \bar ":|."
  \oneVoice
  < h fis dis >1\fermata
  \bar "|."
}

alt = \relative {
  s1 * 4
  \voiceTwo
  g'16 cis d e d e d cis
  fis, cis' d e d e d cis
  fis, h cis d cis d cis h
  e, h' cis d cis d cis h
  e, cis' d e d e d cis d, d' e fis e fis e d
  g, h cis d cis d cis h g cis d e d e d cis
  g e' fis g fis g fis e fis, fis' g a g a g fis
  e, gis' a h a h a gis e ais h cis h cis h ais
  d, h' cis d cis d cis h h, d e fis e fis e d
  g, e' fis g fis g fis e c fis g a g a g fis
  h, g' a h a h a g g, h cis d cis d cis h
  e, cis' d e d e d cis a dis e fis e fis e dis
  g, e' fis g fis g fis e d e fis g fis g fis e
  cis e fis g fis g fis e h e fis g fis g fis e
  ais, e' fis g fis g fis e ais, e' fis g fis g fis e
  a, dis e fis e fis e dis gis, h cis d cis d cis h
  g cis d e d e d cis fis, h cis d cis d cis h
  eis, h' cis d cis d cis h
  fis cis' d e d e d cis
  fis, h cis d cis d cis h h dis e fis e fis e dis
  h e fis g fis g fis e ais, e fis g fis g fis e
}

ten = \relative {
  \key d \major
  \clef bass
  \voiceOne
  h2 d < e >1
  cis2 e h1
  \oneVoice
  < d e, h >4\arpeggio r < cis e, a, >\arpeggio r
  < cis d, a >\arpeggio r < h d, g, >\arpeggio r
  < a cis, g >\arpeggio r < a d, fis, >\arpeggio r
  < g h, e, >\arpeggio r < cis e, a, >\arpeggio r
  < e, a, d, >\arpeggio r < d' a fis d >\arpeggio r
  < h gis e d >\arpeggio r < fis' ais, fis cis >\arpeggio r
  < d fis, h, >\arpeggio r < fis d h fis >\arpeggio r
  < c g e h >\arpeggio r < d fis, d a >\arpeggio r
  < h d, g, >\arpeggio r < d h g d >\arpeggio r
  < a e cis g >\arpeggio r < h dis, h fis >\arpeggio r
  < g h, e, >\arpeggio r < h g e h >\arpeggio r
  < cis g e ais, >\arpeggio r < d h g d >\arpeggio r
  < e ais, g cis, >\arpeggio r < ais, e fis, >\arpeggio r
  \stemUp
  fis,32( dis' h'16) r8 r4 eis,,32( h' gis'16) r8 r4
  e,!32( h' g'!16) r8 r4 fis,32( d' h'16) r8 r4
  \omit TupletBracket
  \tupletDown
  \tuplet 3/2 { fis,32([ cis' gis' } h16)] r8 r4
  \tuplet 3/2 { fis,32([ cis' fis } ais16)] r8 r4
  \tuplet 3/2 { h,,32([ h' fis' } d'16)] r8 r4
  \stemDown \tupletUp
  \tuplet 3/2 { h,32([ fis' a! } dis16)] r8 r4
  \tuplet 3/2 { h,32([ e g } e'16)] r8 r4
  \tuplet 3/2 { h,32([ e g } cis16)] r8 r4
  < h fis h, >1\fermata
}

bas = \relative {
  \voiceTwo
  \arp #-1.5 #3
  < fis d h >4\arpeggio r
  \arp #0 #4
  < fis h >4\arpeggio r
  \arp #-1.5 #4
  < g e h >4\arpeggio r r2
  \arp #-1.5 #3
  < fis h, >4\arpeggio r
  \arp #0.5 #4
  < fis cis' >\arpeggio r
  \arp #-1.5 #3
  < fis h, >\arpeggio r r2
}

Dyn = {
  s1\p\< s\!
  \hrechts #18
  s1\> s2 s\!
  s\mp
  \hrechts #3
  s\> s s\!
  \hlinks #4
  s1\< s\!
  s\>
  \hlinks #6
  s\mf\<
  \hrechts #3
  s2\>
  s4\!
  \hrechts #3
  s\< s2 s\!
  \hrechts #3
  s2\> s\!
  s1\< s2\!
  s\f s1
  s\> s\mf
  s s s s s\pp
}

ped = {
  \repeat unfold 2 {
    \repeat unfold 2 { s4-\markup { \musicglyph #"pedal.Ped" } s32 s-\markup { \musicglyph #"pedal.*" } s16 s8 }
    s2-\markup { \musicglyph #"pedal.Ped" } s32 s-\markup { \musicglyph #"pedal.*" } s16 s8 s4
  }
  \repeat unfold 2 { s4-\markup { \musicglyph #"pedal.Ped" } s32 s-\markup { \musicglyph #"pedal.*" } s16 s8 }
  s1-\markup \italic sim.
}

Struktur = {
  \override Score.NonMusicalPaperColumn.page-break-permission = ##f
  \time 4/4
  \tempo 2=50
  \mark \markup \fontsize #-2 \italic { sempre legato }
  s1 * 10 \pageBreak
}

mypaper =
\paper {
  top-margin = 20\mm
  ragged-bottom = ##t
  ragged-last-bottom = ##t
  bottom-margin = 20\mm
  indent = #0
  line-width = 170\mm
  markup-system-spacing.padding = #4
}

kopf=\header {
  title = "Preludium H Moll"
  subtitle = "nach Bach BWV 855a"
  composer = "Alexander Siloti (1863-1945)"
}

\bookpart {
  \kopf
  \mypaper
  \tocItem \markup "Preludium H Moll (Alexander Siloti nach Bach)"
  \indexItem "Preludium H Moll (Siloti nach Bach)" \markup "Preludium H Moll (Siloti nach Bach)"
  \score
  {
    \klavierpd \sop \alt \ten \bas \Struktur \Dyn \ped
  }
  \markup { piú = mehr }
}

auf einen der Tabs klicken; der Inhalt wird nicht gleich komplett eingeblendet, um die Übersichtlichkeit der Vorlagendokumentation zu erhalten

#(define-public (add-index-item! markup-symbol text sorttext) #f)
#(define-public (index-items) #f)

#(let ((index-item-list (list)))
   (set! add-index-item!
         (lambda (markup-symbol text sorttext)
           (let ((label (gensym "index")))
             (set! index-item-list
                   ;; We insert index items sorted from the beginning on and do
                   ;; not sort them later - this saves pretty much computing time
                   (insert-alphabetical-sorted! (list label markup-symbol text sorttext)
                     index-item-list))
             (make-music 'EventChord
               'page-marker #t
               'page-label label
               'elements (list (make-music 'LabelEvent
                                 'page-label label))))))
   (set! index-items (lambda ()
                       index-item-list)))

#(define (insert-alphabetical-sorted! iitem ilist)
   (if
    (null? ilist) (list iitem)
    (if
     (string-ci<? (cadddr iitem) (cadddr (car ilist))) (cons iitem ilist)
     (cons (car ilist) (insert-alphabetical-sorted! iitem (cdr ilist)))
     )
    )
   )

% \paper {
%   indexTitleMarkup = \markup \column {
%     \fontsize #5 \sans \bold \fill-line { \null "Alphabetical Index" \null }
%     \hspace #1
%   }
%   indexItemMarkup = \markup \large \fill-line {
%     \fromproperty #'index:text
%     \fromproperty #'index:page
%   }
% }

#(define-markup-list-command (index layout props) ()
   ( _i "Outputs an alphabetical sorted index, using the paper
  variable @code{indexTitleMarkup} for its title, then the list of
  lines built using the @code{indexItem} music function
  Usage: @code{\\markuplist \\index}" )
   (cons (interpret-markup layout props
           (ly:output-def-lookup layout 'indexTitleMarkup))
     (space-lines (chain-assoc-get 'baseline-skip props)
       (map (lambda (index-item)
              (let ((label (car index-item))
                    (index-markup (cadr index-item))
                    (text (caddr index-item)))
                (interpret-markup
                 layout
                 (cons (list (cons 'index:page
                               (markup #:page-ref label "XXX" "?"))
                         (cons 'index:text text))
                   props)
                 (ly:output-def-lookup layout index-markup))))
         (index-items)))))

indexItem =
#(define-music-function (sorttext text) (string? markup?)
   "Add a line to the alphabetical index, using the @code{indexItemMarkup} paper variable markup."
   (add-index-item! 'indexItemMarkup text sorttext))
\bookpart {
  \header {
    title = ##f
    subtitle = ##f
    subsubtitle = ##f
    poet = ##f
    composer = ##f
    piece = ##f
    opus = ##f
  }
  \paper {
    \VerzeichnisPaper
    oddHeaderMarkup =
    \markup \on-the-fly #not-single-page \huge \column {
      \null \vspace #2
      \bold \sans
      \fill-line { \null " " \null }
      \vspace #2
    }
    evenHeaderMarkup = \oddHeaderMarkup
    evenFooterMarkup = ""
    oddFooterMarkup = #evenFooterMarkup
    two-sided = ##t
    markup-markup-spacing  = #'((basic-distance . 5)
                                (minimum-distance . 3)
                                (padding . 5)
                                (stretchability . 50))
    two-sided = ##t
    markup-markup-spacing  = #'((basic-distance . 5)
                                (minimum-distance . 3)
                                (padding . 5)
                                (stretchability . 50))
    %oddFooterMarkup = #evenFooterMarkup
    tocItemMarkup = \markup \fill-with-pattern #1 #RIGHT .
    \fromproperty #'toc:text %\small \number
    \fromproperty #'toc:page
    %\tocItemWithDotsMarkup
    tocTitleMarkup = \markup \huge \column {
      \null \vspace #2
      \bold \sans
      \fill-line { \null "Notensammlung für Klavier" \null }
      %\null
      \vspace #2
    }
  }

  \label #'toc
  \markuplist \table-of-contents
  \pageBreak \markup \null
  \pageBreak \markup \null
  \pageBreak \markup \null
}

\bookpart {
  \header {
    title = ##f
    subtitle = ##f
    subsubtitle = ##f
    poet = ##f
    composer = ##f
    piece = ##f
    opus = ##f
  }
  \paper {
    \VerzeichnisPaper
    oddHeaderMarkup =
    \markup \on-the-fly #not-single-page \huge \column {
      \null \vspace #2
      \bold \sans
      \fill-line { \null " " \null }
      \vspace #2
    }
    evenHeaderMarkup = \oddHeaderMarkup
    evenFooterMarkup = ##f
    oddFooterMarkup = #evenFooterMarkup
    two-sided = ##t
    markup-markup-spacing  = #'((basic-distance . 5)
                                (minimum-distance . 3)
                                (padding . 5)
                                (stretchability . 50))
    %oddFooterMarkup = #evenFooterMarkup
    tocActMarkup = \markup \fontsize #1 \column {
      \hspace #1
      \line { \italic \fromproperty #'toc:text \null }
      \hspace #1
    }
    indexTitleMarkup = \markup \huge \column {
      \null \vspace #2
      \bold \sans
      \fill-line { \null "Klavierstücke alphabetisch" \null }
      %\null
      \vspace #2
    }
    indexItemMarkup = \markup \fill-line {
      \fill-with-pattern #1 #RIGHT .
      \fromproperty #'index:text
      %\small \number
      \fromproperty #'index:page
    }
    % }
%%%%%%%%%%%%%%%%%%%%%%%%%%% }
  }
  \label #'indx
  \markuplist \index
  \pageBreak \markup \null
}
#(define-public (add-index-item! markup-symbol text sorttext) #f)
#(define-public (index-items) #f)

#(let ((index-item-list (list)))
   (set! add-index-item!
         (lambda (markup-symbol text sorttext)
           (let ((label (gensym "index")))
             (set! index-item-list
                   ;; We insert index items sorted from the beginning on and do
                   ;; not sort them later - this saves pretty much computing time
                   (insert-alphabetical-sorted! (list label markup-symbol text sorttext)
                     index-item-list))
             (make-music 'EventChord
               'page-marker #t
               'page-label label
               'elements (list (make-music 'LabelEvent
                                 'page-label label))))))
   (set! index-items (lambda ()
                       index-item-list)))

#(define (insert-alphabetical-sorted! iitem ilist)
   (if
    (null? ilist) (list iitem)
    (if
     (string-ci<? (cadddr iitem) (cadddr (car ilist))) (cons iitem ilist)
     (cons (car ilist) (insert-alphabetical-sorted! iitem (cdr ilist)))
     )
    )
   )

% \paper {
%   indexTitleMarkup = \markup \column {
%     \fontsize #5 \sans \bold \fill-line { \null "Alphabetical Index" \null }
%     \hspace #1
%   }
%   indexItemMarkup = \markup \large \fill-line {
%     \fromproperty #'index:text
%     \fromproperty #'index:page
%   }
% }

#(define-markup-list-command (index layout props) ()
   ( _i "Outputs an alphabetical sorted index, using the paper
  variable @code{indexTitleMarkup} for its title, then the list of
  lines built using the @code{indexItem} music function
  Usage: @code{\\markuplist \\index}" )
   (cons (interpret-markup layout props
           (ly:output-def-lookup layout 'indexTitleMarkup))
     (space-lines (chain-assoc-get 'baseline-skip props)
       (map (lambda (index-item)
              (let ((label (car index-item))
                    (index-markup (cadr index-item))
                    (text (caddr index-item)))
                (interpret-markup
                 layout
                 (cons (list (cons 'index:page
                               (markup #:page-ref label "XXX" "?"))
                         (cons 'index:text text))
                   props)
                 (ly:output-def-lookup layout index-markup))))
         (index-items)))))

indexItem =
#(define-music-function (sorttext text) (string? markup?)
   "Add a line to the alphabetical index, using the @code{indexItemMarkup} paper variable markup."
   (add-index-item! 'indexItemMarkup text sorttext))
\bookpart {
  \header {
    title = ##f
    subtitle = ##f
    subsubtitle = ##f
    poet = ##f
    composer = ##f
    piece = ##f
    opus = ##f
  }
  \paper {
    \VerzeichnisPaper
    oddHeaderMarkup =
    \markup \on-the-fly #not-single-page \huge \column {
      \null \vspace #2
      \bold \sans
      \fill-line { \null " " \null }
      \vspace #2
    }
    evenHeaderMarkup = \oddHeaderMarkup
    evenFooterMarkup = ""
    oddFooterMarkup = #evenFooterMarkup
    two-sided = ##t
    markup-markup-spacing  = #'((basic-distance . 5)
                                (minimum-distance . 3)
                                (padding . 5)
                                (stretchability . 50))
    two-sided = ##t
    markup-markup-spacing  = #'((basic-distance . 5)
                                (minimum-distance . 3)
                                (padding . 5)
                                (stretchability . 50))
    %oddFooterMarkup = #evenFooterMarkup
    tocItemMarkup = \markup \fill-with-pattern #1 #RIGHT .
    \fromproperty #'toc:text %\small \number
    \fromproperty #'toc:page
    %\tocItemWithDotsMarkup
    tocTitleMarkup = \markup \huge \column {
      \null \vspace #2
      \bold \sans
      \fill-line { \null "Notensammlung für Klavier" \null }
      %\null
      \vspace #2
    }
  }

  \label #'toc
  \markuplist \table-of-contents
  \pageBreak \markup \null
  \pageBreak \markup \null
  \pageBreak \markup \null
}

\bookpart {
  \header {
    title = ##f
    subtitle = ##f
    subsubtitle = ##f
    poet = ##f
    composer = ##f
    piece = ##f
    opus = ##f
  }
  \paper {
    \VerzeichnisPaper
    oddHeaderMarkup =
    \markup \on-the-fly #not-single-page \huge \column {
      \null \vspace #2
      \bold \sans
      \fill-line { \null " " \null }
      \vspace #2
    }
    evenHeaderMarkup = \oddHeaderMarkup
    evenFooterMarkup = ##f
    oddFooterMarkup = #evenFooterMarkup
    two-sided = ##t
    markup-markup-spacing  = #'((basic-distance . 5)
                                (minimum-distance . 3)
                                (padding . 5)
                                (stretchability . 50))
    %oddFooterMarkup = #evenFooterMarkup
    tocActMarkup = \markup \fontsize #1 \column {
      \hspace #1
      \line { \italic \fromproperty #'toc:text \null }
      \hspace #1
    }
    indexTitleMarkup = \markup \huge \column {
      \null \vspace #2
      \bold \sans
      \fill-line { \null "Klavierstücke alphabetisch" \null }
      %\null
      \vspace #2
    }
    indexItemMarkup = \markup \fill-line {
      \fill-with-pattern #1 #RIGHT .
      \fromproperty #'index:text
      %\small \number
      \fromproperty #'index:page
    }
    % }
%%%%%%%%%%%%%%%%%%%%%%%%%%% }
  }
  \label #'indx
  \markuplist \index
  \pageBreak \markup \null
}
#(define ((chord-name->german-markup-text-alteration B-instead-of-Bb) pitch lowercase?)

   (define (pitch-alteration-semitones pitch)
     (inexact->exact (round (* (ly:pitch-alteration pitch) 2))))

   (define (conditional-string-downcase str condition)
     (if condition
         (string-downcase str)
         str))

   (let* ((name (ly:pitch-notename pitch))
          (alt-semitones  (pitch-alteration-semitones pitch))
          (n-a (if (member (cons name alt-semitones) `((6 . -1) (6 . -1)))
                   (cons 7 (+ (if B-instead-of-Bb 1 1) alt-semitones))
                   (cons name alt-semitones))))
     (make-line-markup
      (list
       (make-simple-markup
        (conditional-string-downcase
         (vector-ref #("C" "D" "E" "F" "G" "A" "H" "B") (car n-a))
         lowercase?))
       (let ((alteration (/ (cdr n-a) 2)))
         (cond
          ((and (equal? lowercase? #f) (= alteration FLAT) (= (car n-a) 7)) (make-simple-markup ""))
          ((and (= alteration FLAT) (or (= (car n-a) 5) (= (car n-a) 2) )) (make-simple-markup "s"))
          ((= alteration FLAT) (make-simple-markup "es"))
          ((and (= alteration DOUBLE-FLAT) (or (= (car n-a) 5)(= (car n-a) 2) )) (make-simple-markup "ses"))
          ((= alteration DOUBLE-FLAT) (make-simple-markup "eses"))
          ((= alteration SHARP) (make-simple-markup "is"))
          ((= alteration DOUBLE-SHARP) (make-simple-markup "isis"))
          (else empty-markup)))))))

#(define germanChords (chord-name->german-markup-text-alteration #t))

make-midi-list =
#(define-void-function (name score tempolist)
   ((string? #f) ly:score? list?)
   (for-each
    (lambda (tempo)
      (ly:book-process
       (apply
        ly:make-book
        $defaultpaper
        $defaultheader
        (list score))
       $defaultpaper
       #{
         \midi {
           \tempo 4 = $tempo
         }
       #}
       (format #f "~a_~a"
         (or name "midi")
         tempo)))
    tempolist))

editorsColor = #grey
ed =
#(define-music-function (grob col mus)
   (symbol-list-or-symbol? (color? editorsColor) ly:music?)
   ;; for abbreviations, we need a symbol instead of a one-element list
   (let ((grob (if (= 1 (length grob)) (car grob) grob)))
     (case
      grob
      ;; define abbreviations
      ;; which call the function recursively with a value
      ;; leading into the (else) clause
      ;; (or to _another_ abbreviation)
      ;; be careful to avoid infinite recursion :-)
      ;; – abbreviation names must not be actual grob names
      ;; (at least if they’re used in the corresponding
      ;; clause) or recursion will be infinite also
      ;; It is recommended to use singular forms only
      ;; for abbreviations.
      ((Caut) #{ \ed Staff.AccidentalCautionary #})
      ((LedgerLine) #{ % barline is workaround to issue 3949
        \stopStaff
        \ed Staff.LedgerLineSpanner {
          \startStaff
          $mus
          \stopStaff
        }
        \startStaff #})
      ((Mmr) #{ \ed MultiMeasureRest $mus #})
      ((Note) #{ \ed Staff.Accidental
                 \ed Beam
                 \ed Dots
                 \ed Flag
                 \ed LedgerLine
                 \ed NoteHead
                 \ed Rest
                 \ed Stem $mus #})
      ((Pitch) #{ \ed NoteHead $mus #})
      ((Suggest) #{ \ed Staff.AccidentalSuggestion #})
      ((StemWithFlag) #{ \ed Stem \ed Flag $mus #})
      ((Tuplet) #{ \ed TupletNumber \ed TupletBracket $mus #})
      ;; ‘normal’ case
      (else
       #{
         \override $grob . color = #col
         $mus
         \revert $grob . color
       #}))))

#(define new-stil
   (lambda (grob)
     (let* ((sz (ly:grob-property grob 'font-size 0.0))
            (mult (magstep sz))
            (dir (ly:grob-property grob 'direction))
            (thick 0.15)
            (radius 0.7)
            (scaled-radius (* mult radius))
            (ps-command-string
             (format #f
               "
             0 ~a translate
             ~a setlinewidth
             ~a 0 moveto
             0 0 ~a 180 0 ~a
             stroke
             "
               ;mult
               (* thick dir)
               thick
               (- scaled-radius)
               scaled-radius
               (if (negative? dir) "arcn" "arc"))))

       (ly:make-stencil
        (list 'embedded-ps
          (format #f
            "
              gsave currentpoint translate
              ~a
              grestore
              "
            ps-command-string))
        (cons (- scaled-radius) scaled-radius)
        (cons
         (if (negative? dir) 0 (- scaled-radius))
         (if (negative? dir) scaled-radius 0))))))

soft =
-\tweak stencil #new-stil \fermata

#(define-markup-command (text-fromproperty layout props text-1 symbol text-2)
   (markup? symbol? markup?)
   #:category other
   (let ((m (chain-assoc-get symbol props)))
     (if (markup? m)
         ;; prevent infinite loops by clearing the interpreted property:
         (interpret-markup
          layout
          (cons (list (cons symbol `(,property-recursive-markup ,symbol))) props)
          (make-concat-markup (list text-1 m text-2)))
         empty-stencil)))

klavier =
%% simpler Satz je 2 Stimmen Diskant + Bass und Struktur
#(define-music-function (sop alt ten bas stru)
   (ly:music? ly:music? ly:music? ly:music? ly:music?)
   #{
     <<
       \new PianoStaff="leadsheet"
       <<
         \new Staff="up"
         <<
           \new Voice="sopran" { $sop }
           \new Voice="alt" { $alt }
         >>
         \new Staff="down"
         <<
           \new Voice { $ten }
           \new Voice { $bas }
           \new NullVoice $stru
         >>
       >>
     >>
   #}
   )

klavierpd =
%% SATBs mit Pedal und Dynamik
#(define-music-function (sop alt ten bas stru dyn ped)
   (ly:music? ly:music? ly:music? ly:music? ly:music? ly:music? ly:music?)
   #{
     <<
       \new PianoStaff="leadsheet"
       <<
         \new Staff="up"
         <<
           \new Voice="sopran" { $sop }
           \new Voice="alt" { $alt }
         >>
         \new Dynamics $dyn
         \new Staff="down"
         <<
           \new Voice { $ten }
           \new Voice { $bas }
           \new NullVoice $stru
         >>
         \new Dynamics $ped
       >>
     >>
   #}
   )

klavierd =
%% SATBs mit Dynamik
#(define-music-function (sop alt ten bas stru dyn)
   (ly:music? ly:music? ly:music? ly:music? ly:music? ly:music?)
   #{
     <<
       \new PianoStaff="leadsheet"
       <<
         \new Staff="up"
         <<
           \new Voice="sopran" { $sop }
           \new Voice="alt" { $alt }
         >>
         \new Dynamics $dyn
         \new Staff="down"
         <<
           \new Voice { $ten }
           \new Voice { $bas }
           \new NullVoice $stru
         >>
       >>
     >>
   #}
   )

mynote =
#(define-music-function (m)
   (ly:duration?)
   #{
     \override Score.RehearsalMark.break-align-symbols = #'(time-signature)
     \once \override Score.RehearsalMark.self-alignment-X = #-1
     \mark \markup \fontsize #-3.5 \note { $m } #UP
   #}
   )

myottava =
#(define-music-function (o) (integer?)
   (let ((text (case o
                 ((0) #f)
                 ((1 -1) "8")
                 ((2 -2) "15"))))
     #{
       \ottava #o
       \set Staff.ottavation = #text
     #}))

#(define-markup-command (openBracket layout props heitgh) (number?)
   (interpret-markup layout props
     (markup #:line (#:with-dimensions (cons 0 0) (cons 0 0)
                      (#:path 0.25
                        (list (list (quote moveto) 0 0)
                          (list (quote lineto) -1 0)
                          (list (quote lineto) -1 (* heitgh -1))
                          (list (quote lineto) 0 (* heitgh -1))))))))

oob = { \once \override Score.BarNumber.stencil = ##f \bar "" }
bnf = \once \override Score.BarNumber.stencil = ##f
#(use-modules (ice-9 regex))

dynamictext =
#(define-event-function (text) (markup?)
   (if (string? text)
       (let* ((underscores-replaced
               (string-map
                (lambda (x) (if (eq? x #\_) #\space x))
                text))
              (split-text (string-split underscores-replaced #\space))
              (formatted (map
                          (lambda (word)
                            (if (string-match "^[mrzfps]*$" word)
                                (markup #:dynamic word)
                                (markup #:normal-text #:italic word)))
                          split-text)))
         #{
           #(make-dynamic-script (make-line-markup formatted))
         #})
       ;; user provided a full-blown markup, so we don't mess with it:
       #{
         #(make-dynamic-script (markup #:normal-text text))
       #}))

startMyGrace = {
  \temporary \override Slur.minimum-length = #0.1
  \startSlashedGraceMusic
  <>-#(make-music 'LaissezVibrerEvent)
  \revert Slur.minimum-length
}

myAcc =
#(def-grace-function startMyGrace stopSlashedGraceMusic)

hairpinWithCenteredText =
#(define-music-function (parser location text) (markup?)
   #{
     \once \override Voice.Hairpin.after-line-breaking =
     #(lambda (grob)
        (let* ((stencil (ly:hairpin::print grob))
               (par-y (ly:grob-parent grob Y))
               (dir (ly:grob-property par-y 'direction))
               (staff-line-thickness
                (ly:output-def-lookup (ly:grob-layout grob) 'line-thickness))
               (new-stencil (ly:stencil-aligned-to
                             (ly:stencil-combine-at-edge
                              (ly:stencil-aligned-to stencil X CENTER)
                              Y dir
                              (ly:stencil-aligned-to
                               (grob-interpret-markup
                                grob
                                (make-fontsize-markup
                                 (magnification->font-size
                                  (+ (ly:staff-symbol-staff-space grob)
                                    (/ staff-line-thickness 2)))
                                 text)) X CENTER))
                             X LEFT))
               (staff-space (ly:output-def-lookup
                             (ly:grob-layout grob) 'staff-space))
               (par-x (ly:grob-parent grob X))
               (dyn-text (grob::has-interface par-x 'dynamic-text-interface))
               (dyn-text-stencil-x-length
                (if dyn-text
                    (interval-length
                     (ly:stencil-extent (ly:grob-property par-x 'stencil) X))
                    0))
               (x-shift
                (if dyn-text
                    (-
                     (+ staff-space dyn-text-stencil-x-length)
                     (* 0.5 staff-line-thickness)) 0)))

          (ly:grob-set-property! grob 'Y-offset 0)
          (ly:grob-set-property! grob 'stencil
            (ly:stencil-translate-axis
             new-stencil
             x-shift X))))
   #})

#(define (octave-up m t)
   (let* ((octave (1- t))
          (new-note (ly:music-deep-copy m))
          (new-pitch (ly:make-pitch
                      octave
                      (ly:pitch-notename (ly:music-property m 'pitch))
                      (ly:pitch-alteration (ly:music-property m 'pitch)))))
     (set! (ly:music-property new-note 'pitch) new-pitch)
     new-note))

#(define (octavize-chord elements t)
   (cond ((null? elements) elements)
     ((eq? (ly:music-property (car elements) 'name) 'NoteEvent)
      (cons (car elements)
        (cons (octave-up (car elements) t)
          (octavize-chord (cdr elements) t))))
     (else (cons (car elements) (octavize-chord (cdr elements ) t)))))

#(define (octavize music t)
   (if (eq? (ly:music-property music 'name) 'EventChord)
       (ly:music-set-property! music 'elements (octavize-chord
                                                (ly:music-property music 'elements) t)))
   music)

makeOctaves = #(define-music-function (arg mus) (integer? ly:music?)
                 (music-map (lambda (x) (octavize x arg)) (event-chord-wrap! mus)))
#(define ((chord-name->german-markup-text-alteration B-instead-of-Bb) pitch lowercase?)

   (define (pitch-alteration-semitones pitch)
     (inexact->exact (round (* (ly:pitch-alteration pitch) 2))))

   (define (conditional-string-downcase str condition)
     (if condition
         (string-downcase str)
         str))

   (let* ((name (ly:pitch-notename pitch))
          (alt-semitones  (pitch-alteration-semitones pitch))
          (n-a (if (member (cons name alt-semitones) `((6 . -1) (6 . -1)))
                   (cons 7 (+ (if B-instead-of-Bb 1 1) alt-semitones))
                   (cons name alt-semitones))))
     (make-line-markup
      (list
       (make-simple-markup
        (conditional-string-downcase
         (vector-ref #("C" "D" "E" "F" "G" "A" "H" "B") (car n-a))
         lowercase?))
       (let ((alteration (/ (cdr n-a) 2)))
         (cond
          ((and (equal? lowercase? #f) (= alteration FLAT) (= (car n-a) 7)) (make-simple-markup ""))
          ((and (= alteration FLAT) (or (= (car n-a) 5) (= (car n-a) 2) )) (make-simple-markup "s"))
          ((= alteration FLAT) (make-simple-markup "es"))
          ((and (= alteration DOUBLE-FLAT) (or (= (car n-a) 5)(= (car n-a) 2) )) (make-simple-markup "ses"))
          ((= alteration DOUBLE-FLAT) (make-simple-markup "eses"))
          ((= alteration SHARP) (make-simple-markup "is"))
          ((= alteration DOUBLE-SHARP) (make-simple-markup "isis"))
          (else empty-markup)))))))

#(define germanChords (chord-name->german-markup-text-alteration #t))

make-midi-list =
#(define-void-function (name score tempolist)
   ((string? #f) ly:score? list?)
   (for-each
    (lambda (tempo)
      (ly:book-process
       (apply
        ly:make-book
        $defaultpaper
        $defaultheader
        (list score))
       $defaultpaper
       #{
         \midi {
           \tempo 4 = $tempo
         }
       #}
       (format #f "~a_~a"
         (or name "midi")
         tempo)))
    tempolist))

editorsColor = #grey
ed =
#(define-music-function (grob col mus)
   (symbol-list-or-symbol? (color? editorsColor) ly:music?)
   ;; for abbreviations, we need a symbol instead of a one-element list
   (let ((grob (if (= 1 (length grob)) (car grob) grob)))
     (case
      grob
      ;; define abbreviations
      ;; which call the function recursively with a value
      ;; leading into the (else) clause
      ;; (or to _another_ abbreviation)
      ;; be careful to avoid infinite recursion :-)
      ;; – abbreviation names must not be actual grob names
      ;; (at least if they’re used in the corresponding
      ;; clause) or recursion will be infinite also
      ;; It is recommended to use singular forms only
      ;; for abbreviations.
      ((Caut) #{ \ed Staff.AccidentalCautionary #})
      ((LedgerLine) #{ % barline is workaround to issue 3949
        \stopStaff
        \ed Staff.LedgerLineSpanner {
          \startStaff
          $mus
          \stopStaff
        }
        \startStaff #})
      ((Mmr) #{ \ed MultiMeasureRest $mus #})
      ((Note) #{ \ed Staff.Accidental
                 \ed Beam
                 \ed Dots
                 \ed Flag
                 \ed LedgerLine
                 \ed NoteHead
                 \ed Rest
                 \ed Stem $mus #})
      ((Pitch) #{ \ed NoteHead $mus #})
      ((Suggest) #{ \ed Staff.AccidentalSuggestion #})
      ((StemWithFlag) #{ \ed Stem \ed Flag $mus #})
      ((Tuplet) #{ \ed TupletNumber \ed TupletBracket $mus #})
      ;; ‘normal’ case
      (else
       #{
         \override $grob . color = #col
         $mus
         \revert $grob . color
       #}))))

#(define new-stil
   (lambda (grob)
     (let* ((sz (ly:grob-property grob 'font-size 0.0))
            (mult (magstep sz))
            (dir (ly:grob-property grob 'direction))
            (thick 0.15)
            (radius 0.7)
            (scaled-radius (* mult radius))
            (ps-command-string
             (format #f
               "
             0 ~a translate
             ~a setlinewidth
             ~a 0 moveto
             0 0 ~a 180 0 ~a
             stroke
             "
               ;mult
               (* thick dir)
               thick
               (- scaled-radius)
               scaled-radius
               (if (negative? dir) "arcn" "arc"))))

       (ly:make-stencil
        (list 'embedded-ps
          (format #f
            "
              gsave currentpoint translate
              ~a
              grestore
              "
            ps-command-string))
        (cons (- scaled-radius) scaled-radius)
        (cons
         (if (negative? dir) 0 (- scaled-radius))
         (if (negative? dir) scaled-radius 0))))))

soft =
-\tweak stencil #new-stil \fermata

#(define-markup-command (text-fromproperty layout props text-1 symbol text-2)
   (markup? symbol? markup?)
   #:category other
   (let ((m (chain-assoc-get symbol props)))
     (if (markup? m)
         ;; prevent infinite loops by clearing the interpreted property:
         (interpret-markup
          layout
          (cons (list (cons symbol `(,property-recursive-markup ,symbol))) props)
          (make-concat-markup (list text-1 m text-2)))
         empty-stencil)))

klavier =
%% simpler Satz je 2 Stimmen Diskant + Bass und Struktur
#(define-music-function (sop alt ten bas stru)
   (ly:music? ly:music? ly:music? ly:music? ly:music?)
   #{
     <<
       \new PianoStaff="leadsheet"
       <<
         \new Staff="up"
         <<
           \new Voice="sopran" { $sop }
           \new Voice="alt" { $alt }
         >>
         \new Staff="down"
         <<
           \new Voice { $ten }
           \new Voice { $bas }
           \new NullVoice $stru
         >>
       >>
     >>
   #}
   )

klavierpd =
%% SATBs mit Pedal und Dynamik
#(define-music-function (sop alt ten bas stru dyn ped)
   (ly:music? ly:music? ly:music? ly:music? ly:music? ly:music? ly:music?)
   #{
     <<
       \new PianoStaff="leadsheet"
       <<
         \new Staff="up"
         <<
           \new Voice="sopran" { $sop }
           \new Voice="alt" { $alt }
         >>
         \new Dynamics $dyn
         \new Staff="down"
         <<
           \new Voice { $ten }
           \new Voice { $bas }
           \new NullVoice $stru
         >>
         \new Dynamics $ped
       >>
     >>
   #}
   )

klavierd =
%% SATBs mit Dynamik
#(define-music-function (sop alt ten bas stru dyn)
   (ly:music? ly:music? ly:music? ly:music? ly:music? ly:music?)
   #{
     <<
       \new PianoStaff="leadsheet"
       <<
         \new Staff="up"
         <<
           \new Voice="sopran" { $sop }
           \new Voice="alt" { $alt }
         >>
         \new Dynamics $dyn
         \new Staff="down"
         <<
           \new Voice { $ten }
           \new Voice { $bas }
           \new NullVoice $stru
         >>
       >>
     >>
   #}
   )

mynote =
#(define-music-function (m)
   (ly:duration?)
   #{
     \override Score.RehearsalMark.break-align-symbols = #'(time-signature)
     \once \override Score.RehearsalMark.self-alignment-X = #-1
     \mark \markup \fontsize #-3.5 \note { $m } #UP
   #}
   )

myottava =
#(define-music-function (o) (integer?)
   (let ((text (case o
                 ((0) #f)
                 ((1 -1) "8")
                 ((2 -2) "15"))))
     #{
       \ottava #o
       \set Staff.ottavation = #text
     #}))

#(define-markup-command (openBracket layout props heitgh) (number?)
   (interpret-markup layout props
     (markup #:line (#:with-dimensions (cons 0 0) (cons 0 0)
                      (#:path 0.25
                        (list (list (quote moveto) 0 0)
                          (list (quote lineto) -1 0)
                          (list (quote lineto) -1 (* heitgh -1))
                          (list (quote lineto) 0 (* heitgh -1))))))))

oob = { \once \override Score.BarNumber.stencil = ##f \bar "" }
bnf = \once \override Score.BarNumber.stencil = ##f
#(use-modules (ice-9 regex))

dynamictext =
#(define-event-function (text) (markup?)
   (if (string? text)
       (let* ((underscores-replaced
               (string-map
                (lambda (x) (if (eq? x #\_) #\space x))
                text))
              (split-text (string-split underscores-replaced #\space))
              (formatted (map
                          (lambda (word)
                            (if (string-match "^[mrzfps]*$" word)
                                (markup #:dynamic word)
                                (markup #:normal-text #:italic word)))
                          split-text)))
         #{
           #(make-dynamic-script (make-line-markup formatted))
         #})
       ;; user provided a full-blown markup, so we don't mess with it:
       #{
         #(make-dynamic-script (markup #:normal-text text))
       #}))

startMyGrace = {
  \temporary \override Slur.minimum-length = #0.1
  \startSlashedGraceMusic
  <>-#(make-music 'LaissezVibrerEvent)
  \revert Slur.minimum-length
}

myAcc =
#(def-grace-function startMyGrace stopSlashedGraceMusic)

hairpinWithCenteredText =
#(define-music-function (parser location text) (markup?)
   #{
     \once \override Voice.Hairpin.after-line-breaking =
     #(lambda (grob)
        (let* ((stencil (ly:hairpin::print grob))
               (par-y (ly:grob-parent grob Y))
               (dir (ly:grob-property par-y 'direction))
               (staff-line-thickness
                (ly:output-def-lookup (ly:grob-layout grob) 'line-thickness))
               (new-stencil (ly:stencil-aligned-to
                             (ly:stencil-combine-at-edge
                              (ly:stencil-aligned-to stencil X CENTER)
                              Y dir
                              (ly:stencil-aligned-to
                               (grob-interpret-markup
                                grob
                                (make-fontsize-markup
                                 (magnification->font-size
                                  (+ (ly:staff-symbol-staff-space grob)
                                    (/ staff-line-thickness 2)))
                                 text)) X CENTER))
                             X LEFT))
               (staff-space (ly:output-def-lookup
                             (ly:grob-layout grob) 'staff-space))
               (par-x (ly:grob-parent grob X))
               (dyn-text (grob::has-interface par-x 'dynamic-text-interface))
               (dyn-text-stencil-x-length
                (if dyn-text
                    (interval-length
                     (ly:stencil-extent (ly:grob-property par-x 'stencil) X))
                    0))
               (x-shift
                (if dyn-text
                    (-
                     (+ staff-space dyn-text-stencil-x-length)
                     (* 0.5 staff-line-thickness)) 0)))

          (ly:grob-set-property! grob 'Y-offset 0)
          (ly:grob-set-property! grob 'stencil
            (ly:stencil-translate-axis
             new-stencil
             x-shift X))))
   #})

#(define (octave-up m t)
   (let* ((octave (1- t))
          (new-note (ly:music-deep-copy m))
          (new-pitch (ly:make-pitch
                      octave
                      (ly:pitch-notename (ly:music-property m 'pitch))
                      (ly:pitch-alteration (ly:music-property m 'pitch)))))
     (set! (ly:music-property new-note 'pitch) new-pitch)
     new-note))

#(define (octavize-chord elements t)
   (cond ((null? elements) elements)
     ((eq? (ly:music-property (car elements) 'name) 'NoteEvent)
      (cons (car elements)
        (cons (octave-up (car elements) t)
          (octavize-chord (cdr elements) t))))
     (else (cons (car elements) (octavize-chord (cdr elements ) t)))))

#(define (octavize music t)
   (if (eq? (ly:music-property music 'name) 'EventChord)
       (ly:music-set-property! music 'elements (octavize-chord
                                                (ly:music-property music 'elements) t)))
   music)

makeOctaves = #(define-music-function (arg mus) (integer? ly:music?)
                 (music-map (lambda (x) (octavize x arg)) (event-chord-wrap! mus)))
\layout {
  \context {
    \Voice
    beamExceptions = #'()
    \override BreathingSign.text =
    \markup { \musicglyph "scripts.lvarcomma" }
    \override Stem.neutral-direction = #down
    \override Script.outside-staff-priority = #'()
    \override Script.padding = #1
    \override Tie.thickness = #1
    \override PhrasingSlur.thickness = #3
    \override Rest.voiced-position = #0
    \override MultiMeasureRest.expand-limit = #3
    \remove "Forbid_line_break_engraver"
  }
  \context {
    \Voice
    \name SecondVoice
    \alias Voice
    \remove "Tuplet_engraver"
    \remove "Rest_engraver"
    \remove "Multi_measure_rest_engraver"
    \override NoteHead.font-size = #-1
    \voiceTwo
  }
  \context {
    \Lyrics
    \override VerticalAxisGroup.staff-affinity = #CENTER
  }
  \context {
    \Staff
    \accepts SecondVoice
    printPartCombineTexts = ##f
    beamExceptions = #'()
    \override BreathingSign.text =
    \markup { \musicglyph "scripts.lvarcomma" }
    \override InstrumentName.font-features = #'("smcp")
    \consists #Span_stem_engraver
  }
  \context {
    \Score
    \override VerticalAxisGroup.remove-first = ##t
    skipBars = ##f
    \override MetronomeMark.font-size = #1
    \override MetronomeMark.font-shape = #'caps
    \override BarLine.thick-thickness = 5
    % barNumberVisibility = #all-bar-numbers-visible
    \override Timing.beamExceptions = #'()
    \override BarNumber.color = #(rgb-color 0.7 0.7 0.7)
    \override BarNumber.layer = #-200
    \override BarNumber.padding = #0.4
    \override BarNumber.outside-staff-priority =#'()
    \override BarNumber.after-line-breaking = ##f
    \override BarNumber.font-size = #-1
    \override BarNumber.font-series = #'bold
    \override BarNumber.self-alignment-X = #0
    \override BarNumber.break-visibility = #end-of-line-invisible
    \override SystemStartBar.collapse-height = #4

  }
  \context {
    \ChordNames
    chordNameLowercaseMinor = ##f
    \remove Staff_performer
    chordRootNamer = #germanChords
    \override ChordName.font-name = #"Orator10 BT"
    chordNoteNamer = #(chord-name->german-markup #f)
    \override ChordName.X-offset =
    #ly:self-alignment-interface::aligned-on-x-parent
    \override ChordName.self-alignment-X = #CENTER
    \override ChordName.font-name = #"Arial Narrow"
    \override ChordName.layer = #2
    \override ChordName.font-size = #-0.5
    noChordSymbol = ##f
  }
  \context {
    \PianoStaff
    \override StaffGrouper.staffgroup-staff-spacing.basic-distance = #2
    \override StaffGrouper.staffgroup-staff-spacing.minimum-distance = #0
  }
  \context {
    \StaffGroup
    \override SystemStartBracket.collapse-height = #4
    \override SystemStartBracket.thickness = #.2
  }
}

#(define-markup-command (text-fromproperty layout props text-1 symbol text-2)
   (markup? symbol? markup?)
   #:category other
   (let ((m (chain-assoc-get symbol props)))
     (if (markup? m)
         ;; prevent infinite loops by clearing the interpreted property:
         (interpret-markup
          layout
          (cons (list (cons symbol `(,property-recursive-markup ,symbol))) props)
          (make-concat-markup (list text-1 m text-2)))
         empty-stencil)))

#(define-markup-command (tonart-fromproperty layout props text-1 symbol symbol2)
   (markup? symbol? symbol?)
   #:category other
   (let* ((m (chain-assoc-get symbol props))
          (ton (chain-assoc-get symbol2 props))
          (dur (if (markup? ton) ton "-Dur"))
          )
     (if (markup? m)
         ;; prevent infinite loops by clearing the interpreted property:
         (interpret-markup
          layout
          (cons (list (cons symbol `(,property-recursive-markup ,symbol))) props)
          (make-concat-markup (list text-1 m dur)))
         empty-stencil)))

\paper {
  #(include-special-characters)
  indent = #0
  ragged-right = ##f
  ragged-last = ##f
  print-all-headers = ##f
  print-first-page-number = ##f
  oddFooterMarkup = ##f
  evenFooterMarkup = ##f
  oddHeaderMarkup = #oddFooterMarkup
  evenHeaderMarkup = #evenFooterMarkup
  bookTitleMarkup = ##f
  scoreTitleMarkup =
  \markup {
    \override #'((baseline-skip . 2) )
    \column {
      \fill-line \override #'(baseline-skip . 2.5) {
        \huge \larger \larger \bold
        \center-column {
          \fromproperty #'header:title
          \fontsize #-2.5  {
            \fill-line { \fromproperty #'header:subtitle }
          }
        }
      }
      \fontsize #-1.5 {
        \center-column {
          " " " "
          \fill-line {
            "Notensatz: lilypond.miraheze.org" \fromproperty #'header:composer
          }
        }
        \fill-line {
          \fromproperty  #'header:instrument
          \fromproperty  #'header:arranger
        }
      }
    }
  }
}

VerzeichnisPaper = \paper {
  annotate-spacing = ##f
  top-margin = 20\mm
  %top-markup-spacing.padding = 20
  ragged-right = ##f
  ragged-bottom = ##t
  ragged-last-bottom = ##t
  bottom-margin = 20\mm
  indent = #0
  line-width = 150\mm
  #(include-special-characters)
  print-all-headers = ##f
  print-page-number = ##f
}

down = { \change Staff= down }
up = { \change Staff = up }
nachoben = { \change Staff= up }
nachunten = { \change Staff = down }

arp =
#(define-music-function (un ob)
   (number? number?)
   #{ \once \override Arpeggio.positions = #`(,un . ,ob) #})
hrechts = #(define-music-function (was)
             (number?)
             #{
               \once \override Hairpin.shorten-pair =  #`(0 . ,was)
             #})

hlinks = #(define-music-function (was)
            (number?)
            #{
              \once \override Hairpin.shorten-pair =  #`(,was . 0)
            #})
\layout {
  \context {
    \Voice
    beamExceptions = #'()
    \override BreathingSign.text =
    \markup { \musicglyph "scripts.lvarcomma" }
    \override Stem.neutral-direction = #down
    \override Script.outside-staff-priority = #'()
    \override Script.padding = #1
    \override Tie.thickness = #1
    \override PhrasingSlur.thickness = #3
    \override Rest.voiced-position = #0
    \override MultiMeasureRest.expand-limit = #3
    \remove "Forbid_line_break_engraver"
  }
  \context {
    \Voice
    \name SecondVoice
    \alias Voice
    \remove "Tuplet_engraver"
    \remove "Rest_engraver"
    \remove "Multi_measure_rest_engraver"
    \override NoteHead.font-size = #-1
    \voiceTwo
  }
  \context {
    \Lyrics
    \override VerticalAxisGroup.staff-affinity = #CENTER
  }
  \context {
    \Staff
    \accepts SecondVoice
    printPartCombineTexts = ##f
    beamExceptions = #'()
    \override BreathingSign.text =
    \markup { \musicglyph "scripts.lvarcomma" }
    \override InstrumentName.font-features = #'("smcp")
    \consists #Span_stem_engraver
  }
  \context {
    \Score
    \override VerticalAxisGroup.remove-first = ##t
    skipBars = ##f
    \override MetronomeMark.font-size = #1
    \override MetronomeMark.font-shape = #'caps
    \override BarLine.thick-thickness = 5
    % barNumberVisibility = #all-bar-numbers-visible
    \override Timing.beamExceptions = #'()
    \override BarNumber.color = #(rgb-color 0.7 0.7 0.7)
    \override BarNumber.layer = #-200
    \override BarNumber.padding = #0.4
    \override BarNumber.outside-staff-priority =#'()
    \override BarNumber.after-line-breaking = ##f
    \override BarNumber.font-size = #-1
    \override BarNumber.font-series = #'bold
    \override BarNumber.self-alignment-X = #0
    \override BarNumber.break-visibility = #end-of-line-invisible
    \override SystemStartBar.collapse-height = #4

  }
  \context {
    \ChordNames
    chordNameLowercaseMinor = ##f
    \remove Staff_performer
    chordRootNamer = #germanChords
    \override ChordName.font-name = #"Orator10 BT"
    chordNoteNamer = #(chord-name->german-markup #f)
    \override ChordName.X-offset =
    #ly:self-alignment-interface::aligned-on-x-parent
    \override ChordName.self-alignment-X = #CENTER
    \override ChordName.font-name = #"Arial Narrow"
    \override ChordName.layer = #2
    \override ChordName.font-size = #-0.5
    noChordSymbol = ##f
  }
  \context {
    \PianoStaff
    \override StaffGrouper.staffgroup-staff-spacing.basic-distance = #2
    \override StaffGrouper.staffgroup-staff-spacing.minimum-distance = #0
  }
  \context {
    \StaffGroup
    \override SystemStartBracket.collapse-height = #4
    \override SystemStartBracket.thickness = #.2
  }
}

#(define-markup-command (text-fromproperty layout props text-1 symbol text-2)
   (markup? symbol? markup?)
   #:category other
   (let ((m (chain-assoc-get symbol props)))
     (if (markup? m)
         ;; prevent infinite loops by clearing the interpreted property:
         (interpret-markup
          layout
          (cons (list (cons symbol `(,property-recursive-markup ,symbol))) props)
          (make-concat-markup (list text-1 m text-2)))
         empty-stencil)))

#(define-markup-command (tonart-fromproperty layout props text-1 symbol symbol2)
   (markup? symbol? symbol?)
   #:category other
   (let* ((m (chain-assoc-get symbol props))
          (ton (chain-assoc-get symbol2 props))
          (dur (if (markup? ton) ton "-Dur"))
          )
     (if (markup? m)
         ;; prevent infinite loops by clearing the interpreted property:
         (interpret-markup
          layout
          (cons (list (cons symbol `(,property-recursive-markup ,symbol))) props)
          (make-concat-markup (list text-1 m dur)))
         empty-stencil)))

\paper {
  #(include-special-characters)
  indent = #0
  ragged-right = ##f
  ragged-last = ##f
  print-all-headers = ##f
  print-first-page-number = ##f
  oddFooterMarkup = ##f
  evenFooterMarkup = ##f
  oddHeaderMarkup = #oddFooterMarkup
  evenHeaderMarkup = #evenFooterMarkup
  bookTitleMarkup = ##f
  scoreTitleMarkup =
  \markup {
    \override #'((baseline-skip . 2) )
    \column {
      \fill-line \override #'(baseline-skip . 2.5) {
        \huge \larger \larger \bold
        \center-column {
          \fromproperty #'header:title
          \fontsize #-2.5  {
            \fill-line { \fromproperty #'header:subtitle }
          }
        }
      }
      \fontsize #-1.5 {
        \center-column {
          " " " "
          \fill-line {
            "Notensatz: lilypond.miraheze.org" \fromproperty #'header:composer
          }
        }
        \fill-line {
          \fromproperty  #'header:instrument
          \fromproperty  #'header:arranger
        }
      }
    }
  }
}

VerzeichnisPaper = \paper {
  annotate-spacing = ##f
  top-margin = 20\mm
  %top-markup-spacing.padding = 20
  ragged-right = ##f
  ragged-bottom = ##t
  ragged-last-bottom = ##t
  bottom-margin = 20\mm
  indent = #0
  line-width = 150\mm
  #(include-special-characters)
  print-all-headers = ##f
  print-page-number = ##f
}

down = { \change Staff= down }
up = { \change Staff = up }
nachoben = { \change Staff= up }
nachunten = { \change Staff = down }

arp =
#(define-music-function (un ob)
   (number? number?)
   #{ \once \override Arpeggio.positions = #`(,un . ,ob) #})
hrechts = #(define-music-function (was)
             (number?)
             #{
               \once \override Hairpin.shorten-pair =  #`(0 . ,was)
             #})

hlinks = #(define-music-function (was)
            (number?)
            #{
              \once \override Hairpin.shorten-pair =  #`(,was . 0)
            #})