Sie liebt mich (Josephine Lang)

Zur Navigation springen Zur Suche springen
\version "2.20.0"
\language "deutsch"

#(use-modules (ice-9 regex))

hps =
#(define-music-function (li re)
   (number? number?)
   #{
     \once \override Hairpin.shorten-pair = #`(,li . ,re)
   #})

arp =
#(define-music-function (un ob)
   (number? number?)
   #{
     \once \override Arpeggio.positions = #`(,un . ,ob)
   #})

#(set-global-staff-size 18)
\include "articulate.ly"
\paper {
  #(include-special-characters)
  #(set-paper-size "a4")
  top-markup-spacing.basic-distance = #12
  system-system-spacing.basic-distance = #16
  markup-system-spacing.basic-distance = 16
  markup-system-spacing.padding = 4
  oddHeaderMarkup = ##f
  evenHeaderMarkup = ##f
  oddFooterMarkup =\markup \fill-line { \null \concat {  "Quelle: Bayrische Staatsbibliothek" } \null }

  evenFooterMarkup = \markup \fill-line { \null \concat { \char #169 " Public Domain" } \null }
  oddFooterMarkup = ##f
  ragged-right = ##f
  ragged-last = ##f
  ragged-bottom = ##t
  ragged-last-bottom = ##t
  top-margin = 10\mm
  bottom-margin = #20
  left-margin = 15\mm
  right-margin = #left-margin
  page-breaking = #ly:minimal-breaking
  annotate-spacing = ##f

  #(define fonts
     (set-global-fonts
      #:music "Ross"
      #:brace "emmentaler"
      #:roman "Century Schoolbook L"
      #:sans "sans-serif"
      #:typewriter "monospace"
      ))
}

\header {
  title = \markup \override #'(font-name . "Parchment")
  \fontsize #12 "Sie liebt mich"
  subtitle = ""
  opus = ##f
  composer = \markup \override #'(baseline-skip . 3)
  \right-column { \vspace #2 "Musik: Josephine Lang (14.3.1815-2.12.1880)" "Opus 34 №4" }
  poet = \markup \override #'(baseline-skip . 3)
  \left-column
  {
    \vspace #2 "Text: J. W. Goethe (28.8.1749-22.3.1832)"
    \concat { \char #169 " Public Domain" }
  }
  %copyright = \markup { \char #169; PD }
  tagline = \markup \concat { \char #169 " Public Domain" }
}

\layout {
  \context {
    \PianoStaff
    \consists #Span_stem_engraver
    \remove Keep_alive_together_engraver
    \accepts BarNumberStaff
  }
  \context {
    \Staff
    \RemoveAllEmptyStaves
    \remove "Dot_column_engraver"
  }
  \context {
    \Voice
    \consists "Dot_column_engraver"
    \override TextScript.font-name = #"French Script MT"
    \override TextScript.font-size = #6
  }
  \context {
    \StaffGroup
    \remove System_start_delimiter_engraver
  }
  \context {
    \Dynamics
    %\override DynamicText.font-name = #"French Script MT"
  }
  \context {
    \Score
    \override BarNumber.color = #(rgb-color 0.7 0.7 0.7)
    \override BarNumber.layer = #-200
    \override BarNumber.outside-staff-priority =#'()
    \override BarNumber.padding = #1
    \override BarNumber.font-size = #-1.9
    \override BarNumber.font-series = #'bold
    \override BarNumber.self-alignment-X = #0
    %\override BarNumber.break-visibility = #end-of-line-invisible
  }
  \context {
    \Lyrics
    \override LyricHyphen.dash-period = #6
    \override LyricHyphen.length = #1
    \override LyricHyphen.thickness = #1
    \override LyricHyphen.height = #1
    \override LyricHyphen.minimum-distance = #3
  }
}

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
                                  #:override '(font-size . 6)
                                  #:override '(font-name . "French Script MT") 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))
       #}))

tonart = { \key g \major }
Alt =
\relative c'' {
  \tonart
  \time 4/4
  \partial 8
  r8
  \repeat unfold 9 R1
  r2 r4 r8. g16
  g4-^ fis8 r16 h h4-^ a8 r
  fis'4 r8 e8 e4 d
  R1 r2 r4 gis,
  a2 d4. 8 e2 d4 r
  R1 R1
  e,2 a4. 8
  a4. ( fis8 ) a4 r
  h2 cis4 a
  fis'2. d4
  h2 cis4 a
  fis'2 ~ 4 d
  e2 ~( 8 d) cis([ h)]
  a2 a'-^ ~ a2. eis4 fis2 r2
  R1 R1 R1
  \autoBeamOff
  g,4 fis8. 16 g4 gis
  a h8. 16 c4 cis
  d fis,8. 16 g4 gis
  a h8. 16 c4 d
  g2-> fis4.. e16
  d2( c4 c)
  g2 a4. 8 h2. r4
  e1 ~( 4 h) c4. a8
  d1 g,2. r8. g16
  g4 fis8. h16 4 a
  fis' r8. e16 4 d
  g2(->~ 8[ e)] c([ a)]
  d2 g,4 r R1 * 9
}

dynalt = {
  s8
  s1 * 10
  s4 s\dynamictext "cresc." s2
  s s\>
  s1\!
  s1 * 24
  s2\< s\< s2.\> s4\!
  \once \override Hairpin.self-alignment-X = #0.5
  \hps #-2 #6
  s4\< %\once \override Hairpin.self-alignment-X = #0
  \hps #-6 #10 s2.\> s1\!
  \once \override Hairpin.self-alignment-X = #0.5
  \hps #-2 #6
  s4\<
  \hps #-6 #12 s2.\> s1\!
}

rdyn = {
  s8
  s1
  s4 s\< s\! s\fz
  s1
  s4\dynamictext "descres." s\> s\! s
  s1\f s\dynamictext "descres."
  s\dynamictext "Ped."
  s2 s4\> s8 s
  \p s1 s\p
  s s
  s2\> s\!
  s1\dynamictext "dolce"
  s2 s\< s\> s\!
  s\> s\!
  s1 * 7
  s2\> s\!
  s1 s s2. s4\dynamictext "Ped."
  s1\dynamictext "cresc."
  s
  s4\f\> s4\! s2\dynamictext "decresc."
  s1\p s s s s\p
  s s2 s\dynamictext "cresc."
  s1\f s2 s\dynamictext "cresc."
  s1\f
  s2 s\dynamictext "decresc."
  s1 s
  s2 s\dynamictext "cresc."
  s1\f
}

ldyn = {
  s4

}
struktur = {
  %\override Score.NonMusicalPaperColumn.page-break-permission = ##f
  \override PianoStaff.VerticalAxisGroup.staff-staff-spacing.basic-distance = #12
  \override StaffGroup.VerticalAxisGroup.staff-staff-spacing.basic-distance = #16
  \override Score.SpacingSpanner.common-shortest-duration = #(ly:make-moment 1/16)
  s8 s1*9
  \newSpacingSection
  \override Score.SpacingSpanner.common-shortest-duration = #(ly:make-moment 1/4)
  s1 * 38
  \newSpacingSection
  \override Score.SpacingSpanner.common-shortest-duration = #(ly:make-moment 1/16)
}

versi =
\lyricmode {
  Sie liebt mich, sie liebt mich,
  ja sie liebt mich.
  Welch schreck -- li -- ches Be -- ben!
  Fühl' ich mich sel -- ber?
  Fühl' ich mich sel -- ber bin ich am Le -- ben.
  Sie __ liebt mich, sie __ liebt mich!
  \set stanza = "1."
  Ach kann die See -- le dich denn er -- fas -- sen,
  Glück oh -- ne Na -- me, kann es dich las -- sen.
  Ein -- mal er -- wacht, ein -- mal er -- wacht!
  Glück __ oh -- ne Na -- me!
  Sie liebt mich, sie liebt mich,
  ja sie liebt mich.
  Ja __ sie liebt mich!
  %   Fühl' ich mich selber?
  %  Bin ich am Leben?
  %  Sie [liebt]2 mich!
  %  Sie liebt mich!3
}

versii =
\lyricmode {
  \repeat unfold 37 \skip 1
  \set stanza = "2."
  Ach rings so an -- ders,
  bist du's noch Son -- ne,
  bist du's noch, Hüt -- te,
  tra -- ge die Won -- ne,
  tra -- ge die
  \set ignoreMelismata = ##t
  Won -- _ ne,
  see -- li -- ges Herz.
  \set ignoreMelismata = ##f
  Tra -- ge die Won -- ne!
  % Bist du's noch, Sonne?
  %  Bist du's noch, Hütte?
  %  Trage die Wonne,
  %  Seliges Herz!
  %  Sie liebt mich!
  %  Sie liebt mich
}

RHi =
\relative c' {
  \tonart
  %\mergeDifferentlyDottedOff
  %\mergeDifferentlyHeadedOn
  \tempo \markup "Agitato"
  r16 < h d g h >
  \set doubleSlurs = ##t
  q4-> ( < c d fis a >8)[ r16 < d fis a c >] q4-> ( < d g h >8[) r16 < fis a c e g >]
  < fis a c e >4->( < g h d >8[) r16 < c d fis a >] q4 ( < h d g h >8) r
  \set doubleSlurs = ##f
  < fis' a c e >4.-^( < fis a c >8 < d fis a c >4 < c d fis a >)
  < a c d fis > < fis a c d > \voiceOne c' ( h )
  \oneVoice
  < fis' a c e >4.( < fis a c >8 < d fis a c >4 < c d fis a >)
  < a c d fis > < fis a c d > \voiceOne c' ( h )
  d2 ( c )
  h2. ( a4)
  \oneVoice
  < g d h > r < d g > r
  < h g >1
  s1
  \voiceOne
  fis''4. e8 4 d
  c2 h4( a g fis g gis)
  s1 s
  c2 h4( a
  g fis g fis)
  s1 * 24
  \oneVoice
  < g d h >4 r r2 s1
  \voiceOne
  fis'4. e8 4 d
  s1
  \oneVoice
  s2 s4 s8. < h, e g h >16
  \set doubleSlurs = ##t
  < h d g h >4 ( < a d fis a >8.) < d fis a c >16
  q4 ( < d g h >8.) < fis a c e >16
  q4 ( < g h d >8.) < c d fis a >16 q4 < h d g h >
  < fis' a c e >4. q8 < d fis a c >4 < c d fis a >
  \set doubleSlurs = ##f
  < a c d fis > < fis a c d > c' ( h )
  < fis' a c e >4. < fis a c d >8 < d fis a c >4 < c d fis a >
  < a c d fis > < fis a c d > c' ( h )
  d2 ( c ) h ( a )
  < g d h >4 r < d h > r s1
  \bar "|."
}

runter = { \change Staff="down" \voiceOne }
rauf = { \change Staff="up" \voiceTwo }
RHii =
\relative c' {
  s8
  s1 s s
  s2
  \voiceTwo
  < d g > s1 s2 q
  < fis a >1
  \arp #-4 #-1
  < h, d fis >1\arpeggio s1 s
  \omit TupletBracket
  \omit TupletNumber
  \oneVoice
  \tupletSpan 4
  \oneVoice
  \tuplet 3/2
  {
    \runter r8 fis( c' d c fis,) r a( c < d fis > c a) \rauf
    \slurUp
    fis'( a c) fis,( a c) e,( a c) d,( a' c)
    c,( e g) c,( e g) h,( d g) a,( d fis)
    \slurNeutral
    \runter
    g,( h d) fis,( ais d) g,( h d) gis,( h d)
    \rauf \oneVoice
    \slurDown
    r a( d a' d, a r) h( d < f h > d h)
    r c( d < fis! c' > d c) r c( d < fis a > d c)
    \voiceTwo \slurNeutral
    c e g c,( e g) h,( d g) a,( d fis)
    \runter
    g,( h e) fis,( ais d) g,( h e) fis,( a d)
    r e,( h' e h e,) r e( a < cis e > a e)
    r d a' d a d, r fis a < d fis > a fis
    \rauf
    \oneVoice
    h( d g h g d) a( cis e a e cis)
    r a( d a' d, a) r d( fis d' fis, d)
    h( d g h g d) a( cis e a e cis)
    r a( d a' d, a) r a( d fis d a)
    r gis( d' < e gis > d gis,) r d'( e gis e d)
    r d( fis a fis d) r a( d a' d, a)
    r g( d' e d g,) r g( cis e cis g)
    \runter
    \override Script.direction = #UP
    r fis( a d a fis) fis'-^( d a) \rauf \oneVoice
    \override Script.direction = #UP
    a'-^( fis d)
    d'-^( a fis) fis'( d a) a'( fis d) c'( fis, d)
    h'( d, c) a'( d, c) g'( c, a) fis'( c a)
    e' a, fis d'( a fis c' fis, d a' fis d)
    r g( d) r fis( d) r g( d) r gis( d)
    r a'( d,) r h'( d,) r c'( d,) r cis'( d,)
    r d'( d,) r fis( es) r g( d) r gis( d)
    r a'( d,) r h'( d,) r < fis c' >( d) r < fis d' >( d)
    h( d g h g d) c d( fis c' fis, d)
    d( g h d h g) e( g a e' a, g)
    h,( d g h g d) fis,( c' d fis d c)
    g( h d g d h) a( h dis a' dis, h)
    gis( d' e gis e d) d[( e h' d h e,])
    c[( e a c a e]) a,[( c e a e c])
    g[( h d g d h]) a[( c d fis d c])
    \runter
    g, d' cis d cis d cis d cis d cis d
    \rauf
    \oneVoice
    r8 a'( c fis c a) r c( fis a fis c)
    \voiceTwo \slurUp
    fis( a c) fis,( a c) e,( a c) d,( a' c)
    \oneVoice
    r g,( d' g d g,) r a( c < e g > c a)
    r a( c < c fis > c a < a d g >4) r8. s8
  }
  s8 |
  s1 s s
  s2 < d g >1*1/2
  s1 s2 < d g >1*1/2
  < fis a >1 < a, d fis >\arpeggio
}

LHi =
\relative c, {
  \mergeDifferentlyDottedOff
  \mergeDifferentlyHeadedOff
  \clef bass
  \tonart
  r8
  \tupletSpan 4
  \tuplet 3/2 {
    c8( d' cis d cis d) cis( d cis d cis d)
    \omit TupletBracket
    \omit TupletNumber
    \repeat unfold 2 { d,( d' cis d cis d d, d' cis d cis d) }
    \voiceOne
    \repeat unfold 2 {
      cis( d cis d cis d) r d( cis d cis d)
      r d( cis d cis d cis d cis d cis d)
    }
    \repeat unfold 3 { r d( cis d cis d cis d cis d cis d) }
  }
  \oneVoice
  s1 s
  < e g >2 < d g >4 < c d >
  \voiceTwo
  < h d > < ais d > < h d > < eis, d' >
  < fis fis' >2 < gis gis' > < a a' > q
  < e' g > d4 < c d >
  < d h > < d ais > < d h > < d ais >
  gis,2 g
  fis d \oneVoice g g' fis < a d, >
  g, g' fis d h h
  a < a fis' > a a
  < d d, >1 q < fis a, d, > < d a' c >2. c4
  c'( ais h eis,)
  fis( g a ais)
  h( a h eis,)
  e( g a d,)
  < d g g, >2 < d a a' > < d h h' > < c e g a >
  d d, g < f f' >
  < e e' > < gis gis' >
  < a a' > c d d,
  \once \override NoteColumn.force-hshift = 1
  g1
  d2 d'
  < d a' d >4. < g a c >8 g4 fis
  h,2 c4 a
  d2 \tupletSpan 4
  \tuplet 3/2
  {
    \stemDown
    < g g, >8[ d( cis d cis d])
    \stemNeutral
    \slurUp
    d,([ d' cis d cis d] cis[ d cis d cis d)]
    d,( d' cis d cis d) d\rest d( cis d cis d)
    d,( d' cis d cis d) d\rest d( cis d cis d)
    \repeat unfold 2 {
      d\rest d( cis d cis d) d\rest d( cis d cis d)
      d\rest d( cis d cis d cis d cis d cis d)
    }
    d\rest d( cis d cis d cis d cis d cis d)
    d\rest d( cis d cis d) d\rest d( cis d cis d)
  }
  < g d g, >1\fermata
}

LHii =
\relative c, {
  s8
  \voiceTwo
  s1 s s d2 g s d
  d g d1 d
  g2 g g1 d d'
  s1 * 35
  d,1
  \once \override NoteColumn.force-hshift = 2
  d2 d
  \once \override NoteColumn.force-hshift = 2 d d
  d g d1 d2 g
}

\score {
  \new StaffGroup
  <<
    \new Dynamics \dynalt
    \new Staff = "Alt" \with { instrumentName = \markup \fontsize #2 #"Voce" }
    \new Voice = "alt" \Alt
    \new Lyrics \lyricsto "alt" \versi
    \new Lyrics \lyricsto "alt" \versii
    \new PianoStaff
    \with { instrumentName = \markup \fontsize #2 "Pianof:" }
    <<
      \new Staff = "up"
      <<
        \new Voice \RHi
        \context Voice { s2. * 6 \override Staff.BarNumber.stencil = ##f }
        \new Voice \RHii
      >>
      \new Dynamics \rdyn
      \new Staff = "down"
      <<
        \new Voice \LHi
        \new Voice \LHii
        \new NullVoice \struktur
      >>
      \new Dynamics \ldyn
    >>
  >>
}
\version "2.20.0"
\language "deutsch"

#(use-modules (ice-9 regex))

hps =
#(define-music-function (li re)
   (number? number?)
   #{
     \once \override Hairpin.shorten-pair = #`(,li . ,re)
   #})

arp =
#(define-music-function (un ob)
   (number? number?)
   #{
     \once \override Arpeggio.positions = #`(,un . ,ob)
   #})

#(set-global-staff-size 18)
\include "articulate.ly"
\paper {
  #(include-special-characters)
  #(set-paper-size "a4")
  top-markup-spacing.basic-distance = #12
  system-system-spacing.basic-distance = #16
  markup-system-spacing.basic-distance = 16
  markup-system-spacing.padding = 4
  oddHeaderMarkup = ##f
  evenHeaderMarkup = ##f
  oddFooterMarkup =\markup \fill-line { \null \concat {  "Quelle: Bayrische Staatsbibliothek" } \null }

  evenFooterMarkup = \markup \fill-line { \null \concat { \char #169 " Public Domain" } \null }
  oddFooterMarkup = ##f
  ragged-right = ##f
  ragged-last = ##f
  ragged-bottom = ##t
  ragged-last-bottom = ##t
  top-margin = 10\mm
  bottom-margin = #20
  left-margin = 15\mm
  right-margin = #left-margin
  page-breaking = #ly:minimal-breaking
  annotate-spacing = ##f

  #(define fonts
     (set-global-fonts
      #:music "Ross"
      #:brace "emmentaler"
      #:roman "Century Schoolbook L"
      #:sans "sans-serif"
      #:typewriter "monospace"
      ))
}

\header {
  title = \markup \override #'(font-name . "Parchment")
  \fontsize #12 "Sie liebt mich"
  subtitle = ""
  opus = ##f
  composer = \markup \override #'(baseline-skip . 3)
  \right-column { \vspace #2 "Musik: Josephine Lang (14.3.1815-2.12.1880)" "Opus 34 &numero;4" }
  poet = \markup \override #'(baseline-skip . 3)
  \left-column
  {
    \vspace #2 "Text: J. W. Goethe (28.8.1749-22.3.1832)"
    \concat { \char #169 " Public Domain" }
  }
  %copyright = \markup { \char #169; PD }
  tagline = \markup \concat { \char #169 " Public Domain" }
}

\layout {
  \context {
    \PianoStaff
    \consists #Span_stem_engraver
    \remove Keep_alive_together_engraver
    \accepts BarNumberStaff
  }
  \context {
    \Staff
    \RemoveAllEmptyStaves
    \remove "Dot_column_engraver"
  }
  \context {
    \Voice
    \consists "Dot_column_engraver"
    \override TextScript.font-name = #"French Script MT"
    \override TextScript.font-size = #6
  }
  \context {
    \StaffGroup
    \remove System_start_delimiter_engraver
  }
  \context {
    \Dynamics
    %\override DynamicText.font-name = #"French Script MT"
  }
  \context {
    \Score
    \override BarNumber.color = #(rgb-color 0.7 0.7 0.7)
    \override BarNumber.layer = #-200
    \override BarNumber.outside-staff-priority =#'()
    \override BarNumber.padding = #1
    \override BarNumber.font-size = #-1.9
    \override BarNumber.font-series = #'bold
    \override BarNumber.self-alignment-X = #0
    %\override BarNumber.break-visibility = #end-of-line-invisible
  }
  \context {
    \Lyrics
    \override LyricHyphen.dash-period = #6
    \override LyricHyphen.length = #1
    \override LyricHyphen.thickness = #1
    \override LyricHyphen.height = #1
    \override LyricHyphen.minimum-distance = #3
  }
}

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
                                  #:override '(font-size . 6)
                                  #:override '(font-name . "French Script MT") 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))
       #}))

tonart = { \key g \major }
Alt =
\relative c'' {
  \tonart
  \time 4/4
  \partial 8
  r8
  \repeat unfold 9 R1
  r2 r4 r8. g16
  g4-^ fis8 r16 h h4-^ a8 r
  fis'4 r8 e8 e4 d
  R1 r2 r4 gis,
  a2 d4. 8 e2 d4 r
  R1 R1
  e,2 a4. 8
  a4. ( fis8 ) a4 r
  h2 cis4 a
  fis'2. d4
  h2 cis4 a
  fis'2 ~ 4 d
  e2 ~( 8 d) cis([ h)]
  a2 a'-^ ~ a2. eis4 fis2 r2
  R1 R1 R1
  \autoBeamOff
  g,4 fis8. 16 g4 gis
  a h8. 16 c4 cis
  d fis,8. 16 g4 gis
  a h8. 16 c4 d
  g2-> fis4.. e16
  d2( c4 c)
  g2 a4. 8 h2. r4
  e1 ~( 4 h) c4. a8
  d1 g,2. r8. g16
  g4 fis8. h16 4 a
  fis' r8. e16 4 d
  g2(->~ 8[ e)] c([ a)]
  d2 g,4 r R1 * 9
}

dynalt = {
  s8
  s1 * 10
  s4 s\dynamictext "cresc." s2
  s s\>
  s1\!
  s1 * 24
  s2\< s\< s2.\> s4\!
  \once \override Hairpin.self-alignment-X = #0.5
  \hps #-2 #6
  s4\< %\once \override Hairpin.self-alignment-X = #0
  \hps #-6 #10 s2.\> s1\!
  \once \override Hairpin.self-alignment-X = #0.5
  \hps #-2 #6
  s4\<
  \hps #-6 #12 s2.\> s1\!
}

rdyn = {
  s8
  s1
  s4 s\< s\! s\fz
  s1
  s4\dynamictext "descres." s\> s\! s
  s1\f s\dynamictext "descres."
  s\dynamictext "Ped."
  s2 s4\> s8 s
  \p s1 s\p
  s s
  s2\> s\!
  s1\dynamictext "dolce"
  s2 s\< s\> s\!
  s\> s\!
  s1 * 7
  s2\> s\!
  s1 s s2. s4\dynamictext "Ped."
  s1\dynamictext "cresc."
  s
  s4\f\> s4\! s2\dynamictext "decresc."
  s1\p s s s s\p
  s s2 s\dynamictext "cresc."
  s1\f s2 s\dynamictext "cresc."
  s1\f
  s2 s\dynamictext "decresc."
  s1 s
  s2 s\dynamictext "cresc."
  s1\f
}

ldyn = {
  s4

}
struktur = {
  %\override Score.NonMusicalPaperColumn.page-break-permission = ##f
  \override PianoStaff.VerticalAxisGroup.staff-staff-spacing.basic-distance = #12
  \override StaffGroup.VerticalAxisGroup.staff-staff-spacing.basic-distance = #16
  \override Score.SpacingSpanner.common-shortest-duration = #(ly:make-moment 1/16)
  s8 s1*9
  \newSpacingSection
  \override Score.SpacingSpanner.common-shortest-duration = #(ly:make-moment 1/4)
  s1 * 38
  \newSpacingSection
  \override Score.SpacingSpanner.common-shortest-duration = #(ly:make-moment 1/16)
}

versi =
\lyricmode {
  Sie liebt mich, sie liebt mich,
  ja sie liebt mich.
  Welch schreck -- li -- ches Be -- ben!
  Fühl' ich mich sel -- ber?
  Fühl' ich mich sel -- ber bin ich am Le -- ben.
  Sie __ liebt mich, sie __ liebt mich!
  \set stanza = "1."
  Ach kann die See -- le dich denn er -- fas -- sen,
  Glück oh -- ne Na -- me, kann es dich las -- sen.
  Ein -- mal er -- wacht, ein -- mal er -- wacht!
  Glück __ oh -- ne Na -- me!
  Sie liebt mich, sie liebt mich,
  ja sie liebt mich.
  Ja __ sie liebt mich!
  %   Fühl' ich mich selber?
  %  Bin ich am Leben?
  %  Sie [liebt]2 mich!
  %  Sie liebt mich!3
}

versii =
\lyricmode {
  \repeat unfold 37 \skip 1
  \set stanza = "2."
  Ach rings so an -- ders,
  bist du's noch Son -- ne,
  bist du's noch, Hüt -- te,
  tra -- ge die Won -- ne,
  tra -- ge die
  \set ignoreMelismata = ##t
  Won -- _ ne,
  see -- li -- ges Herz.
  \set ignoreMelismata = ##f
  Tra -- ge die Won -- ne!
  % Bist du's noch, Sonne?
  %  Bist du's noch, Hütte?
  %  Trage die Wonne,
  %  Seliges Herz!
  %  Sie liebt mich!
  %  Sie liebt mich
}

RHi =
\relative c' {
  \tonart
  %\mergeDifferentlyDottedOff
  %\mergeDifferentlyHeadedOn
  \tempo \markup "Agitato"
  r16 < h d g h >
  \set doubleSlurs = ##t
  q4-> ( < c d fis a >8)[ r16 < d fis a c >] q4-> ( < d g h >8[) r16 < fis a c e g >]
  < fis a c e >4->( < g h d >8[) r16 < c d fis a >] q4 ( < h d g h >8) r
  \set doubleSlurs = ##f
  < fis' a c e >4.-^( < fis a c >8 < d fis a c >4 < c d fis a >)
  < a c d fis > < fis a c d > \voiceOne c' ( h )
  \oneVoice
  < fis' a c e >4.( < fis a c >8 < d fis a c >4 < c d fis a >)
  < a c d fis > < fis a c d > \voiceOne c' ( h )
  d2 ( c )
  h2. ( a4)
  \oneVoice
  < g d h > r < d g > r
  < h g >1
  s1
  \voiceOne
  fis''4. e8 4 d
  c2 h4( a g fis g gis)
  s1 s
  c2 h4( a
  g fis g fis)
  s1 * 24
  \oneVoice
  < g d h >4 r r2 s1
  \voiceOne
  fis'4. e8 4 d
  s1
  \oneVoice
  s2 s4 s8. < h, e g h >16
  \set doubleSlurs = ##t
  < h d g h >4 ( < a d fis a >8.) < d fis a c >16
  q4 ( < d g h >8.) < fis a c e >16
  q4 ( < g h d >8.) < c d fis a >16 q4 < h d g h >
  < fis' a c e >4. q8 < d fis a c >4 < c d fis a >
  \set doubleSlurs = ##f
  < a c d fis > < fis a c d > c' ( h )
  < fis' a c e >4. < fis a c d >8 < d fis a c >4 < c d fis a >
  < a c d fis > < fis a c d > c' ( h )
  d2 ( c ) h ( a )
  < g d h >4 r < d h > r s1
  \bar "|."
}

runter = { \change Staff="down" \voiceOne }
rauf = { \change Staff="up" \voiceTwo }
RHii =
\relative c' {
  s8
  s1 s s
  s2
  \voiceTwo
  < d g > s1 s2 q
  < fis a >1
  \arp #-4 #-1
  < h, d fis >1\arpeggio s1 s
  \omit TupletBracket
  \omit TupletNumber
  \oneVoice
  \tupletSpan 4
  \oneVoice
  \tuplet 3/2
  {
    \runter r8 fis( c' d c fis,) r a( c < d fis > c a) \rauf
    \slurUp
    fis'( a c) fis,( a c) e,( a c) d,( a' c)
    c,( e g) c,( e g) h,( d g) a,( d fis)
    \slurNeutral
    \runter
    g,( h d) fis,( ais d) g,( h d) gis,( h d)
    \rauf \oneVoice
    \slurDown
    r a( d a' d, a r) h( d < f h > d h)
    r c( d < fis! c' > d c) r c( d < fis a > d c)
    \voiceTwo \slurNeutral
    c e g c,( e g) h,( d g) a,( d fis)
    \runter
    g,( h e) fis,( ais d) g,( h e) fis,( a d)
    r e,( h' e h e,) r e( a < cis e > a e)
    r d a' d a d, r fis a < d fis > a fis
    \rauf
    \oneVoice
    h( d g h g d) a( cis e a e cis)
    r a( d a' d, a) r d( fis d' fis, d)
    h( d g h g d) a( cis e a e cis)
    r a( d a' d, a) r a( d fis d a)
    r gis( d' < e gis > d gis,) r d'( e gis e d)
    r d( fis a fis d) r a( d a' d, a)
    r g( d' e d g,) r g( cis e cis g)
    \runter
    \override Script.direction = #UP
    r fis( a d a fis) fis'-^( d a) \rauf \oneVoice
    \override Script.direction = #UP
    a'-^( fis d)
    d'-^( a fis) fis'( d a) a'( fis d) c'( fis, d)
    h'( d, c) a'( d, c) g'( c, a) fis'( c a)
    e' a, fis d'( a fis c' fis, d a' fis d)
    r g( d) r fis( d) r g( d) r gis( d)
    r a'( d,) r h'( d,) r c'( d,) r cis'( d,)
    r d'( d,) r fis( es) r g( d) r gis( d)
    r a'( d,) r h'( d,) r < fis c' >( d) r < fis d' >( d)
    h( d g h g d) c d( fis c' fis, d)
    d( g h d h g) e( g a e' a, g)
    h,( d g h g d) fis,( c' d fis d c)
    g( h d g d h) a( h dis a' dis, h)
    gis( d' e gis e d) d[( e h' d h e,])
    c[( e a c a e]) a,[( c e a e c])
    g[( h d g d h]) a[( c d fis d c])
    \runter
    g, d' cis d cis d cis d cis d cis d
    \rauf
    \oneVoice
    r8 a'( c fis c a) r c( fis a fis c)
    \voiceTwo \slurUp
    fis( a c) fis,( a c) e,( a c) d,( a' c)
    \oneVoice
    r g,( d' g d g,) r a( c < e g > c a)
    r a( c < c fis > c a < a d g >4) r8. s8
  }
  s8 |
  s1 s s
  s2 < d g >1*1/2
  s1 s2 < d g >1*1/2
  < fis a >1 < a, d fis >\arpeggio
}

LHi =
\relative c, {
  \mergeDifferentlyDottedOff
  \mergeDifferentlyHeadedOff
  \clef bass
  \tonart
  r8
  \tupletSpan 4
  \tuplet 3/2 {
    c8( d' cis d cis d) cis( d cis d cis d)
    \omit TupletBracket
    \omit TupletNumber
    \repeat unfold 2 { d,( d' cis d cis d d, d' cis d cis d) }
    \voiceOne
    \repeat unfold 2 {
      cis( d cis d cis d) r d( cis d cis d)
      r d( cis d cis d cis d cis d cis d)
    }
    \repeat unfold 3 { r d( cis d cis d cis d cis d cis d) }
  }
  \oneVoice
  s1 s
  < e g >2 < d g >4 < c d >
  \voiceTwo
  < h d > < ais d > < h d > < eis, d' >
  < fis fis' >2 < gis gis' > < a a' > q
  < e' g > d4 < c d >
  < d h > < d ais > < d h > < d ais >
  gis,2 g
  fis d \oneVoice g g' fis < a d, >
  g, g' fis d h h
  a < a fis' > a a
  < d d, >1 q < fis a, d, > < d a' c >2. c4
  c'( ais h eis,)
  fis( g a ais)
  h( a h eis,)
  e( g a d,)
  < d g g, >2 < d a a' > < d h h' > < c e g a >
  d d, g < f f' >
  < e e' > < gis gis' >
  < a a' > c d d,
  \once \override NoteColumn.force-hshift = 1
  g1
  d2 d'
  < d a' d >4. < g a c >8 g4 fis
  h,2 c4 a
  d2 \tupletSpan 4
  \tuplet 3/2
  {
    \stemDown
    < g g, >8[ d( cis d cis d])
    \stemNeutral
    \slurUp
    d,([ d' cis d cis d] cis[ d cis d cis d)]
    d,( d' cis d cis d) d\rest d( cis d cis d)
    d,( d' cis d cis d) d\rest d( cis d cis d)
    \repeat unfold 2 {
      d\rest d( cis d cis d) d\rest d( cis d cis d)
      d\rest d( cis d cis d cis d cis d cis d)
    }
    d\rest d( cis d cis d cis d cis d cis d)
    d\rest d( cis d cis d) d\rest d( cis d cis d)
  }
  < g d g, >1\fermata
}

LHii =
\relative c, {
  s8
  \voiceTwo
  s1 s s d2 g s d
  d g d1 d
  g2 g g1 d d'
  s1 * 35
  d,1
  \once \override NoteColumn.force-hshift = 2
  d2 d
  \once \override NoteColumn.force-hshift = 2 d d
  d g d1 d2 g
}

\score {
  \new StaffGroup
  <<
    \new Dynamics \dynalt
    \new Staff = "Alt" \with { instrumentName = \markup \fontsize #2 #"Voce" }
    \new Voice = "alt" \Alt
    \new Lyrics \lyricsto "alt" \versi
    \new Lyrics \lyricsto "alt" \versii
    \new PianoStaff
    \with { instrumentName = \markup \fontsize #2 "Pianof:" }
    <<
      \new Staff = "up"
      <<
        \new Voice \RHi
        \context Voice { s2. * 6 \override Staff.BarNumber.stencil = ##f }
        \new Voice \RHii
      >>
      \new Dynamics \rdyn
      \new Staff = "down"
      <<
        \new Voice \LHi
        \new Voice \LHii
        \new NullVoice \struktur
      >>
      \new Dynamics \ldyn
    >>
  >>
}

#(set-global-staff-size 24)
\include "articulate.ly"

#(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))

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 (golo-schu layout props titel nr ton)
   (string? string? string?)
   (interpret-markup layout props
     #{
       \markup
       {
         \column {
           \override #'(baseline-skip . 2)
           \column
           {
             \fill-line \override #'(baseline-skip . 2.5) {
               \huge \larger \larger \bold
               \center-column
               {
                 $titel
                 \fontsize #-3 \line { "GL &numero; 711/" $nr \fontsize #-1 \concat { " (bis 2013 &numero; 802/" $nr ) } }
                 " "
               }
             }
             \column
             \fontsize #-1.5
             {
               \fill-line {
                 "T: Josel Ph. Neumann (1774-1849)" "M: Franz Schubert (1797-1828)"
               }
               \fill-line {
                 "Notensatz: lilypond.miraheze.org" "Deutsche Messe D872"
               }
               \fill-line {
                 "" \concat { "Originaltonart: " $ton "-Dur" }
               }
             }
           }
         }
       }
     #}
     )
   )

#(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)))

dropLyrics =
#(define-scheme-function (l)(number?)
   #{
     \override LyricText.extra-offset = #`(0 . ,l)
     \override LyricHyphen.extra-offset = #`(0 . ,l)
     \override LyricExtender.extra-offset = #`(0 . ,l)
     \override StanzaNumber.extra-offset = #`(0 . ,l)
   #}
   )

raiseLyrics = {
  \revert LyricText.extra-offset
  \revert LyricHyphen.extra-offset
  \revert LyricExtender.extra-offset
  \revert StanzaNumber.extra-offset
}

\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 #-3 \line {
            \text-fromproperty "GL &numero; " #'header:new-number ""
            \fontsize #-1
            \text-fromproperty " (bis 2013 &numero; " #'header:old-number ")"
          }
          " "
        }
      }
      \fontsize #-1.5 {
        \fill-line {
          \fromproperty #'header:poet \fromproperty #'header:composer
        }
        \fill-line {
          "Notensatz: lilypond.miraheze.org" ""
          \tonart-fromproperty "Originaltonart: " #'header:key  #'header:dur
        }
        \fill-line {
          \fromproperty  #'header:instrument
          \fromproperty  #'header:arranger
        }
      }
    }
  }
}

orgel =
%Notensatz für Orgelnoten 4stimmig + Text + Harmonisierung + Umbrüche
#(define-music-function (sop alt ten bas akk stru lyr p)
   (ly:music? ly:music? ly:music? ly:music? ly:music? ly:music? ly:music? ly:pitch?)
   #{
     <<
       \new ChordNames \transpose c $p $akk
       \new PianoStaff="leadsheet"
       <<
         \new Staff="up"
         <<
           \new Voice="Alt"
           \with { \consists Ambitus_engraver }
           { \voiceOne \transpose c $p $sop }
           \new Voice { \voiceTwo \transpose c $p $alt }
         >>
         \new Lyrics \lyricsto Alt $lyr
         \new Staff="down"
         <<
           \new Voice { \voiceOne \transpose c $p $ten }
           \new Voice { \voiceTwo \transpose c $p $bas }
           \new NullVoice $stru
         >>
       >>
     >>
   #}
   )

orgels =
%% simple orgelsatz nur SATBs kein Liedtext
#(define-music-function (sop alt ten bas stru p)
   (ly:music? ly:music? ly:music? ly:music? ly:music? ly:pitch?)
   #{
     <<
       \new PianoStaff="leadsheet"
       <<
         \new Staff="up"
         <<
           \new Voice="Alt"
           \with { \consists Ambitus_engraver }
           { \voiceOne \transpose c $p $sop }
           \new Voice { \voiceTwo \transpose c $p $alt }
         >>
         \new Staff="down"
         <<
           \new Voice { \voiceOne \transpose c $p $ten }
           \new Voice { \voiceTwo \transpose c $p $bas }
           \new NullVoice $stru
         >>
       >>
     >>
   #}
   )

orgelo =
% keine Transponiermöglichkeit
#(define-music-function (sop alt ten bas akk stru lyr)
   (ly:music? ly:music? ly:music? ly:music? ly:music? ly:music? ly:music?)
   #{
     <<
       \new ChordNames $akk
       \new PianoStaff="leadsheet"
       <<
         \new Staff="up"
         <<
           \new Voice="Alt"
           \with { \consists Ambitus_engraver }
           { \voiceOne $sop }
           \new Voice { \voiceTwo $alt }
         >>
         \new Lyrics \lyricsto Alt $lyr
         \new Staff="down"
         <<
           \new Voice { \voiceOne $ten }
           \new Voice { \voiceTwo $bas }
           \new NullVoice $stru
         >>
       >>
     >>
   #}
   )

orgelp =
%% Orgelsatz mit Pedal
#(define-music-function (sop alt ten bas ped akk stru lyr p)
   (ly:music? ly:music? ly:music? ly:music? ly:music? ly:music? ly:music? ly:music? ly:pitch?)
   #{

     <<
       \new ChordNames \transpose c $p $akk
       \new PianoStaff="leadsheet"
       <<
         \new Staff="up"
         <<
           \new Voice="Alt"
           \with { \consists Ambitus_engraver }
           { \voiceOne \transpose c $p $sop }
           \new Voice { \voiceTwo \transpose c $p $alt }
         >>
         \new Lyrics \lyricsto Alt $lyr
         \new Staff="down"
         <<
           \new Voice { \voiceOne \transpose c $p $ten }
           \new Voice { \voiceTwo \transpose c $p $bas }
           \new NullVoice $stru
         >>

       >>
       \new StaffGroup
       \new Staff="Pedal" \with {
         \magnifyStaff #5/7
       }
       <<
         \new Voice \transpose c $p $ped
       >>
     >>
   #}
   )

orgelpo =
%% Orgelnoten mit Pedal ohne Transponierung
#(define-music-function (sop alt ten bas ped akk stru lyr)
   (ly:music? ly:music? ly:music? ly:music? ly:music? ly:music? ly:music? ly:music?)
   #{

     <<
       \new ChordNames $akk
       \new PianoStaff="leadsheet"
       <<
         \new Staff="up"
         <<
           \new Voice="Alt"
           \with { \consists Ambitus_engraver }
           { \voiceOne $sop }
           \new Voice { \voiceTwo $alt }
         >>
         \new Lyrics \lyricsto Alt $lyr
         \new Staff="down"
         <<
           \new Voice { \voiceOne $ten }
           \new Voice { \voiceTwo $bas }
           \new NullVoice $stru
         >>

       >>
       \new StaffGroup
       \new Staff="Pedal" \with {
         \magnifyStaff #5/7
       }
       <<
         \new Voice $ped
       >>
     >>
   #}
   )

orgelly =
%% eine 2. Textzeile unterhalb
#(define-music-function (sop alt ten bas akk stru lyr lyrii p)
   (ly:music? ly:music? ly:music? ly:music? ly:music? ly:music? ly:music? ly:music? ly:pitch?)
   #{
     <<
       \new ChordNames \transpose c $p $akk
       \new PianoStaff="leadsheet"
       <<
         \new Staff="up"
         <<
           \new Voice="Alt"
           \with { \consists Ambitus_engraver }
           { \voiceOne \transpose c $p $sop }
           \new Voice { \voiceTwo \transpose c $p $alt }
         >>
         \new Lyrics \lyricsto Alt $lyr
         \new Lyrics \lyricsto Alt $lyrii
         \new Staff="down"
         <<
           \new Voice { \voiceOne \transpose c $p $ten }
           \new Voice { \voiceTwo \transpose c $p $bas }
           \new NullVoice $stru
         >>
       >>
     >>
   #}
   )

orgelpre =
%Notensatz für Vorspiel 4stimmig + Umbrüche
#(define-music-function (sop alt ten bas stru p)
   (ly:music? ly:music? ly:music? ly:music? ly:music? ly:pitch?)
   #{
     <<
       \new PianoStaff="up"
       <<
         \new Staff="up"
         <<
           \new Voice="Alt" { \voiceOne \transpose c $p $sop }
           \new Voice { \voiceTwo \transpose c $p $alt }
         >>
         \new Staff="down"
         <<
           \new Voice { \voiceOne \transpose c $p $ten }
           \new Voice { \voiceTwo \transpose c $p $bas }
           \new NullVoice $stru
         >>
       >>
     >>
   #}
   )

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 (substring (ly:parser-output-name) 4))
         tempo)))
    tempolist))

formidi =
%erzeugen des Scores für Midi
#(define-music-function (sop alt ten bas voc)
   (ly:music? ly:music? ly:music? ly:music? ly:music?)
   #{
     <<
       \new Staff {
         \new Voice {
           \set Staff.midiInstrument = "choir aahs"
           $voc
         }
       }
       \new Staff <<
         \set Staff.midiInstrument = "Church Organ"
         \new Voice $sop
         \new Voice $alt
         \new Voice $ten
         \new Voice $bas
       >>
     >>
   #}
   )

#(define myMidi "C:/Manuela/_Lilypond/orgel/Golo/midi/")

midi-list =
#(define-void-function (name sop alt ten bas voc tempolist)
   ((string? #f) ly:music? ly:music? ly:music? ly:music? ly:music? list?)
   (for-each
    (lambda (tempo)
      (ly:book-process
       (apply
        ly:make-book
        $defaultpaper
        $defaultheader
        (list (scorify-music #{
          <<
            \unfoldRepeats \new Staff {
              \new Voice {
                \set Staff.midiInstrument = "choir aahs"
                $voc
              }
            }
            \unfoldRepeats \new Staff <<
              \set Staff.midiInstrument = "Church Organ"
              \new Voice $sop
              \new Voice $alt
              \new Voice $ten
              \new Voice $bas
            >>
          >>
                #})))
       $defaultpaper
       #{
         \midi {
           \tempo 4 = $tempo
         }
       #}
       (format #f "~a_~a"
         (or name (string-append myMidi (ly:parser-output-name)))
         tempo)))
    tempolist))

midi-list-paus =
#(define-void-function (name sop alt ten bas voc pause tempolist)
   ((string? #f) ly:music? ly:music? ly:music? ly:music? ly:music? ly:music? list?)
   (for-each
    (lambda (tempo)
      (ly:book-process
       (apply
        ly:make-book
        $defaultpaper
        $defaultheader
        (list (scorify-music #{
          <<
            \unfoldRepeats \new Staff {
              \new Voice {
                \set Staff.midiInstrument = "choir aahs"
                $pause $voc
              }
            }
            \unfoldRepeats
            <<
              \new Staff \with { midiInstrument = #"church organ" }
              { $pause $sop }
              \new Staff \with { midiInstrument = #"church organ" }
              { $pause $alt }
              \new Staff \with { midiInstrument = #"church organ" }
              { $pause $ten }
              \new Staff \with { midiInstrument = #"church organ" }
              { $pause $bas }
            >>
          >>
                #})))
       $defaultpaper
       #{
         \midi {
           \tempo 4 = $tempo
         }
       #}
       (format #f "~a_~a"
         (or name (string-append myMidi (ly:parser-output-name)))
         tempo)))
    tempolist))

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
   #}
   )

mynotes =
#(define-music-function (m n)
   (ly:duration? ly:duration?)
   #{
     \override Score.RehearsalMark.break-align-symbols = #'(time-signature)
     \once \override Score.RehearsalMark.self-alignment-X = #-1
     \mark \markup \concat { \fontsize #-3.5 \note { $m } #UP " /" \fontsize #-3.5 \note { $n } #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
     #}))



chExceptionMusic = {
  <c e gis>1-\markup "(m)"
  <c f g>1-\markup \super "4"
}

% Convert music to list and prepend to existing exceptions.
chExceptions = #(append
                 (sequential-music-to-chord-exceptions chExceptionMusic #t)
                 ignatzekExceptions)

\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
    \consists Horizontal_bracket_engraver
    \override HorizontalBracket.direction = #UP
    \override HorizontalBracket.bracket-flare = #'(0 . 0)
    \override HorizontalBracketText.text = \markup \italic "Intro"
    \override HorizontalBracket.shorten-pair = #'(.5 . .5)
  }
  \context {
    \Lyrics
    \override VerticalAxisGroup.staff-affinity = #CENTER
    \override LyricText.font-size = #-1.5
    \override StanzaNumber.font-size = #-1.5
  }
  \context {
    \Staff
    printPartCombineTexts = ##f
    beamExceptions = #'()
    \override BreathingSign.text =
    \markup { \musicglyph "scripts.lvarcomma" }
    \override InstrumentName.font-features = #'("smcp")
    \consists #Span_stem_engraver
    %     \consists Measure_spanner_engraver
    %     \override MeasureSpanner.text = \markup \italic "Intro"
  }
  \context {
    \Score
    \override VerticalAxisGroup.remove-first = ##t
    skipBars = ##f
    \override MetronomeMark.font-size = #1
    \override MetronomeMark.font-shape = #'caps
    \override BarLine.thick-thickness = 5
    \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
    chordNameExceptions = #chExceptions
    \override ChordName.self-alignment-X = #CENTER
    \override ChordName.font-name = #"Arial Narrow"
    \override ChordName.layer = #2
    \override ChordName.font-size = #-0.5
    noChordSymbol = ##f
    \consists Horizontal_bracket_engraver
    \override HorizontalBracket.direction = #UP
    \override HorizontalBracket.bracket-flare = #'(0 . 0)
    \override HorizontalBracketText.text = \markup \italic "Intro"
  }
  \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
  }
}

oob = { \once \override Score.BarNumber.stencil = ##f \bar "" }
bnf = \once \override Score.BarNumber.stencil = ##f

gloria = \markup \override #'(baseline-skip . 2) \left-column {
  \line { Gloria: Ehre sei Gott }
  \line {
    Stichwort: \italic "Herr, erbarme dich unser"
  }
  \line { manchmal sagt der P so etwas ähnliches wie \italic "Ehre sei Gott in der Höhe" }
}

sanctus = \markup \override #'(baseline-skip . 2) \left-column {
  \line { Lobpreis Gottes: Heilig, heilig, heilig }
  \line {
    Stichwort: \italic "und singen mit den Engeln das Lob deiner Herrlichkeit"
  }
}

antwortlied = \markup \override #'(baseline-skip . 2) \left-column {
  \line { Antwortlied: nach der ersten Lesung }
  \line {
    Stichwort: \italic "Wort des lebendigen Gottes"
  }
}

gabenbereitung = \markup \override #'(baseline-skip . 2) \left-column {
  \wordwrap { Gabenbereitung (Offertorium): Beginn der Eucharistiefeier, nach den Fürbitten }
  \vspace #.2
  \line {
    Stichwort: \italic "darum bitten wir durch Christus, unsern Herrn"
  }
}

agnus =  \markup \override #'(baseline-skip . 2) \left-column {
  \line { Agnus Dei: Pfarrer zerbricht Hostie in mehrere Teile }
  \line {
    wann: nach dem Friedensgruß
  }
}

danklied =  \markup \override #'(baseline-skip . 2) \left-column {
  \line { Danklied }
  \line {
    wann: nach der Kommunionausteilung
  }
}

auszug =   \markup \override #'(baseline-skip . 2) \left-column {
  \line { Auszug, Verabschiedung }
  \line {
    Stichwort: \italic "gehet hin in Frieden"
  }
}

halleljua =  \markup \override #'(baseline-skip . 3) \left-column {
  \line { 1x leise }
  \line {
    1x leise, Vorbeter singt
  }
  \line {
    1x laut, Gemeinde singt
  }
  \line { Vorbeter betet }
  \line {
    1x laut, Gemeinde singt
  }
}

noambitus = {
  \override AmbitusLine.stencil = ##f
  \override AmbitusNoteHead.stencil = ##f
}

myintro =
#(define-music-function (m) ((string? #f) )
   #{
     \override HorizontalBracketText.text = \markup \italic { "Intro" $m }
   #})

%% Zusatztext und extra-offset sind optional
%% es müssen beide Parameter angegeben werden, wenn einer angegeben wird
mybrack =
#(define-music-function (t n m) ((string? #f) (number? 3.5) ly:music?)
   #{
     {
       \once \override HorizontalBracket.Y-extent = #'(0 . 0)
       \once \override HorizontalBracketText.Y-extent = #'(0 . 0)
       \once \override HorizontalBracket.extra-offset = #`(0 . ,n)
       \once \override HorizontalBracketText.extra-offset = #`(0 . ,n)
       \once \override HorizontalBracketText.text =
       \markup \italic { "Intro" #(or t "") }
       <>\startGroup
       $m
       \stopGroup
     }
   #})

%% ein optionaler Parameter
%% n ... extra-offset, nach oben verschieben
%%       der Standardwert ist für einen ChordNames-context oberhalb berechnet
%% der Zusatztext wird auf \null gesetzt

mybrack-offset =
#(define-music-function (n m) ((number? 3.5) ly:music?)
   #{
     {
       \mybrack "" $n $m
     }
   #})

#(define (lined-nh grob)
   (let* ((default-stil (ly:note-head::print grob))
          (default-stil-x-lngth
           (interval-length (ly:stencil-extent default-stil X)))
          (line-thickness (ly:staff-symbol-line-thickness grob))
          (staff-space (ly:staff-symbol-staff-space grob))
          (font-size
           (assoc-get 'font-size
             (ly:prob-property (ly:grob-property grob 'cause) 'tweaks)))
          (corr
           (if (number? font-size)
               (magstep font-size)
               1))
          (lne
           (make-line-stencil
            (* 1.9 corr line-thickness)
            0
            (/ (* 1.25 corr staff-space) -2)
            0
            (/ (* 1.25 corr staff-space) 2))))
     (ly:stencil-add
      lne
      (ly:stencil-translate-axis
       default-stil (* 0.95 corr line-thickness) X)
      (ly:stencil-translate-axis
       lne (+ (* 1.9 corr line-thickness) default-stil-x-lngth) X))))

#(set-global-staff-size 24)
\include "articulate.ly"

#(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))

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 (golo-schu layout props titel nr ton)
   (string? string? string?)
   (interpret-markup layout props
     #{
       \markup
       {
         \column {
           \override #'(baseline-skip . 2)
           \column
           {
             \fill-line \override #'(baseline-skip . 2.5) {
               \huge \larger \larger \bold
               \center-column
               {
                 $titel
                 \fontsize #-3 \line { "GL &numero; 711/" $nr \fontsize #-1 \concat { " (bis 2013 &numero; 802/" $nr ) } }
                 " "
               }
             }
             \column
             \fontsize #-1.5
             {
               \fill-line {
                 "T: Josel Ph. Neumann (1774-1849)" "M: Franz Schubert (1797-1828)"
               }
               \fill-line {
                 "Notensatz: lilypond.miraheze.org" "Deutsche Messe D872"
               }
               \fill-line {
                 "" \concat { "Originaltonart: " $ton "-Dur" }
               }
             }
           }
         }
       }
     #}
     )
   )

#(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)))

dropLyrics =
#(define-scheme-function (l)(number?)
   #{
     \override LyricText.extra-offset = #`(0 . ,l)
     \override LyricHyphen.extra-offset = #`(0 . ,l)
     \override LyricExtender.extra-offset = #`(0 . ,l)
     \override StanzaNumber.extra-offset = #`(0 . ,l)
   #}
   )

raiseLyrics = {
  \revert LyricText.extra-offset
  \revert LyricHyphen.extra-offset
  \revert LyricExtender.extra-offset
  \revert StanzaNumber.extra-offset
}

\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 #-3 \line {
            \text-fromproperty "GL &numero; " #'header:new-number ""
            \fontsize #-1
            \text-fromproperty " (bis 2013 &numero; " #'header:old-number ")"
          }
          " "
        }
      }
      \fontsize #-1.5 {
        \fill-line {
          \fromproperty #'header:poet \fromproperty #'header:composer
        }
        \fill-line {
          "Notensatz: lilypond.miraheze.org" ""
          \tonart-fromproperty "Originaltonart: " #'header:key  #'header:dur
        }
        \fill-line {
          \fromproperty  #'header:instrument
          \fromproperty  #'header:arranger
        }
      }
    }
  }
}

orgel =
%Notensatz für Orgelnoten 4stimmig + Text + Harmonisierung + Umbrüche
#(define-music-function (sop alt ten bas akk stru lyr p)
   (ly:music? ly:music? ly:music? ly:music? ly:music? ly:music? ly:music? ly:pitch?)
   #{
     <<
       \new ChordNames \transpose c $p $akk
       \new PianoStaff="leadsheet"
       <<
         \new Staff="up"
         <<
           \new Voice="Alt"
           \with { \consists Ambitus_engraver }
           { \voiceOne \transpose c $p $sop }
           \new Voice { \voiceTwo \transpose c $p $alt }
         >>
         \new Lyrics \lyricsto Alt $lyr
         \new Staff="down"
         <<
           \new Voice { \voiceOne \transpose c $p $ten }
           \new Voice { \voiceTwo \transpose c $p $bas }
           \new NullVoice $stru
         >>
       >>
     >>
   #}
   )

orgels =
%% simple orgelsatz nur SATBs kein Liedtext
#(define-music-function (sop alt ten bas stru p)
   (ly:music? ly:music? ly:music? ly:music? ly:music? ly:pitch?)
   #{
     <<
       \new PianoStaff="leadsheet"
       <<
         \new Staff="up"
         <<
           \new Voice="Alt"
           \with { \consists Ambitus_engraver }
           { \voiceOne \transpose c $p $sop }
           \new Voice { \voiceTwo \transpose c $p $alt }
         >>
         \new Staff="down"
         <<
           \new Voice { \voiceOne \transpose c $p $ten }
           \new Voice { \voiceTwo \transpose c $p $bas }
           \new NullVoice $stru
         >>
       >>
     >>
   #}
   )

orgelo =
% keine Transponiermöglichkeit
#(define-music-function (sop alt ten bas akk stru lyr)
   (ly:music? ly:music? ly:music? ly:music? ly:music? ly:music? ly:music?)
   #{
     <<
       \new ChordNames $akk
       \new PianoStaff="leadsheet"
       <<
         \new Staff="up"
         <<
           \new Voice="Alt"
           \with { \consists Ambitus_engraver }
           { \voiceOne $sop }
           \new Voice { \voiceTwo $alt }
         >>
         \new Lyrics \lyricsto Alt $lyr
         \new Staff="down"
         <<
           \new Voice { \voiceOne $ten }
           \new Voice { \voiceTwo $bas }
           \new NullVoice $stru
         >>
       >>
     >>
   #}
   )

orgelp =
%% Orgelsatz mit Pedal
#(define-music-function (sop alt ten bas ped akk stru lyr p)
   (ly:music? ly:music? ly:music? ly:music? ly:music? ly:music? ly:music? ly:music? ly:pitch?)
   #{

     <<
       \new ChordNames \transpose c $p $akk
       \new PianoStaff="leadsheet"
       <<
         \new Staff="up"
         <<
           \new Voice="Alt"
           \with { \consists Ambitus_engraver }
           { \voiceOne \transpose c $p $sop }
           \new Voice { \voiceTwo \transpose c $p $alt }
         >>
         \new Lyrics \lyricsto Alt $lyr
         \new Staff="down"
         <<
           \new Voice { \voiceOne \transpose c $p $ten }
           \new Voice { \voiceTwo \transpose c $p $bas }
           \new NullVoice $stru
         >>

       >>
       \new StaffGroup
       \new Staff="Pedal" \with {
         \magnifyStaff #5/7
       }
       <<
         \new Voice \transpose c $p $ped
       >>
     >>
   #}
   )

orgelpo =
%% Orgelnoten mit Pedal ohne Transponierung
#(define-music-function (sop alt ten bas ped akk stru lyr)
   (ly:music? ly:music? ly:music? ly:music? ly:music? ly:music? ly:music? ly:music?)
   #{

     <<
       \new ChordNames $akk
       \new PianoStaff="leadsheet"
       <<
         \new Staff="up"
         <<
           \new Voice="Alt"
           \with { \consists Ambitus_engraver }
           { \voiceOne $sop }
           \new Voice { \voiceTwo $alt }
         >>
         \new Lyrics \lyricsto Alt $lyr
         \new Staff="down"
         <<
           \new Voice { \voiceOne $ten }
           \new Voice { \voiceTwo $bas }
           \new NullVoice $stru
         >>

       >>
       \new StaffGroup
       \new Staff="Pedal" \with {
         \magnifyStaff #5/7
       }
       <<
         \new Voice $ped
       >>
     >>
   #}
   )

orgelly =
%% eine 2. Textzeile unterhalb
#(define-music-function (sop alt ten bas akk stru lyr lyrii p)
   (ly:music? ly:music? ly:music? ly:music? ly:music? ly:music? ly:music? ly:music? ly:pitch?)
   #{
     <<
       \new ChordNames \transpose c $p $akk
       \new PianoStaff="leadsheet"
       <<
         \new Staff="up"
         <<
           \new Voice="Alt"
           \with { \consists Ambitus_engraver }
           { \voiceOne \transpose c $p $sop }
           \new Voice { \voiceTwo \transpose c $p $alt }
         >>
         \new Lyrics \lyricsto Alt $lyr
         \new Lyrics \lyricsto Alt $lyrii
         \new Staff="down"
         <<
           \new Voice { \voiceOne \transpose c $p $ten }
           \new Voice { \voiceTwo \transpose c $p $bas }
           \new NullVoice $stru
         >>
       >>
     >>
   #}
   )

orgelpre =
%Notensatz für Vorspiel 4stimmig + Umbrüche
#(define-music-function (sop alt ten bas stru p)
   (ly:music? ly:music? ly:music? ly:music? ly:music? ly:pitch?)
   #{
     <<
       \new PianoStaff="up"
       <<
         \new Staff="up"
         <<
           \new Voice="Alt" { \voiceOne \transpose c $p $sop }
           \new Voice { \voiceTwo \transpose c $p $alt }
         >>
         \new Staff="down"
         <<
           \new Voice { \voiceOne \transpose c $p $ten }
           \new Voice { \voiceTwo \transpose c $p $bas }
           \new NullVoice $stru
         >>
       >>
     >>
   #}
   )

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 (substring (ly:parser-output-name) 4))
         tempo)))
    tempolist))

formidi =
%erzeugen des Scores für Midi
#(define-music-function (sop alt ten bas voc)
   (ly:music? ly:music? ly:music? ly:music? ly:music?)
   #{
     <<
       \new Staff {
         \new Voice {
           \set Staff.midiInstrument = "choir aahs"
           $voc
         }
       }
       \new Staff <<
         \set Staff.midiInstrument = "Church Organ"
         \new Voice $sop
         \new Voice $alt
         \new Voice $ten
         \new Voice $bas
       >>
     >>
   #}
   )

#(define myMidi "C:/Manuela/_Lilypond/orgel/Golo/midi/")

midi-list =
#(define-void-function (name sop alt ten bas voc tempolist)
   ((string? #f) ly:music? ly:music? ly:music? ly:music? ly:music? list?)
   (for-each
    (lambda (tempo)
      (ly:book-process
       (apply
        ly:make-book
        $defaultpaper
        $defaultheader
        (list (scorify-music #{
          <<
            \unfoldRepeats \new Staff {
              \new Voice {
                \set Staff.midiInstrument = "choir aahs"
                $voc
              }
            }
            \unfoldRepeats \new Staff <<
              \set Staff.midiInstrument = "Church Organ"
              \new Voice $sop
              \new Voice $alt
              \new Voice $ten
              \new Voice $bas
            >>
          >>
                #})))
       $defaultpaper
       #{
         \midi {
           \tempo 4 = $tempo
         }
       #}
       (format #f "~a_~a"
         (or name (string-append myMidi (ly:parser-output-name)))
         tempo)))
    tempolist))

midi-list-paus =
#(define-void-function (name sop alt ten bas voc pause tempolist)
   ((string? #f) ly:music? ly:music? ly:music? ly:music? ly:music? ly:music? list?)
   (for-each
    (lambda (tempo)
      (ly:book-process
       (apply
        ly:make-book
        $defaultpaper
        $defaultheader
        (list (scorify-music #{
          <<
            \unfoldRepeats \new Staff {
              \new Voice {
                \set Staff.midiInstrument = "choir aahs"
                $pause $voc
              }
            }
            \unfoldRepeats
            <<
              \new Staff \with { midiInstrument = #"church organ" }
              { $pause $sop }
              \new Staff \with { midiInstrument = #"church organ" }
              { $pause $alt }
              \new Staff \with { midiInstrument = #"church organ" }
              { $pause $ten }
              \new Staff \with { midiInstrument = #"church organ" }
              { $pause $bas }
            >>
          >>
                #})))
       $defaultpaper
       #{
         \midi {
           \tempo 4 = $tempo
         }
       #}
       (format #f "~a_~a"
         (or name (string-append myMidi (ly:parser-output-name)))
         tempo)))
    tempolist))

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
   #}
   )

mynotes =
#(define-music-function (m n)
   (ly:duration? ly:duration?)
   #{
     \override Score.RehearsalMark.break-align-symbols = #'(time-signature)
     \once \override Score.RehearsalMark.self-alignment-X = #-1
     \mark \markup \concat { \fontsize #-3.5 \note { $m } #UP " /" \fontsize #-3.5 \note { $n } #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
     #}))



chExceptionMusic = {
  <c e gis>1-\markup "(m)"
  <c f g>1-\markup \super "4"
}

% Convert music to list and prepend to existing exceptions.
chExceptions = #(append
                 (sequential-music-to-chord-exceptions chExceptionMusic #t)
                 ignatzekExceptions)

\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
    \consists Horizontal_bracket_engraver
    \override HorizontalBracket.direction = #UP
    \override HorizontalBracket.bracket-flare = #'(0 . 0)
    \override HorizontalBracketText.text = \markup \italic "Intro"
    \override HorizontalBracket.shorten-pair = #'(.5 . .5)
  }
  \context {
    \Lyrics
    \override VerticalAxisGroup.staff-affinity = #CENTER
    \override LyricText.font-size = #-1.5
    \override StanzaNumber.font-size = #-1.5
  }
  \context {
    \Staff
    printPartCombineTexts = ##f
    beamExceptions = #'()
    \override BreathingSign.text =
    \markup { \musicglyph "scripts.lvarcomma" }
    \override InstrumentName.font-features = #'("smcp")
    \consists #Span_stem_engraver
    %     \consists Measure_spanner_engraver
    %     \override MeasureSpanner.text = \markup \italic "Intro"
  }
  \context {
    \Score
    \override VerticalAxisGroup.remove-first = ##t
    skipBars = ##f
    \override MetronomeMark.font-size = #1
    \override MetronomeMark.font-shape = #'caps
    \override BarLine.thick-thickness = 5
    \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
    chordNameExceptions = #chExceptions
    \override ChordName.self-alignment-X = #CENTER
    \override ChordName.font-name = #"Arial Narrow"
    \override ChordName.layer = #2
    \override ChordName.font-size = #-0.5
    noChordSymbol = ##f
    \consists Horizontal_bracket_engraver
    \override HorizontalBracket.direction = #UP
    \override HorizontalBracket.bracket-flare = #'(0 . 0)
    \override HorizontalBracketText.text = \markup \italic "Intro"
  }
  \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
  }
}

oob = { \once \override Score.BarNumber.stencil = ##f \bar "" }
bnf = \once \override Score.BarNumber.stencil = ##f

gloria = \markup \override #'(baseline-skip . 2) \left-column {
  \line { Gloria: Ehre sei Gott }
  \line {
    Stichwort: \italic "Herr, erbarme dich unser"
  }
  \line { manchmal sagt der P so etwas ähnliches wie \italic "Ehre sei Gott in der Höhe" }
}

sanctus = \markup \override #'(baseline-skip . 2) \left-column {
  \line { Lobpreis Gottes: Heilig, heilig, heilig }
  \line {
    Stichwort: \italic "und singen mit den Engeln das Lob deiner Herrlichkeit"
  }
}

antwortlied = \markup \override #'(baseline-skip . 2) \left-column {
  \line { Antwortlied: nach der ersten Lesung }
  \line {
    Stichwort: \italic "Wort des lebendigen Gottes"
  }
}

gabenbereitung = \markup \override #'(baseline-skip . 2) \left-column {
  \wordwrap { Gabenbereitung (Offertorium): Beginn der Eucharistiefeier, nach den Fürbitten }
  \vspace #.2
  \line {
    Stichwort: \italic "darum bitten wir durch Christus, unsern Herrn"
  }
}

agnus =  \markup \override #'(baseline-skip . 2) \left-column {
  \line { Agnus Dei: Pfarrer zerbricht Hostie in mehrere Teile }
  \line {
    wann: nach dem Friedensgruß
  }
}

danklied =  \markup \override #'(baseline-skip . 2) \left-column {
  \line { Danklied }
  \line {
    wann: nach der Kommunionausteilung
  }
}

auszug =   \markup \override #'(baseline-skip . 2) \left-column {
  \line { Auszug, Verabschiedung }
  \line {
    Stichwort: \italic "gehet hin in Frieden"
  }
}

halleljua =  \markup \override #'(baseline-skip . 3) \left-column {
  \line { 1x leise }
  \line {
    1x leise, Vorbeter singt
  }
  \line {
    1x laut, Gemeinde singt
  }
  \line { Vorbeter betet }
  \line {
    1x laut, Gemeinde singt
  }
}

noambitus = {
  \override AmbitusLine.stencil = ##f
  \override AmbitusNoteHead.stencil = ##f
}

myintro =
#(define-music-function (m) ((string? #f) )
   #{
     \override HorizontalBracketText.text = \markup \italic { "Intro" $m }
   #})

%% Zusatztext und extra-offset sind optional
%% es müssen beide Parameter angegeben werden, wenn einer angegeben wird
mybrack =
#(define-music-function (t n m) ((string? #f) (number? 3.5) ly:music?)
   #{
     {
       \once \override HorizontalBracket.Y-extent = #'(0 . 0)
       \once \override HorizontalBracketText.Y-extent = #'(0 . 0)
       \once \override HorizontalBracket.extra-offset = #`(0 . ,n)
       \once \override HorizontalBracketText.extra-offset = #`(0 . ,n)
       \once \override HorizontalBracketText.text =
       \markup \italic { "Intro" #(or t "") }
       <>\startGroup
       $m
       \stopGroup
     }
   #})

%% ein optionaler Parameter
%% n ... extra-offset, nach oben verschieben
%%       der Standardwert ist für einen ChordNames-context oberhalb berechnet
%% der Zusatztext wird auf \null gesetzt

mybrack-offset =
#(define-music-function (n m) ((number? 3.5) ly:music?)
   #{
     {
       \mybrack "" $n $m
     }
   #})

#(define (lined-nh grob)
   (let* ((default-stil (ly:note-head::print grob))
          (default-stil-x-lngth
           (interval-length (ly:stencil-extent default-stil X)))
          (line-thickness (ly:staff-symbol-line-thickness grob))
          (staff-space (ly:staff-symbol-staff-space grob))
          (font-size
           (assoc-get 'font-size
             (ly:prob-property (ly:grob-property grob 'cause) 'tweaks)))
          (corr
           (if (number? font-size)
               (magstep font-size)
               1))
          (lne
           (make-line-stencil
            (* 1.9 corr line-thickness)
            0
            (/ (* 1.25 corr staff-space) -2)
            0
            (/ (* 1.25 corr staff-space) 2))))
     (ly:stencil-add
      lne
      (ly:stencil-translate-axis
       default-stil (* 0.95 corr line-thickness) X)
      (ly:stencil-translate-axis
       lne (+ (* 1.9 corr line-thickness) default-stil-x-lngth) X))))

\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
    \consists Horizontal_bracket_engraver
    \override HorizontalBracket.direction = #UP
    \override HorizontalBracket.bracket-flare = #'(0 . 0)
    \override HorizontalBracketText.text = \markup \italic "Intro"
    \override HorizontalBracket.shorten-pair = #'(.5 . .5) %% schaut schöner aus über den Akkorden
  }
  \context {
    \Lyrics
    \override VerticalAxisGroup.staff-affinity = #CENTER
  }
  \context {
    \Staff
    printPartCombineTexts = ##f
    beamExceptions = #'()
    \override BreathingSign.text =
    \markup { \musicglyph "scripts.lvarcomma" }
    \override InstrumentName.font-features = #'("smcp")
  }
  \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
  }
}

oob = { \once \override Score.BarNumber.stencil = ##f \bar "" }

gloria = \markup \override #'(baseline-skip . 2) \left-column {
  \line { Gloria: Ehre sei Gott }
  \line {
    Stichwort: \italic "Herr, erbarme dich unser"
  }
  \line { manchmal sagt der P so etwas ähnliches wie \italic "Ehre sei Gott in der Höhe" }
}

sanctus = \markup \override #'(baseline-skip . 2) \left-column {
  \line { Lobpreis Gottes: Heilig, heilig, heilig }
  \line {
    Stichwort: \italic "und singen mit den Engeln das Lob deiner Herrlichkeit"
  }
}

antwortlied = \markup \override #'(baseline-skip . 2) \left-column {
  \line { Antwortlied: nach der ersten Lesung }
  \line {
    Stichwort: \italic "Wort des lebendigen Gottes"
  }
}

gabenbereitung = \markup \override #'(baseline-skip . 2) \left-column {
  \wordwrap { Gabenbereitung (Offertorium): Beginn der Eucharistiefeier, nach den Fürbitten }
  \vspace #.2
  \line {
    Stichwort: \italic "darum bitten wir durch Christus, unsern Herrn"
  }
}

agnus =  \markup \override #'(baseline-skip . 2) \left-column {
  \line { Agnus Dei: Pfarrer zerbricht Hostie in mehrere Teile }
  \line {
    wann: nach dem Friedensgruß
  }
}

danklied =  \markup \override #'(baseline-skip . 2) \left-column {
  \line { Danklied }
  \line {
    wann: nach der Kommunionausteilung
  }
}

auszug =   \markup \override #'(baseline-skip . 2) \left-column {
  \line { Auszug, Verabschiedung }
  \line {
    Stichwort: \italic "gehet hin in Frieden"
  }
}

halleljua =  \markup \override #'(baseline-skip . 3) \left-column {
  \line { 1x leise }
  \line {
    1x leise, Vorbeter singt
  }
  \line {
    1x laut, Gemeinde singt
  }
  \line { Vorbeter betet }
  \line {
    1x laut, Gemeinde singt
  }
}

noambitus = {
  \override AmbitusLine.stencil = ##f
  \override AmbitusNoteHead.stencil = ##f
}
\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
    \consists Horizontal_bracket_engraver
    \override HorizontalBracket.direction = #UP
    \override HorizontalBracket.bracket-flare = #'(0 . 0)
    \override HorizontalBracketText.text = \markup \italic "Intro"
    \override HorizontalBracket.shorten-pair = #'(.5 . .5) %% schaut schöner aus über den Akkorden
  }
  \context {
    \Lyrics
    \override VerticalAxisGroup.staff-affinity = #CENTER
  }
  \context {
    \Staff
    printPartCombineTexts = ##f
    beamExceptions = #'()
    \override BreathingSign.text =
    \markup { \musicglyph "scripts.lvarcomma" }
    \override InstrumentName.font-features = #'("smcp")
  }
  \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
  }
}

oob = { \once \override Score.BarNumber.stencil = ##f \bar "" }

gloria = \markup \override #'(baseline-skip . 2) \left-column {
  \line { Gloria: Ehre sei Gott }
  \line {
    Stichwort: \italic "Herr, erbarme dich unser"
  }
  \line { manchmal sagt der P so etwas ähnliches wie \italic "Ehre sei Gott in der Höhe" }
}

sanctus = \markup \override #'(baseline-skip . 2) \left-column {
  \line { Lobpreis Gottes: Heilig, heilig, heilig }
  \line {
    Stichwort: \italic "und singen mit den Engeln das Lob deiner Herrlichkeit"
  }
}

antwortlied = \markup \override #'(baseline-skip . 2) \left-column {
  \line { Antwortlied: nach der ersten Lesung }
  \line {
    Stichwort: \italic "Wort des lebendigen Gottes"
  }
}

gabenbereitung = \markup \override #'(baseline-skip . 2) \left-column {
  \wordwrap { Gabenbereitung (Offertorium): Beginn der Eucharistiefeier, nach den Fürbitten }
  \vspace #.2
  \line {
    Stichwort: \italic "darum bitten wir durch Christus, unsern Herrn"
  }
}

agnus =  \markup \override #'(baseline-skip . 2) \left-column {
  \line { Agnus Dei: Pfarrer zerbricht Hostie in mehrere Teile }
  \line {
    wann: nach dem Friedensgruß
  }
}

danklied =  \markup \override #'(baseline-skip . 2) \left-column {
  \line { Danklied }
  \line {
    wann: nach der Kommunionausteilung
  }
}

auszug =   \markup \override #'(baseline-skip . 2) \left-column {
  \line { Auszug, Verabschiedung }
  \line {
    Stichwort: \italic "gehet hin in Frieden"
  }
}

halleljua =  \markup \override #'(baseline-skip . 3) \left-column {
  \line { 1x leise }
  \line {
    1x leise, Vorbeter singt
  }
  \line {
    1x laut, Gemeinde singt
  }
  \line { Vorbeter betet }
  \line {
    1x laut, Gemeinde singt
  }
}

noambitus = {
  \override AmbitusLine.stencil = ##f
  \override AmbitusNoteHead.stencil = ##f
}