Ave Verum Corpus

Zur Navigation springen Zur Suche springen
sop = \relative c' {
  \time 4/4
  \key d \major
  \voiceOne
  d4 a d e
  fis d fis g
  a2 d4 fis,
  a gis g2
  g4 h a g
  g fis fis2
  e2. e4
  fis fis g g
  g2 fis4 fis
  e2. cis'4\rest
  e,2. a4 a gis gis2
  e4 gis2 h4
  \override Slur.minimum-length = #3
  h ( a ) a a(
  d1) ~ d4 cis h a
  a2( gis4) gis
  a \breathe a( e'2 ~
  e4) d( e fis) a,2( \acciaccatura { cis8 } h4. a8
  a2.) r4
  a2. a4
  a b b2 ~ b4 d c b
  b a \oneVoice < a f >2
  < g d >2. q4
  < g cis,! >4( < b f > < a e >) < g cis, >
  \voiceOne
  < g e >2 f8( e f4)
  e cis d e
  fis2. fis4
  fis( e d g) g2. g4
  g( fis e a)
  a2. a4 \oneVoice < a fis >4( g) q( < h e, >)
  \voiceOne
  fis2 e4. fis8
  g2 g\(
  d'2. d4 ~ d d dis4 dis
  e4 h cis! d!
  cis h8 a d4\) g,\(
  fis2 e4. e8
  d4\) fis < a fis>2 ~
  < a fis>4 d, < g e >2

  fis2 e
  d1\fermata
  \bar "|."
}

alt = \relative c' {
  s2.
  \voiceTwo
  cis4
  d a d e
  fis2 a4 d,
  e2 ~ e
  e4 g fis e
  e d d2
  cis2. cis4
  d d e e
  e2 d4 d
  cis2. s4
  cis2. e4 ~ e1
  e2. gis4
  gis a fis r
  r2 gis
  a
  fis
  e2. e4 e4 s s e
  a1 e ~ e2. s4
  e2. e4
  e1 ~ e
  e4 f s2
  s1 s
  cis2 d8 cis d4
  cis a h cis
  d2. d4
  d cis d e
  e2. e4 e d e fis
  fis2. fis4 s1
  d2 cis
  d s r4 g fis2
  g fis e1 ~
  e2 d
  ~ d cis
  s4 d s2
  d4 h d h
  e4 d2 cis4
}

ten = \relative c' {
  \clef bass
  \key d \major
  \override Tie.minimum-length = #3
  \voiceOne
  < a fis >2. a4 ~
  a fis a2
  a1 h
  a ~ a
  a1
  a1 ~ a
  a2. e4\rest
  a2. cis4
  cis d ~ d2
  gis,4 h2 d4
  d cis ~ cis r
  \oneVoice
  r2 h,2 cis d
  \voiceOne
  h'1 cis4 r r a
  cis d cis his
  cis2 d
  cis2. r4
  cis2. cis4 ~
  cis2. c4
  c b a g ~
  g a a2
  h1 s s s s
  h2. h4 h a g cis
  cis2. cis4 cis( h a d)
  \oneVoice
  < d h >2 a4( gis)
  \voiceOne
  a1 g2 r
  r c h c
  h4 d cis h
  a2 a4 g4
  a2 g s2
  \oneVoice r4 fis,
  h2. g4 
  \voiceOne
  a'2 g
  < d fis a >1\fermata
}

bas = \relative c {
  \voiceTwo
  d2. s4
  d1 d ~ d cis d
  a2 a
  d2 cis d2. d4 a2. s4
  a2. a'4 a h ~ h2
  e,1
  eis4 fis ~ fis s
  s1 s e
  a4 s s cis,
  fis2 e4 d
  e2 gis
  a2. s4
  a2. a4
  a4 g2.
  c,1 ~ c4 f ~ f2 f1
  \oneVoice
  e4 d cis a
  b2 a4 gis
  < a e' > a2 g'8 e
  d2. r4
  \voiceTwo
  g2. g4 g fis e a
  a2. a4 a g fis h
  s1
  a2 a, h s
  s a' b a
  gis1 g2 fis4 h,
  a1
  < d fis a>2 s
  s1 a
}

Struktur =
{
  \override Score.NonMusicalPaperColumn.page-break-permission = ##f
  \override Score.SpacingSpanner.common-shortest-duration = #(ly:make-moment 1/8)
  \override PianoStaff.VerticalAxisGroup.staff-staff-spacing.padding = #4
  \override PianoStaff.VerticalAxisGroup.staff-staff-spacing.basic-distance = #8
  \mark \markup \italic Andante
  s1 * 21 \pageBreak
  s1 * 23
  \override TextSpanner.dash-period = #1
  \override TextSpanner.dash-fraction = #0.5
  \override TextSpanner.bound-details.left.text = "rit."
  \override TextSpanner.bound-details.right.text =
  \markup { \draw-line #'(0 . -1) }
  s1\startTextSpan
  s\stopTextSpan
}

kopf=\header {
  title = "Ave Verum Corpus"
  composer = "M: W. A. Mozart (1756-91)"
  key="D"
  opus ="KV 618"
}

mypaper=
\paper {
  top-margin = 25\mm
  ragged-right = ##f
  ragged-last = ##f
  ragged-bottom = ##f
  ragged-last-bottom = ##f
  bottom-margin = 25\mm
  indent = #0
  line-width = 170\mm
  %markup-system-spacing.padding = #6
  system-system-spacing.minimum-distance = #1
  system-system-spacing.padding = #5
}

\bookpart {
  \mypaper
  \kopf
  \score {
    \orgel \sop \alt \ten \bas \Struktur b,
  }
}
sop = \relative c' {
  \time 4/4
  \key d \major
  \voiceOne
  d4 a d e
  fis d fis g
  a2 d4 fis,
  a gis g2
  g4 h a g
  g fis fis2
  e2. e4
  fis fis g g
  g2 fis4 fis
  e2. cis'4\rest
  e,2. a4 a gis gis2
  e4 gis2 h4
  \override Slur.minimum-length = #3
  h ( a ) a a(
  d1) ~ d4 cis h a
  a2( gis4) gis
  a \breathe a( e'2 ~
  e4) d( e fis) a,2( \acciaccatura { cis8 } h4. a8
  a2.) r4
  a2. a4
  a b b2 ~ b4 d c b
  b a \oneVoice < a f >2
  < g d >2. q4
  < g cis,! >4( < b f > < a e >) < g cis, >
  \voiceOne
  < g e >2 f8( e f4)
  e cis d e
  fis2. fis4
  fis( e d g) g2. g4
  g( fis e a)
  a2. a4 \oneVoice < a fis >4( g) q( < h e, >)
  \voiceOne
  fis2 e4. fis8
  g2 g\(
  d'2. d4 ~ d d dis4 dis
  e4 h cis! d!
  cis h8 a d4\) g,\(
  fis2 e4. e8
  d4\) fis < a fis>2 ~
  < a fis>4 d, < g e >2

  fis2 e
  d1\fermata
  \bar "|."
}

alt = \relative c' {
  s2.
  \voiceTwo
  cis4
  d a d e
  fis2 a4 d,
  e2 ~ e
  e4 g fis e
  e d d2
  cis2. cis4
  d d e e
  e2 d4 d
  cis2. s4
  cis2. e4 ~ e1
  e2. gis4
  gis a fis r
  r2 gis
  a
  fis
  e2. e4 e4 s s e
  a1 e ~ e2. s4
  e2. e4
  e1 ~ e
  e4 f s2
  s1 s
  cis2 d8 cis d4
  cis a h cis
  d2. d4
  d cis d e
  e2. e4 e d e fis
  fis2. fis4 s1
  d2 cis
  d s r4 g fis2
  g fis e1 ~
  e2 d
  ~ d cis
  s4 d s2
  d4 h d h
  e4 d2 cis4
}

ten = \relative c' {
  \clef bass
  \key d \major
  \override Tie.minimum-length = #3
  \voiceOne
  < a fis >2. a4 ~
  a fis a2
  a1 h
  a ~ a
  a1
  a1 ~ a
  a2. e4\rest
  a2. cis4
  cis d ~ d2
  gis,4 h2 d4
  d cis ~ cis r
  \oneVoice
  r2 h,2 cis d
  \voiceOne
  h'1 cis4 r r a
  cis d cis his
  cis2 d
  cis2. r4
  cis2. cis4 ~
  cis2. c4
  c b a g ~
  g a a2
  h1 s s s s
  h2. h4 h a g cis
  cis2. cis4 cis( h a d)
  \oneVoice
  < d h >2 a4( gis)
  \voiceOne
  a1 g2 r
  r c h c
  h4 d cis h
  a2 a4 g4
  a2 g s2
  \oneVoice r4 fis,
  h2. g4 
  \voiceOne
  a'2 g
  < d fis a >1\fermata
}

bas = \relative c {
  \voiceTwo
  d2. s4
  d1 d ~ d cis d
  a2 a
  d2 cis d2. d4 a2. s4
  a2. a'4 a h ~ h2
  e,1
  eis4 fis ~ fis s
  s1 s e
  a4 s s cis,
  fis2 e4 d
  e2 gis
  a2. s4
  a2. a4
  a4 g2.
  c,1 ~ c4 f ~ f2 f1
  \oneVoice
  e4 d cis a
  b2 a4 gis
  < a e' > a2 g'8 e
  d2. r4
  \voiceTwo
  g2. g4 g fis e a
  a2. a4 a g fis h
  s1
  a2 a, h s
  s a' b a
  gis1 g2 fis4 h,
  a1
  < d fis a>2 s
  s1 a
}

Struktur =
{
  \override Score.NonMusicalPaperColumn.page-break-permission = ##f
  \override Score.SpacingSpanner.common-shortest-duration = #(ly:make-moment 1/8)
  \override PianoStaff.VerticalAxisGroup.staff-staff-spacing.padding = #4
  \override PianoStaff.VerticalAxisGroup.staff-staff-spacing.basic-distance = #8
  \mark \markup \italic Andante
  s1 * 21 \pageBreak
  s1 * 23
  \override TextSpanner.dash-period = #1
  \override TextSpanner.dash-fraction = #0.5
  \override TextSpanner.bound-details.left.text = "rit."
  \override TextSpanner.bound-details.right.text =
  \markup { \draw-line #'(0 . -1) }
  s1\startTextSpan
  s\stopTextSpan
}

kopf=\header {
  title = "Ave Verum Corpus"
  composer = "M: W. A. Mozart (1756-91)"
  key="D"
  opus ="KV 618"
}

mypaper=
\paper {
  top-margin = 25\mm
  ragged-right = ##f
  ragged-last = ##f
  ragged-bottom = ##f
  ragged-last-bottom = ##f
  bottom-margin = 25\mm
  indent = #0
  line-width = 170\mm
  %markup-system-spacing.padding = #6
  system-system-spacing.minimum-distance = #1
  system-system-spacing.padding = #5
}

\bookpart {
  \mypaper
  \kopf
  \score {
    \orgel \sop \alt \ten \bas \Struktur b,
  }
}

#(set-global-staff-size 24)
#(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)))

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

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

dynstr =
#(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))
       #}))

orgel =
%Notensatz 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="leadsheet"
       <<
         \new Staff="up"
         <<
           \new Voice="Alt" { \transpose c $p $sop }
           \new Voice { \transpose c $p $alt }
         >>
         \new Staff="down"
         <<
           \new Voice { \transpose c $p $ten }
           \new Voice { \transpose c $p $bas }
           \new Voice $stru
         >>
       >>
     >>
   #}
   )

\include "articulate.ly"


#(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 =
  \markup {
    \override #'(baseline-skip . 2)
    \column {
      \fill-line \override #'(baseline-skip . 3) {
        \huge \larger \larger \bold
        \center-column {
          \fromproperty #'header:title
         }
      }
      \fill-line \override #'(baseline-skip . 3) {
        \fontsize #-2 \bold
        \center-column {
         \vspace #.3
          \fromproperty #'header:subtitle
          " "
        }
      }
      \fontsize #-1.5 {
        \fill-line {
          "Notensatz: lilypond.miraheze.org" \fromproperty #'header:composer
        }
      }
      \fontsize #-1.5 \fill-line {
        ""
        \tonart-fromproperty "Originaltonart: " #'header:key #'header:dur
      }
    }
  }
}

\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
  }
  \context {
    \Lyrics
    \override VerticalAxisGroup.staff-affinity = #CENTER
    \override LyricText.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
  }
  \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
    \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
  }
}