Workshop Pop Akkordeon 2020

Zur Navigation springen Zur Suche springen


Lilypond-Code

\version "2.19.82"
\language "deutsch"
#(use-modules (ice-9 regex))
\include "Exceptions.ily"

%% create diatonic chords from a scale
%% enter the steps of the scale as lily music
%% and chose the number of notes the chords should have

%% convert pitchlist to a music chord
#(define (pitches->chord plist)
   (make-music 'EventChord 'elements
     (if (list? plist)
         (map (lambda (p)
                (make-music
                 'NoteEvent 'duration (ly:make-duration 0)
                 'pitch p))
           plist)
         (make-music
          'NoteEvent 'duration (ly:make-duration 0)
          'pitch plist)
         )))

%% create all n-th chords from scale
%% actually we staple every other pitch from the-scale
%% until we reach n

%% create chords with arbitraty intervals from the scale
%% input: scale
%% list: the distances of the notes, 3=terz, 4=quart ...

#(define (stacked-intervals the-scale list-or-number-or-pair)
   ;; the-scale: music from which the pitchlist is constructed
   ;; usually a scale, but could be any music
   ;; duplicate pitches are removed and sorting according to pitch height is done
   ;; list-or-number-or-pair: tells the programm which intervals to produce
   ;; list: a list of chords, 3=third, 4=forth etc. '(2 4) creates a quart-sext chord
   ;; pair: '(a . b)  a: how many notes the chord contains, b: the interval, 3=third, 4=forth
   ;; number: terzes are stapled, 3=triad, 4=tetrads, 5=pentachord etc
   ;; actually the program does not much counting
   ;; a list of intervals is created by picking notes in the order they appear
   ;; in the scale leaving gaps defined by the list
   (let* ((scpi (music-pitches the-scale))
          (pili (sort
                 (delete-duplicates scpi) ly:pitch<?))
          (m (length pili))
          (elist (cond
                  ((list? list-or-number-or-pair)
                   ;; we need to add an element to the list
                   ;; otherwise the last element of the list would not appear
                   ;; in the result
                   (append list-or-number-or-pair '(1)))
                  ((pair? list-or-number-or-pair)
                   ;; car: number of notes
                   ;; cdr: distance, 3=third, 4=forth etc.
                   (make-list  (car list-or-number-or-pair) (cdr list-or-number-or-pair)))
                  ((number? list-or-number-or-pair)
                   ;; standard definition: chord consists of thirds
                   (make-list list-or-number-or-pair 3))))
          (n (length elist)))
     (map
      (lambda (w)
        (let ((u 0))
          (map
           (lambda (x)
             (let* ((y (modulo (+ u w) m))
                    (q (quotient (+ u w) m))
                    (z (list-ref pili y))
                    (a (ly:pitch-alteration z))
                    (o (ly:pitch-octave z))
                    (n (ly:pitch-notename z))
                    (p (ly:make-pitch (+ o q) n a)))
               (set! u (+ u (list-ref elist x) -1))
               p))
           (iota n))))
      (iota m))))

CreateIntervals=
#(define-music-function (the-scale pair-list-number)(ly:music? scheme?)
   ;; creates the pure music without chordnames and other staff
   (make-sequential-music
    (map (lambda(x) (pitches->chord x))
      (stacked-intervals the-scale pair-list-number))))

Stufen = {
  s1-"I" s1-"ii" s1-"iii" s-"IV" s-"V" s-"vi" s-"vii"
}

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

shiftMus =
#(define-music-function (mus zahl)
   (ly:music? integer?)
   (let* ((es (ly:music-property mus 'elements '()))
          (lg (length es)))
     (if (equal? lg 0) (begin
                        (ly:warning "Das war doch keine Sequentielle Musik als Argument der Funktion shiftMus")
                        mus)
         (let ((s (modulo zahl lg)))
           (if (equal? s 0)
               mus
               (begin (ly:music-set-property! mus 'elements
                        (append (list-tail es s) (list-head es s)))
                 mus))))))

\layout {

  \context {
    \Staff
    \remove "Time_signature_engraver"
  }

  \context {
    \PianoStaff
    \override SystemStartBrace.collapse-height = #1
  }

  \context {
    \Score
    \override BarNumber.stencil = ##f
    \override KeyCancellation.break-visibility = #all-invisible
    \override StaffGrouper.staffgroup-staff-spacing.basic-distance = #15
    \override StaffGrouper.staffgroup-staff-spacing.padding = #4
    \override VerticalAxisGroup.nonstaff-unrelatedstaff-spacing.padding = #1
    \override VerticalAxisGroup.nonstaff-unrelatedstaff-spacing.minimum-distance = #3
    %\remove "Default_bar_line_engraver"
    automaticBars =##f
    \override SpacingSpanner.strict-note-spacing = ##t
  }

  \context {
    \ChordNames
    \alias ChordNames
    \override ChordName.self-alignment-X = #LEFT
    chordNameLowercaseMinor = ##f
    \override Rest.stencil = ##f
    chordNoteNamer = #(chord-name->german-markup #f)
    chordChanges = ##f
    chordNameLowercaseMinor = ##f
    chordNameExceptions = #chExceptions
    chordRootNamer = #germanChords
    majorSevenSymbol = \markup { maj7 }
    \override ChordName.font-name = #"Arial Narrow"
    \override ChordName.layer = #2
    \override ChordName.extra-spacing-width = #'(+inf.0 . -inf.0)
    \override ChordName.font-size = #1
    noChordSymbol = ##f
    \override VerticalAxisGroup.staff-affinity = #UP
    \override VerticalAxisGroup.nonstaff-relatedstaff-spacing.padding = #1
  }

  \context {
    \Dynamics
    \override VerticalAxisGroup.staff-affinity = #UP
    \override VerticalAxisGroup.nonstaff-relatedstaff-spacing.padding = #1
  }
}

#(define (note-name->string pitch)
   (let* ((a (ly:pitch-alteration pitch))
          (n (ly:pitch-notename pitch)))
     (make-concat-markup
      (list
       (make-simple-markup
        (vector-ref #("C" "D" "E" "F" "G" "A" "B") n))
       (if (= a 0)
           (make-line-markup (list empty-markup))
           (make-line-markup
            (list
             (alteration->text-accidental-markup a)
             (make-hspace-markup 0.1))))))))

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

%% Notenname als Markup
#(define (note-name->my-markup pitch)
   (let* ((name (ly:pitch-notename pitch))
          (alt-semitones (pitch-alteration-semitones pitch))
          (n-a (if (member (cons name alt-semitones) `((6 . -1) (6 . -2)))
                   (cons 7 (+ 1 alt-semitones))
                   (cons name alt-semitones))))
     (make-line-markup
      ;(make-simple-markup
      (list
       (string-append
        (list-ref '("C" "D" "E" "F" "G" "A" "H" "B") (car n-a))
        (if (or (equal? (car n-a) 2) (equal? (car n-a) 5))
            (list-ref '( "ses" "s" "" "is" "isis") (+ 2 (cdr n-a)))
            (list-ref '("eses" "es" "" "is" "isis") (+ 2 (cdr n-a)))))))))

MollStufen = {
  s1\dynamictext "i"  s\dynamictext "ii"
  s\dynamictext "iii"  s\dynamictext "iv"
  s\dynamictext "V"  s\dynamictext "VI"
  s\dynamictext "vii"
}

DurStufen = {
  s1\dynamictext "I"  s\dynamictext "ii"
  s\dynamictext "iii"  s\dynamictext "IV"
  s\dynamictext "V"  s\dynamictext "vi"
  s\dynamictext "vii"
}

Stufen = { s1-"I" s1-"ii" s1-"iii" s-"IV" s-"V" s-"vi" s-"vii" }

VierKlang =
#(define-music-function (leiter l1 l2 l3 p)
   (ly:music? ly:music? ly:music? ly:music? ly:pitch?)
   #{
     {
       <<
         \new Staff
         \with {
           instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "Tonleiter "
         }
         {
           <<
             \new Voice \transpose c $p { \key c \major $leiter }
             \context Voice \Stufen
           >>
         }
         \new ChordNames \transpose c $p \CreateIntervals $leiter #4
         \new PianoStaff
         \with {
           instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "Grundstellung "
         }
         {
           <<
             \new Staff \new Voice \transpose c $p { \key c \major \CreateIntervals $leiter #4 }
             \context Voice \Stufen
             \new ChordNames \transpose c $p \CreateIntervals $leiter #4
             \new Staff \new Voice { \clef bass \key $p \major \transpose c'' $p \CreateIntervals $leiter #4 }
           >>
         }
         \new PianoStaff
         \with {
           instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "1. Umkehrung "
         }
         {
           <<
             \new Staff \new Voice \transpose c $p { \key c \major \CreateIntervals $l1 #'( 3 3 2) }
             \context Voice \Stufen
             \new ChordNames \transpose c $p \CreateIntervals $leiter #4
             \new Staff \new Voice { \clef bass \transpose c'' $p { \key c \major\CreateIntervals $l1 #'( 3 3 2) } }
           >>
         }
         \new PianoStaff
         \with {
           instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "2. Umkehrung "
         }
         {
           <<
             \new Staff \new Voice \transpose c' $p { \key c \major \CreateIntervals $l2 #'( 3 2 3) }
             \context Voice \Stufen
             \new ChordNames \transpose c $p \CreateIntervals $leiter #4
             \new Staff \new Voice { \clef bass \transpose c'' $p { \key c \major\CreateIntervals $l2 #'( 3 2 3) } }
           >>
         }
         \new PianoStaff
         \with {
           instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "3. Umkehrung "
         }
         <<
           \new Staff \new Voice \transpose c' $p { \key c \major \CreateIntervals $l3 #'( 2 3 3) }
           \context Voice \Stufen
           \new ChordNames \transpose c $p \CreateIntervals $leiter #4
           \new Staff \new Voice { \clef bass \transpose c'' $p { \key c \major \CreateIntervals $l3 #'( 2 3 3) } }
         >>
       >>
     }
   #}
   )

Vierklange =
#(define-void-function (leiter l1 l2 l3 p)
   (ly:music? ly:music? ly:music? ly:music? ly:pitch?)
   (add-score
    (list #{  \markup \fill-line \override #'(font-features . ("smcp")) \override #'(box-padding . 1)
              \override #'(thickness . 2) \override #'(font-size . 4)
              { \null \rounded-box \concat {"Leitereigene Vierklänge " #(note-name->my-markup p) "-Dur" } \null }
      #}))
   (add-score
    (scorify-music #{ \VierKlang $leiter $l1 $l2 $l3 $p #})))

VierKlangh =
#(define-music-function (leiter l1 l2 l3 p)
   (ly:music? ly:music? ly:music? ly:music? ly:pitch?)
   #{
     {
       <<
         \new Staff
         \with {
           instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "Tonleiter "
         }
         {
           <<
             \new Voice \transpose c $p { \key c \major $leiter }
             \context Voice \Stufen
           >>
         }
         \new ChordNames \transpose c $p \CreateIntervals $leiter #4
         \new PianoStaff
         \with {
           instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "Grundstellung "
         }
         {
           <<
             \new Staff \new Voice \transpose c' $p { \key c \major \CreateIntervals $leiter #4 }
             \context Voice \Stufen
             \new ChordNames \transpose c $p \CreateIntervals $leiter #4
             \new Staff \new Voice { \clef bass \transpose c'' $p { \key c \major \CreateIntervals $leiter #4 } }
           >>
         }
         \new PianoStaff
         \with {
           instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "1. Umkehrung "
         }
         {
           <<
             \new Staff \new Voice \transpose c' $p { \key c \major \CreateIntervals $l1 #'( 3 3 2) }
             \context Voice \Stufen
             \new ChordNames \transpose c $p \CreateIntervals $leiter #4
             \new Staff \new Voice { \clef bass \transpose c''' $p { \key c \major \CreateIntervals $l1 #'( 3 3 2) } }
           >>
         }
         \new PianoStaff
         \with {
           instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "2. Umkehrung "
         }
         {
           <<
             \new Staff \new Voice \transpose c' $p { \key c \major \CreateIntervals $l2 #'( 3 2 3) }
             \context Voice \Stufen
             \new ChordNames \transpose c $p \CreateIntervals $leiter #4
             \new Staff \new Voice { \clef bass \transpose c''' $p { \key c \major \CreateIntervals $l2 #'( 3 2 3) } }
           >>
         }
         \new PianoStaff
         \with {
           instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "3. Umkehrung "
         }
         <<
           \new Staff \new Voice \transpose c'' $p { \key c \major \CreateIntervals $l3 #'( 2 3 3) }
           \context Voice \Stufen
           \new ChordNames \transpose c $p \CreateIntervals $leiter #4
           \new Staff \new Voice { \clef bass \transpose c''' $p { \key c \major \CreateIntervals $l3 #'( 2 3 3) } }
         >>
       >>
     }
   #}
   )

Vierklangeh =
#(define-void-function (leiter l1 l2 l3 p)
   (ly:music? ly:music? ly:music? ly:music? ly:pitch?)
   (add-score
    (list #{  \markup \fill-line \override #'(font-features . ("smcp")) \override #'(box-padding . 1)
              \override #'(thickness . 2) \override #'(font-size . 4)
              { \null \rounded-box \concat {"Leitereigene Vierklänge " #(note-name->my-markup p) "-Dur" } \null }
      #}))
   (add-score
    (scorify-music #{ \VierKlangh $leiter $l1 $l2 $l3 $p #})))

VierKlangg =
#(define-music-function (leiter l1 l2 l3 p)
   (ly:music? ly:music? ly:music? ly:music? ly:pitch?)
   #{
     {
       <<
         \new Staff
         \with {
           instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "Tonleiter "
         }
         {
           <<
             \new Voice \transpose c $p { \key c \major $leiter }
             \context Voice \Stufen
           >>
         }
         \new ChordNames
         {
           \transpose c $p \CreateIntervals $leiter #4
         }
         \new PianoStaff
         \with {
           instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "Grundstellung "
         }
         {
           <<
             \new Staff \new Voice \transpose c $p { \key c \major \CreateIntervals $leiter #4 }
             \context Voice
             {
               \Stufen
             }
             \new Staff \new Voice { \clef bass \transpose c'' $p { \key c \major \CreateIntervals $leiter #4 } }
           >>
         }
         \new PianoStaff
         \with {
           instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "1. Umkehrung "
         }
         {
           <<
             \new Staff \new Voice \transpose c' $p { \key c \major \CreateIntervals $l1 #'( 3 3 2) }
             \context Voice
             {
               \Stufen
             }
             \new Staff \new Voice { \clef bass \transpose c'' $p { \key c \major \CreateIntervals $l1 #'( 3 3 2) } }
           >>
         }
         \new PianoStaff
         \with {
           instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "2. Umkehrung "
         }
         {
           <<
             \new Staff \new Voice \transpose c' $p { \key c \major \CreateIntervals $l2 #'( 3 2 3) }
             \context Voice
             {
               \Stufen
             }
             \new Staff \new Voice { \clef bass \transpose c''' $p { \key c \major \CreateIntervals $l2 #'( 3 2 3) } }
           >>
         }
         \new PianoStaff
         \with {
           instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "3. Umkehrung "
         }
         <<
           \new Staff \new Voice \transpose c' $p { \key c \major \CreateIntervals $l3 #'( 2 3 3) }
           \context Voice \Stufen
           \new Staff \new Voice { \clef bass \transpose c''' $p { \key c \major \CreateIntervals $l3 #'( 2 3 3) } }
         >>
       >>
     }
   #}
   )

Vierklangeg =
#(define-void-function (leiter l1 l2 l3 p)
   (ly:music? ly:music? ly:music? ly:music? ly:pitch?)
   (add-score
    (list #{  \markup \fill-line \override #'(font-features . ("smcp")) \override #'(box-padding . 1)
              \override #'(thickness . 2) \override #'(font-size . 4)
              { \null \rounded-box \concat {"Leitereigene Vierklänge " #(note-name->my-markup p) "-Dur" } \null }
      #}))
   (add-score
    (scorify-music #{ \VierKlangg $leiter $l1 $l2 $l3 $p #}))
   )

DreiKlang =
#(define-music-function (leiter leiter1 leiter2 p)
   (ly:music? ly:music? ly:music? ly:pitch?)
   #{
     <<
       \new PianoStaff
       \with {
         instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "Tonleiter "
       }
       \new Voice \transpose c $p { \key c \major $leiter }
       \new Dynamics \DurStufen
       \new PianoStaff
       \with {
         instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "Grundstellung "
       }
       <<
         \new Staff \new Voice \transpose c $p { \key c \major \CreateIntervals $leiter #3 }
         \new ChordNames \transpose c $p \CreateIntervals $leiter #3
         \new Staff \new Voice { \clef bass \transpose c' $p { \key c \major \CreateIntervals $leiter #3 } }
         \new Dynamics \DurStufen
       >>
       \new PianoStaff
       \with {
         instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "1. Umkehrung "
       }
       <<
         \new Staff \transpose c $p { \key c \major \CreateIntervals $leiter1 #'(3 4) }
         \new ChordNames \transpose c $p \CreateIntervals $leiter #3
         \new Staff \new Voice { \clef bass \transpose c'' $p { \key c \major \CreateIntervals $leiter1 #'(3 4) } }
         \new Dynamics \DurStufen
       >>
       \new PianoStaff
       \with {
         instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "2. Umkehrung "
       }
       <<
         \new Staff \transpose c $p { \key c \major \CreateIntervals $leiter2 #'(4 3) }
         \new ChordNames \transpose c $p \CreateIntervals $leiter #3
         \new Staff \new Voice { \clef bass \transpose c'' $p { \key c \major \CreateIntervals $leiter2 #'(4 3) } }
         \new Dynamics \DurStufen
       >>
     >>
   #}
   )

Dreiklange =
#(define-void-function (leiter leiter1 leiter2 p) (ly:music? ly:music? ly:music? ly:pitch?)
   (add-score
    (list #{  \markup \fill-line \override #'(font-features . ("smcp")) \override #'(box-padding . 1)
              \override #'(thickness . 2) \override #'(font-size . 4)
              { \null \rounded-box \concat { "Leitereigene Dreiklänge " #(note-name->my-markup p) "-Dur" } \null }
      #}))
   (add-score
    (scorify-music #{ \DreiKlang $leiter $leiter1 $leiter2 $p #}))
   )

DreiKlanga =
#(define-music-function (leiter leiter1 leiter2 p)
   (ly:music? ly:music? ly:music? ly:pitch?)
   #{
     <<
       \new PianoStaff
       \with {
         instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "Tonleiter "
       }
       \new Voice { \key $p \major \transpose c $p $leiter }
       \new Dynamics \DurStufen
       \new PianoStaff
       \with {
         instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "Grundstellung "
       }
       <<
         \new Staff  \new Voice \transpose c' $p { \key c \major \CreateIntervals $leiter #3 }
         \new ChordNames \transpose c $p \CreateIntervals $leiter #3
         \new Staff \new Voice { \clef bass \transpose c'' $p { \key c \major \CreateIntervals $leiter #3 } }
         \new Dynamics \DurStufen
       >>
       \new PianoStaff
       \with {
         instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "1. Umkehrung "
       }
       <<
         \new Staff \transpose c' $p { \key c \major \CreateIntervals $leiter1 #'(3 4) }
         \new ChordNames \transpose c $p \CreateIntervals $leiter #3
         \new Staff \new Voice { \clef bass \transpose c'' $p { \key c \major \CreateIntervals $leiter1 #'(3 4) } }
         \new Dynamics \DurStufen
       >>
       \new PianoStaff
       \with {
         instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "2. Umkehrung "
       }
       <<
         \new Staff \transpose c' $p { \key c \major \CreateIntervals $leiter2 #'(4 3) }
         \new ChordNames \transpose c $p \CreateIntervals $leiter #3
         \new Staff \new Voice { \clef bass \transpose c''' $p { \key c \major \CreateIntervals $leiter2 #'(4 3) } }
         \new Dynamics \DurStufen
       >>
     >>
   #}
   )

Dreiklangea =
#(define-void-function (leiter leiter1 leiter2 p) (ly:music? ly:music? ly:music? ly:pitch?)
   (add-score
    (list #{  \markup \fill-line \override #'(font-features . ("smcp")) \override #'(box-padding . 1)
              \override #'(thickness . 2) \override #'(font-size . 4)
              { \null \rounded-box \concat { "Leitereigene Dreiklänge " #(note-name->my-markup p) "-Dur" } \null }
      #}))
   (add-score
    (scorify-music #{ \DreiKlanga $leiter $leiter1 $leiter2 $p #}))
   )

DreiKlange =
#(define-music-function (leiter leiter1 leiter2 p)
   (ly:music? ly:music? ly:music? ly:pitch?)
   #{
     <<
       \new PianoStaff
       \with {
         instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "Tonleiter "
       }
       \new Voice { \key $p \major \transpose c $p $leiter }
       \new Dynamics \DurStufen
       \new PianoStaff
       \with {
         instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "Grundstellung "
       }
       <<
         \new Staff \new Voice \transpose c $p { \key c \major \CreateIntervals $leiter #3 }
         \new ChordNames \transpose c $p \CreateIntervals $leiter #3
         \new Staff \new Voice { \clef bass \transpose c'' $p { \key c \major \CreateIntervals $leiter #3 } }
         \new Dynamics \DurStufen
       >>
       \new PianoStaff
       \with {
         instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "1. Umkehrung "
       }
       <<
         \new Staff \transpose c' $p { \key c \major \CreateIntervals $leiter1 #'(3 4) }
         \new ChordNames \transpose c $p \CreateIntervals $leiter #3
         \new Staff \new Voice { \clef bass \transpose c'' $p { \key c \major \CreateIntervals $leiter1 #'(3 4) } }
         \new Dynamics \DurStufen
       >>
       \new PianoStaff
       \with {
         instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "2. Umkehrung "
       }
       <<
         \new Staff \transpose c' $p { \key c \major \CreateIntervals $leiter2 #'(4 3) }
         \new ChordNames \transpose c $p \CreateIntervals $leiter #3
         \new Staff \new Voice { \clef bass \transpose c''' $p { \key c \major \CreateIntervals $leiter2 #'(4 3) } }
         \new Dynamics \DurStufen
       >>
     >>
   #}
   )

Dreiklangee =
#(define-void-function (leiter leiter1 leiter2 p) (ly:music? ly:music? ly:music? ly:pitch?)
   (add-score
    (list #{  \markup \fill-line \override #'(font-features . ("smcp")) \override #'(box-padding . 1)
              \override #'(thickness . 2) \override #'(font-size . 4)
              { \null \rounded-box \concat { "Leitereigene Dreiklänge " #(note-name->my-markup p) "-Dur" } \null }
      #}))
   (add-score
    (scorify-music #{ \DreiKlange $leiter $leiter1 $leiter2 $p #}))
   )

DreiKlangx =
#(define-music-function (leiter leiter1 leiter2 p)
   (ly:music? ly:music? ly:music? ly:pitch?)
   #{
     <<
       \new PianoStaff
       \with {
         instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "Tonleiter "
       }
       \new Voice { \key $p \major \transpose c $p $leiter }
       \new Dynamics \DurStufen
       \new PianoStaff
       \with {
         instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "Grundstellung "
       }
       <<
         \new Staff  \new Voice \transpose c $p { \key c \major \CreateIntervals $leiter #3 }
         \new ChordNames \transpose c $p \CreateIntervals $leiter #3
         \new Staff \new Voice { \clef bass \transpose c'' $p { \key c \major \CreateIntervals $leiter #3 } }
         \new Dynamics \DurStufen
       >>
       \new PianoStaff
       \with {
         instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "1. Umkehrung "
       }
       <<
         \new Staff \transpose c' $p { \key c \major \CreateIntervals $leiter1 #'(3 4) }
         \new ChordNames \transpose c $p { \key c \major \CreateIntervals $leiter #3 }
         \new Staff \new Voice { \clef bass \transpose c'' $p { \key c \major \CreateIntervals $leiter1 #'(3 4) } }
         \new Dynamics \DurStufen
       >>
       \new PianoStaff
       \with {
         instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "2. Umkehrung "
       }
       <<
         \new Staff \transpose c' $p { \key c \major \CreateIntervals $leiter2 #'(4 3) }
         \new ChordNames \transpose c $p \CreateIntervals $leiter #3
         \new Staff \new Voice { \clef bass \transpose c''' $p { \key c \major \CreateIntervals $leiter2 #'(4 3) } }
         \new Dynamics \DurStufen
       >>
     >>
   #}
   )

Dreiklangex =
#(define-void-function (leiter leiter1 leiter2 p) (ly:music? ly:music? ly:music? ly:pitch?)
   (add-score
    (list #{  \markup \fill-line \override #'(font-features . ("smcp")) \override #'(box-padding . 1)
              \override #'(thickness . 2) \override #'(font-size . 4)
              { \null \rounded-box \concat { "Leitereigene Dreiklänge " #(note-name->my-markup p) "-Dur" } \null }
      #}))
   (add-score
    (scorify-music #{ \DreiKlangx $leiter $leiter1 $leiter2 $p #})))

DreiKlangg =
#(define-music-function (leiter leiter1 leiter2 p)
   (ly:music? ly:music? ly:music? ly:pitch?)
   #{
     <<
       \new PianoStaff
       \with {
         instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "Tonleiter "
       }
       \new Voice { \key $p \major \transpose c $p $leiter }
       \new Dynamics \DurStufen
       \new PianoStaff
       \with {
         instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "Grundstellung "
       }
       <<
         \new Staff  \new Voice \transpose c $p { \key c \major \CreateIntervals $leiter #3 }
         \new ChordNames \transpose c $p \CreateIntervals $leiter #3
         \new Staff \new Voice { \clef bass \transpose c''' $p { \key c \major \CreateIntervals $leiter #3 } }
         \new Dynamics \DurStufen
       >>
       \new PianoStaff
       \with {
         instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "1. Umkehrung "
       }
       <<
         \new Staff \transpose c' $p { \key c \major \CreateIntervals $leiter1 #'(3 4) }
         \new ChordNames \transpose c $p \CreateIntervals $leiter #3
         \new Staff \new Voice { \clef bass \transpose c'' $p { \key c \major \CreateIntervals $leiter1 #'(3 4) } }
         \new Dynamics \DurStufen
       >>
       \new PianoStaff
       \with {
         instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "2. Umkehrung "
       }
       <<
         \new Staff \transpose c' $p { \key c \major \CreateIntervals $leiter2 #'(4 3) }
         \new ChordNames \transpose c $p \CreateIntervals $leiter #3
         \new Staff \new Voice { \clef bass \transpose c''' $p { \key c \major \CreateIntervals $leiter2 #'(4 3) } }
         \new Dynamics \DurStufen
       >>
     >>
   #}
   )

Dreiklangeg =
#(define-void-function (leiter leiter1 leiter2 p) (ly:music? ly:music? ly:music? ly:pitch?)
   (add-score
    (list #{  \markup \fill-line \override #'(font-features . ("smcp")) \override #'(box-padding . 1)
              \override #'(thickness . 2) \override #'(font-size . 4)
              { \null \rounded-box \concat { "Leitereigene Dreiklänge " #(note-name->my-markup p) "-Dur" } \null }
      #}))
   (add-score
    (scorify-music #{ \DreiKlangg $leiter $leiter1 $leiter2 $p #})))

ldur  = \relative c' { c1 d e f g a h }
ldurt = \modalTranspose c e \ldur \ldur
ldurq = \modalTranspose c g \ldur \ldur
ldurs = \modalTranspose c h \ldur \ldur

KadI = \relative c' { < c e g c >1 }
Kadii = \relative c' { < d f a >1 }
Kadiii = \relative c' { < h e g h >1 }
Kadvi = \relative c' { < c e a c >1 }
Kadvii = \relative c' { < h d f h >1 }
KadV = \relative c' { < h d g h >1 }
KadIV = \relative c' { < c f a c >1 }
KadIj = \relative c' { < c e g h >1 }

VollK = {
  \KadI \KadIV \Kadvii \Kadiii
  \Kadvi \Kadii \KadV \KadI
}

cKadV = \chordmode { g1 }
cKadIV = \chordmode { f1 }
cKadii = \chordmode { d1:m }
cKadiii = \chordmode { e1:m }
cKadvi = \chordmode { a1:m }
cKadvii = \chordmode { h:dim }
cKadIj  = \chordmode { c1:maj7 }
cKadI = \chordmode { c1 }
cVollK = \chordmode {
  \cKadI \cKadIV \cKadvii \cKadiii
  \cKadvi \cKadii \cKadV \cKadI
}

KadI = \relative c' { < c e g h >1 }
KadIa = \relative c'' { < g h c e >1 }
Kadii = \relative c' { < d f a c >1 }
Kadiii = \relative c' { < e g h d >1 }
Kadvi = \relative c' { < e g a c >1 }
Kadvii = \relative c' { < f a h d >1 }
KadV = \relative c' { < d f g h >1 }
KadIV = \relative c' { < f a c e >1 }
KadIj = \relative c' { < c e g h >1 }

VollKj = {
  \KadIa \KadIV \Kadvii \Kadiii
  \Kadvi \Kadii \KadV \KadI
}

cKadV = \chordmode { g1:7 }
cKadIV = \chordmode { f1:maj7 }
cKadii = \chordmode { d1:m7 }
cKadiii = \chordmode { e1:m7 }
cKadvi = \chordmode { a1:m7 }
cKadvii = \chordmode { h:dim7 }
cKadIj  = \chordmode { c1:maj7 }
cKadI = \chordmode { c1:maj7 }
cVollKj = \chordmode {
  \cKadI \cKadIV \cKadvii \cKadiii
  \cKadvi \cKadii \cKadV \cKadI
}

KadI = \relative c'' { < a c e a >1 }
Kadii = \relative c'' { < h d f h >1 }
Kadiii = \relative c'' { < c e gis c >1 }
Kadvi = \relative c'' { < c f a c >1 }
Kadvii = \relative c'' { < h d gis h >1 }
KadV = \relative c'' { < h e gis h >1 }
KadIV = \relative c'' { < a d f a >1 }
KadIj = \relative c'' { < c e g h >1 }

VollKMoll = {
  \accidentalStyle forget
  \KadI \KadIV \Kadvii \Kadiii
  \Kadvi \Kadii \KadV \KadI
}

cKadV = \chordmode { e1 }
cKadIV = \chordmode { d1:m }
cKadii = \chordmode { h1:min }
cKadiii = \chordmode { c1:aug }
cKadvi = \chordmode { f1 }
cKadvii = \chordmode { gis:dim }
cKadIj  = \chordmode { c1:maj7 }
cKadI = \chordmode { a1:m }
cVollKMoll = \chordmode {
  \cKadI \cKadIV \cKadvii \cKadiii
  \cKadvi \cKadii \cKadV \cKadI
}

MollStufen = {
  s1\dynamictext "i"  s\dynamictext "iv"
  s\dynamictext "vii"  s\dynamictext "iii"
  s\dynamictext "VI"  s\dynamictext "ii"
  s\dynamictext "V"   s\dynamictext "i"
}

DurStufenx = {
  s1\dynamictext "I"  s\dynamictext "IV"
  s\dynamictext "vii"  s\dynamictext "iii"
  s\dynamictext "vi"  s\dynamictext "ii"
  s\dynamictext "V"  s\dynamictext "I"
}

Durkadenzen =
#(define-music-function (Tonart)
   (ly:pitch?)
   #{
     <<
       \new PianoStaff
       \with
       {
         instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "klassisch "
       }
       <<
         \new Staff
         <<
           \new Voice
           {
             \key $Tonart \major
             \cadenzaOn
             \transpose c $Tonart
             \VollK
           }
         >>
         \new ChordNames \transpose c $Tonart \cVollK
         \new Staff
         <<
           \new Voice
           {
             \key $Tonart \major
             \clef bass
             \transpose c'' $Tonart
             \VollK
           }
         >>
       >>
       \new Dynamics \DurStufenx
     >>
   #}
   )

Jazzkadenzen =
#(define-music-function (Tonart)
   (ly:pitch?)
   #{
     <<
       \new PianoStaff
       \with
       {
         instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "Jazz "
       }
       <<
         \new Staff
         <<
           \new Voice
           {
             \key $Tonart \major
             \cadenzaOn
             \transpose c $Tonart
             \VollKj
           }
         >>
         \new ChordNames \transpose c $Tonart \cVollKj
         \new Staff
         <<
           \new Voice
           {
             \key $Tonart \major
             \clef bass
             \transpose c'' $Tonart
             \VollKj

           }
         >>
       >>
       \new Dynamics \DurStufenx
     >>
   #}
   )

Mollkadenzen =
#(define-music-function (Tonart)
   (ly:pitch?)
   #{
     <<

       \new PianoStaff
       \with
       {
         instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp")) "Moll "
       }
       <<
         \new Staff
         <<
           %\new NullVoice \nolinebr
           \new Voice
           {
             \key $Tonart \minor
             \cadenzaOn
             \transpose a $Tonart
             \VollKMoll
           }
         >>
         \new ChordNames \transpose a $Tonart \cVollKMoll

         \new Staff
         <<
           \new Voice
           {
             \key $Tonart \minor
             \clef bass
             \transpose a'' $Tonart
             \VollKMoll
           }
         >>
       >>
       \new Dynamics \MollStufen
     >>
   #}
   )

MollkadenzenDur =
#(define-music-function (Tonart)
   (ly:pitch?)
   #{
     <<
       \new PianoStaff
       \with
       {
         instrumentName = \markup \fontsize #2 \override #'(font-features . ("smcp"))
         \right-column { "Moll-Akkorde in " \concat { #(note-name->my-markup Tonart) "-Dur notiert " } }
       }
       <<
         \new Staff
         <<
           %\new NullVoice \nolinebr
           \new Voice
           {
             \key $Tonart \major
             \cadenzaOn
             \transpose a $Tonart
             \VollKMoll
           }
         >>
         \new ChordNames \transpose a $Tonart \cVollKMoll
         \new Staff
         <<
           \new Voice
           {
             \key $Tonart \major
             \clef bass
             \transpose a'' $Tonart
             \VollKMoll
           }
         >>
       >>
       \new Dynamics \MollStufen
     >>
   #}
   )

Quintfall =
#(define-void-function (p) (ly:pitch?)
   (add-score
    (list #{  \markup \fill-line \override #'(font-features . ("smcp")) \override #'(box-padding . 1)
              \override #'(thickness . 2) \override #'(font-size . 6)
              { \null \rounded-box \concat {"Quintfall von " #(note-name->my-markup p) } \null }
      #}))
   (add-score
    (scorify-music #{ { \Durkadenzen $p } #}))
   (add-score
    (scorify-music #{ { \Jazzkadenzen $p } #}))
   (add-score
    (scorify-music #{ { \Mollkadenzen $p } #}))
   (add-score
    (scorify-music #{ { \MollkadenzenDur $p } #}))
   )

VStufen = {
  s2\dynamictext "I" s\dynamictext "IV"
  s\dynamictext "V" s\dynamictext "I"
}

FStufen = {
  s2\dynamictext "I" s\dynamictext "vi"
  s\dynamictext "IV"
  s\dynamictext "V"  s\dynamictext "I"
}

vkad=\relative c' {
  \time 2/1
  < e g c >2 < f a c > < d g h > < e g c > \bar "»«"
  < g c e >
  \override PianoStaff.BarLine.stencil = ##f

  < a c f > <g h d > < g c e >
  \revert PianoStaff.BarLine.stencil
  \bar "»«"
  < c, e g > < c f a > < h d g > < c e g >
}

skad = \relative c'' {
  \time 5/2
  < g c e >2 < a c e > < a c f > <g h d > < g c e > \bar "»«"
  < e g c > < e a c > < f a c > < d g h > < e g c > \bar "»«"
  < c e g > < c e a > < c f a > < h d g > < c e g >
}

vli=\relative c { c f e c }
sli=\relative c { c a' f g c, }

vkadenz =
#(define-music-function ( p)
   (ly:pitch?)
   #{
     \new PianoStaff
     \with {
       instrumentName = ""
       %\consists "Bar_engraver"
     }
     <<
       \new Staff \transpose c $p { \key c \major \vkad }
       \new Dynamics { \VStufen \VStufen \VStufen }
       \new Staff \new Voice { \clef bass \transpose c $p { \key c \major \vli \vli \vli } }
     >>
   #}
   )

skadenz =
#(define-music-function ( p)
   (ly:pitch?)
   #{
     \new PianoStaff
     \with {
       instrumentName = ""
       %\consists "Bar_engraver"
     }
     <<
       \new Staff \transpose c $p { \key c \major \skad }
       \new Dynamics { \FStufen \FStufen \FStufen }
       \new Staff \new Voice { \clef bass \transpose c $p { \key c \major \sli \sli \sli } }
     >>
   #}
   )

kadnzn =
#(define-void-function (p) (ly:pitch?)
   (add-score
    (list #{  \markup \fill-line \override #'(font-features . ("smcp")) \override #'(box-padding . 1)
              \override #'(thickness . 2) \override #'(font-size . 6)
              { \null \rounded-box \concat { #(note-name->my-markup p) "-Dur Kadenzen" } \null }
      #}))
   (add-score
    (scorify-music #{ { \vkadenz $p } #}))
   (add-score
    (scorify-music #{ { \skadenz $p } #}))
   )

vkadenzh =
#(define-music-function ( p)
   (ly:pitch?)
   #{
     \new PianoStaff
     \with {
       instrumentName = ""
       %\consists "Bar_engraver"
     }
     <<
       \new Staff \transpose c $p { \key c \major \vkad }
       \new Dynamics { \VStufen \VStufen \VStufen }
       \new Staff \new Voice { \clef bass \transpose c' $p { \key c \major \vli \vli \vli } }
     >>
   #}
   )

skadenzh =
#(define-music-function ( p)
   (ly:pitch?)
   #{
     \new PianoStaff
     \with {
       instrumentName = ""
       %\consists "Bar_engraver"
     }
     <<
       \new Staff \transpose c $p { \key c \major \skad }
       \new Dynamics { \FStufen \FStufen \FStufen }
       \new Staff \new Voice { \clef bass \transpose c' $p { \sli \sli \sli } }
     >>
   #}
   )

kadnznh =
#(define-void-function (p) (ly:pitch?)
   (add-score
    (list #{  \markup \fill-line \override #'(font-features . ("smcp")) \override #'(box-padding . 1)
              \override #'(thickness . 2) \override #'(font-size . 6)
              { \null \rounded-box \concat { #(note-name->my-markup p) "-Dur Kadenzen" } \null }
      #}))
   (add-score
    (scorify-music #{ { \vkadenzh $p } #}))
   (add-score
    (scorify-music #{ { \skadenzh $p } #}))
   )
\bookpart {
  \paper {
    markup-system-spacing.minimum-distance = #5
    markup-markup-spacing.minimum-distance = #5
    score-system-spacing.minimum-distance = #10
    top-markup-spacing.minimum-distance = #20
    markup-system-spacing.basic-distance = 12
    oddHeaderMarkup = ##f
    evenHeaderMarkup = #oddHeaderMarkup
    oddFooterMarkup = #oddHeaderMarkup
    evenFooterMarkup = #oddHeaderMarkup
    ragged-right = ##f
    ragged-last = ##f
    ragged-bottom = ##t
    ragged-last-bottom = ##t
    line-width = 150\mm
  }
  \markup \column {
    \vspace #1
    \fill-line \abs-fontsize #60
    { \null \bold \caps "Workshop" \null }
    \vspace #0.8
    \fill-line \abs-fontsize #60
    { \null \bold \caps "Pop-Akkordeon" \null }
    \vspace #2
    \fill-line {
      \null
      \epsfile #X #80 #"quizi.eps"
      \null
    }
    \vspace #2
    % \vspace #28
    \fill-line \abs-fontsize #30
    { \null  "mit" \null }
    \vspace #1
    \fill-line \abs-fontsize #48
    { \null \bold "Alexander Christof" \null }
    \vspace #1
    \fill-line \abs-fontsize #36
    { \null "29. Februar 2020" \null }
  }
  \pageBreak \markup \null
  \pageBreak \markup \null
}

\paper {
  markup-system-spacing.minimum-distance = #5
  markup-markup-spacing.minimum-distance = #5
  score-system-spacing.minimum-distance = #10
  top-markup-spacing.minimum-distance = #20
  markup-system-spacing.basic-distance = 12
  oddHeaderMarkup = ##f
  evenHeaderMarkup = #oddHeaderMarkup
  oddFooterMarkup = #oddHeaderMarkup
  evenFooterMarkup = #oddHeaderMarkup
  ragged-right = ##f
  ragged-last = ##f
  ragged-bottom = ##t
  ragged-last-bottom = ##t
  line-width = 150\mm
}

leiter  = \relative c' { c1 d e f g a h }
% leiters = \modalTranspose c e \leiter \leiter
% leitert = \modalTranspose c g \leiter \leiter
% leiterq = \modalTranspose c h \leiter \leiter
leiters = \relative c' { e1 f g a h c d }
leitert = \relative c' { g1 a h c d e f }
leiterq = \relative c' { h1 c d e f g a }
leiterd = \relative c' { d1 e f g a h c }
%{
mybook =
#(define-void-function (p) (ly:pitch?)
  (let* ((bk (ly:make-book $defaultpaper $defaultheader '()))
         (bk-parts
           (list
             (ly:make-book-part (list (Dreiklange ldur ldurt ldurq p)))
             (ly:make-book-part (list (Vierklange leiter leiters leitert leiterq p))))))
    (for-each
      (lambda (bookpart) (ly:book-add-bookpart! bk bookpart))
      bk-parts)

    (ly:book-process
      bk
      $defaultpaper
      $defaultlayout
      (ly:parser-output-name))))

\mybook c
%}

\bookpart {
  \Dreiklange \ldur \ldurt \ldurq c
}

% {
\bookpart {
  \Vierklange \leiter \leiters \leitert \leiterq c
}

\bookpart {
  \paper {
    score-system-spacing.minimum-distance = #20
  }
  \Quintfall c
}

\bookpart {
  \paper {
    markup-system-spacing.basic-distance = 24
    markup-system-spacing.minimum-distance = #15
    markup-markup-spacing.minimum-distance = #15
    system-system-spacing.minimum-distance = #40
    top-markup-spacing.minimum-distance = #40
  }
  \kadnzn c
}

% {
\bookpart {
  \Dreiklangex \ldur \ldurt \ldurq g
}

\bookpart {
  \Vierklangeg \leiter \leiters \leitert \leiterq g
}

\bookpart {
  \Quintfall g
}

\bookpart {
  \paper {
    markup-system-spacing.basic-distance = 24
    markup-system-spacing.minimum-distance = #15
    markup-markup-spacing.minimum-distance = #15
    system-system-spacing.minimum-distance = #40
    top-markup-spacing.minimum-distance = #40
  }
  \kadnzn g
}

% {
\bookpart {
  \Dreiklange \ldur \ldurt \ldurq d
}

\bookpart {
  \Vierklange \leiter \leiters \leitert \leiterq d
}

\bookpart {
  \Quintfall d
}

\bookpart {
  \paper {
    markup-system-spacing.basic-distance = 24
    markup-system-spacing.minimum-distance = #15
    markup-markup-spacing.minimum-distance = #15
    system-system-spacing.minimum-distance = #40
    top-markup-spacing.minimum-distance = #40
  }
  \kadnzn d
}

% {
\bookpart {
  \Dreiklangea \ldur \ldurt \ldurq a
}

\bookpart {
  \Vierklangeg \leiter \leiters \leitert \leiterq a
}

\bookpart {
  \Quintfall a
}

\bookpart {
  \paper {
    markup-system-spacing.basic-distance = 24
    markup-system-spacing.minimum-distance = #15
    markup-markup-spacing.minimum-distance = #15
    system-system-spacing.minimum-distance = #40
    top-markup-spacing.minimum-distance = #40
  }
  \kadnzn a
}

% {
\bookpart {
  \Dreiklangee \ldur \ldurt \ldurq e
}

\bookpart {
  \Vierklange \leiter \leiters \leitert \leiterq e
}

\bookpart {
  \Quintfall e
}

\bookpart {
  \paper {
    markup-system-spacing.basic-distance = 24
    markup-system-spacing.minimum-distance = #15
    markup-markup-spacing.minimum-distance = #15
    system-system-spacing.minimum-distance = #40
    top-markup-spacing.minimum-distance = #40
  }
  \kadnzn e
}

% {
\bookpart {
  \Dreiklangea \ldur \ldurt \ldurq h
}

\bookpart {
  \Vierklangeh \leiter \leiters \leitert \leiterq h
}

\bookpart {
  \Quintfall h
}

\bookpart {
  \paper {
    markup-system-spacing.basic-distance = 24
    markup-system-spacing.minimum-distance = #15
    markup-markup-spacing.minimum-distance = #15
    system-system-spacing.minimum-distance = #40
    top-markup-spacing.minimum-distance = #40
  }
  \kadnznh h
}

% {
\bookpart {
  \Dreiklangex \ldur \ldurt \ldurq fis
}

\bookpart {
  \Vierklangeg \leiter \leiters \leitert \leiterq fis
}

\bookpart {
  \Quintfall fis
}

\bookpart {
  \paper {
    markup-system-spacing.basic-distance = 24
    markup-system-spacing.minimum-distance = #15
    markup-markup-spacing.minimum-distance = #15
    system-system-spacing.minimum-distance = #40
    top-markup-spacing.minimum-distance = #40
  }
  \kadnzn fis
}

% {
\bookpart {
  \Dreiklangex \ldur \ldurt \ldurq ges
}

\bookpart {
  \Vierklangeg \leiter \leiters \leitert \leiterq ges
}

\bookpart {
  \Quintfall ges
}

\bookpart {
  \paper {
    markup-system-spacing.basic-distance = 24
    markup-system-spacing.minimum-distance = #15
    markup-markup-spacing.minimum-distance = #15
    system-system-spacing.minimum-distance = #40
    top-markup-spacing.minimum-distance = #40
  }
  \kadnzn ges
}

% {
\bookpart {
  \Dreiklange \ldur \ldurt \ldurq des
}

\bookpart {
  \Vierklange \leiter \leiters \leitert \leiterq des
}

\bookpart {
  \Quintfall des
}

\bookpart {
  \paper {
    markup-system-spacing.basic-distance = 24
    markup-system-spacing.minimum-distance = #15
    markup-markup-spacing.minimum-distance = #15
    system-system-spacing.minimum-distance = #40
    top-markup-spacing.minimum-distance = #40
  }
  \kadnzn des
}

% {
\bookpart {
  \Dreiklangex \ldur \ldurt \ldurq as
}

\bookpart {
  \Vierklangeg \leiter \leiters \leitert \leiterq as
}

\bookpart {
  \Quintfall as
}

\bookpart {
  \paper {
    markup-system-spacing.basic-distance = 24
    markup-system-spacing.minimum-distance = #15
    markup-markup-spacing.minimum-distance = #15
    system-system-spacing.minimum-distance = #40
    top-markup-spacing.minimum-distance = #40
  }
  \kadnzn as
}

% {
\bookpart {
  \Dreiklangee \ldur \ldurt \ldurq es
}

\bookpart {
  \Vierklange \leiter \leiters \leitert \leiterq es
}

\bookpart {
  \Quintfall es
}

\bookpart {
  \paper {
    markup-system-spacing.basic-distance = 24
    markup-system-spacing.minimum-distance = #15
    markup-markup-spacing.minimum-distance = #15
    system-system-spacing.minimum-distance = #40
    top-markup-spacing.minimum-distance = #40
  }
  \kadnzn es
}

% {
\bookpart {
  \Dreiklangea \ldur \ldurt \ldurq b
}

\bookpart {
  \Vierklangeh \leiter \leiters \leitert \leiterq b
}

\bookpart {
  \Quintfall b
}

\bookpart {
  \paper {
    markup-system-spacing.basic-distance = 24
    markup-system-spacing.minimum-distance = #15
    markup-markup-spacing.minimum-distance = #15
    system-system-spacing.minimum-distance = #40
    top-markup-spacing.minimum-distance = #40
  }
  \kadnznh b
}

% {
\bookpart {
  \Dreiklange \ldur \ldurt \ldurq f
}

\bookpart {
  \Vierklange \leiter \leiters \leitert \leiterq f
}

\bookpart {
  \Quintfall f
}

\bookpart {
  \paper {
    markup-system-spacing.basic-distance = 24
    markup-system-spacing.minimum-distance = #15
    markup-markup-spacing.minimum-distance = #15
    system-system-spacing.minimum-distance = #40
    top-markup-spacing.minimum-distance = #40
  }
  \kadnzn f
}
%}

Include Datei Exceptions.ily

myflat = \markup \fontsize #-1 \flat
mysharp = \markup \fontsize #-2 \sharp
%slashfive = \markup \combine 5 \override #'(thickness . 2) \draw-line #'(1 . 1)
slashfive = \markup \slashed-digit #5
%slashdrei = \markup \combine 3 \override #'(thickness . 2) \draw-line #'(1 . 1)
slashdrei = \markup \slashed-digit #3
slashsev = \markup \slashed-digit #7
slashnin = \markup \slashed-digit #9

bfiv = \markup \concat { "(" \myflat "5)" }
ffiv = \markup \concat { "(" \mysharp "5)" }
bsev = \markup \concat { "(" \myflat "7)" }
fsev = \markup \concat { "(" \mysharp "7)" }
bnin = \markup \concat { "(" \myflat "9)" }
fnin = \markup \concat { "(" \mysharp "9)" }

chExceptionMusic = {
  <c e g h>1-\markup \concat  { \fontsize #-4 \override #'(font-features . ("smcp")) "ma" \super "7" }
  <c e g h d'>1-\markup \concat  { \fontsize #-4 \override #'(font-features . ("smcp")) "ma" \super "9" }
  <c e g h dis'>1-\markup { \fontsize #-6 " " "j" \super \vcenter { "7(" \mysharp "9)" } }
  <c e g h d' a'>1-\markup { \fontsize #-6 " " "j" \super 13 }
  <c e g b d' a'>1-\markup { \super 13 }
  <c g>1-\markup \super { ( \slashdrei ) }
  <c e b>1-\markup \super { 7( \slashfive ) }
  <c e heses>1-\markup \super { 7 \bsev }
  <c e h>1-\markup \super { j7( \slashfive ) }

  <c e g a d'>-\markup \super "6/9"
  <c es g a d'>-\markup { m \super 6/9 }
  <c es ges heses>-\markup { \fontsize #-6 " " \super { \char ##xD8 7 } }
  <c es ges b des'>-\markup \line {
    m \super 7
    \translate #'(-0.5 . 1) \vcenter
    {
      "(" \override #'(baseline-skip . 1)
      \center-column
      \fontsize #-4 { \concat { \myflat "5" } \concat { \myflat "9" } } ")"
    }
  }
  <c es ges h>-\markup {
    \fontsize #-6 " " \super \char ##xD8 \super j7
  }
  <c es ges heses des'>-\markup {
    \fontsize #-6 " " \super \char ##xD8 \super \concat { \myflat "9" }
  }

  <c es g b f'>-\markup {
    m \super 7(add11)
  }
  <c es gis>-\markup {
    m
    \normal-size-super "+"
  }
  <c f g b>-\markup \super {
    7
    \normal-size-sub sus
  }
  <c f g b d'>-\markup \super {
    9
    \normal-size-sub sus
  }
  <c f g b d' a'>-\markup \super {
    13
    \normal-size-sub sus
  }
  <c e ges b>-\markup \super {
    7 "(" \myflat "5)"
  }
  <c e ges b d'>-\markup \super {
    9 "(" \myflat "5)"
  }
  <c e gis b>-\markup {
    + \super 7
  }
  <c e gis b d'>-\markup {
    + \super 9
  }
  <c e g b des'>-\markup \super {
    7 "(" \myflat "9)"
  }
  <c e g b dis'>-\markup \super {
    \vcenter { "7(" \mysharp "9)" }
  }
  <c e ges b des'>-\markup \line {
    \super 7
    \translate #'(-0.5 . 1) \vcenter
    {
      "(" \override #'(baseline-skip . 1)
      \center-column
      \fontsize #-4 { \concat { \myflat "9" } \concat { \myflat "5" } } ")"
    }
  }
  <c e gis b dis'>-\markup {
    + \super \vcenter { "7(" \mysharp "9)" }
  }
  <c e gis b des'>-\markup {
    + \super \vcenter { "7(" \myflat "9)" }
  }
  <c e gis h >-\markup {
    + \super 7
  }
  <c e gis h d'>-\markup {
    + \super j9
  }

  <c e g b fis'>-\markup
  \super \vcenter { "7(" \mysharp "11)" }
  <c e g b d' fis'>-\markup
  \super \vcenter { "9(" \mysharp "11)" }
  <c e g b des' fis'>-\markup \line {
    \super 7
    \translate #'(-0.5 . 1) \vcenter
    {
      "(" \override #'(baseline-skip . 1)
      \center-column
      \fontsize #-4 { \concat { \mysharp "11" } \concat { \myflat "9" } } ")"
    }
  }
  <c e ges b d' a'>-\markup
  \super \vcenter { "13(" \myflat "5)" }
  <c e g b d' fis' a'>-\markup
  \super \vcenter { "13(" \mysharp "11)" }
  <c e b f' a'>-\markup \line {
    \super { 7 \slashed-digit #5 }
    \translate #'(-0.5 . 2.5) \vcenter
    {
      "("
      \override #'(baseline-skip . 1)
      \left-column
      \fontsize #-4 { add11 add13 } ")"
    }
  }
  <c e g b f' a'>-\markup \line {
    \super %\concat \general-align #Y #DOWN
    { 7 }
    \translate #'(-0.5 . 2.5) \vcenter
    {
      "("
      \override #'(baseline-skip . 1)
      \left-column
      \fontsize #-4 { add11 add13 } ")"
    }
  }
  <c e f' a'>-\markup \line {
    \super { \slashed-digit #5 }
    \translate #'(-0.5 . 2.5) \vcenter
    {
      "("
      \override #'(baseline-skip . 1)
      \left-column
      \fontsize #-4 { add11 add13 } ")"
    }
  }
  <c es g h d'>-\markup {
    m
    \super j9
  }
}

chExceptions =
#(append
  (sequential-music-to-chord-exceptions chExceptionMusic #t)
  ignatzekExceptions)

myBlue = #(rgb-color (/ 22 255) (/ 22 255) (/ 92 255))

#(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))
myflat = \markup \fontsize #-1 \flat
mysharp = \markup \fontsize #-2 \sharp
%slashfive = \markup \combine 5 \override #'(thickness . 2) \draw-line #'(1 . 1)
slashfive = \markup \slashed-digit #5
%slashdrei = \markup \combine 3 \override #'(thickness . 2) \draw-line #'(1 . 1)
slashdrei = \markup \slashed-digit #3
slashsev = \markup \slashed-digit #7
slashnin = \markup \slashed-digit #9

bfiv = \markup \concat { "(" \myflat "5)" }
ffiv = \markup \concat { "(" \mysharp "5)" }
bsev = \markup \concat { "(" \myflat "7)" }
fsev = \markup \concat { "(" \mysharp "7)" }
bnin = \markup \concat { "(" \myflat "9)" }
fnin = \markup \concat { "(" \mysharp "9)" }

chExceptionMusic = {
  <c e g h>1-\markup \concat  { \fontsize #-4 \override #'(font-features . ("smcp")) "ma" \super "7" }
  <c e g h d'>1-\markup \concat  { \fontsize #-4 \override #'(font-features . ("smcp")) "ma" \super "9" }
  <c e g h dis'>1-\markup { \fontsize #-6 " " "j" \super \vcenter { "7(" \mysharp "9)" } }
  <c e g h d' a'>1-\markup { \fontsize #-6 " " "j" \super 13 }
  <c e g b d' a'>1-\markup { \super 13 }
  <c g>1-\markup \super { ( \slashdrei ) }
  <c e b>1-\markup \super { 7( \slashfive ) }
  <c e heses>1-\markup \super { 7 \bsev }
  <c e h>1-\markup \super { j7( \slashfive ) }

  <c e g a d'>-\markup \super "6/9"
  <c es g a d'>-\markup { m \super 6/9 }
  <c es ges heses>-\markup { \fontsize #-6 " " \super { \char ##xD8 7 } }
  <c es ges b des'>-\markup \line {
    m \super 7
    \translate #'(-0.5 . 1) \vcenter
    {
      "(" \override #'(baseline-skip . 1)
      \center-column
      \fontsize #-4 { \concat { \myflat "5" } \concat { \myflat "9" } } ")"
    }
  }
  <c es ges h>-\markup {
    \fontsize #-6 " " \super \char ##xD8 \super j7
  }
  <c es ges heses des'>-\markup {
    \fontsize #-6 " " \super \char ##xD8 \super \concat { \myflat "9" }
  }

  <c es g b f'>-\markup {
    m \super 7(add11)
  }
  <c es gis>-\markup {
    m
    \normal-size-super "+"
  }
  <c f g b>-\markup \super {
    7
    \normal-size-sub sus
  }
  <c f g b d'>-\markup \super {
    9
    \normal-size-sub sus
  }
  <c f g b d' a'>-\markup \super {
    13
    \normal-size-sub sus
  }
  <c e ges b>-\markup \super {
    7 "(" \myflat "5)"
  }
  <c e ges b d'>-\markup \super {
    9 "(" \myflat "5)"
  }
  <c e gis b>-\markup {
    + \super 7
  }
  <c e gis b d'>-\markup {
    + \super 9
  }
  <c e g b des'>-\markup \super {
    7 "(" \myflat "9)"
  }
  <c e g b dis'>-\markup \super {
    \vcenter { "7(" \mysharp "9)" }
  }
  <c e ges b des'>-\markup \line {
    \super 7
    \translate #'(-0.5 . 1) \vcenter
    {
      "(" \override #'(baseline-skip . 1)
      \center-column
      \fontsize #-4 { \concat { \myflat "9" } \concat { \myflat "5" } } ")"
    }
  }
  <c e gis b dis'>-\markup {
    + \super \vcenter { "7(" \mysharp "9)" }
  }
  <c e gis b des'>-\markup {
    + \super \vcenter { "7(" \myflat "9)" }
  }
  <c e gis h >-\markup {
    + \super 7
  }
  <c e gis h d'>-\markup {
    + \super j9
  }

  <c e g b fis'>-\markup
  \super \vcenter { "7(" \mysharp "11)" }
  <c e g b d' fis'>-\markup
  \super \vcenter { "9(" \mysharp "11)" }
  <c e g b des' fis'>-\markup \line {
    \super 7
    \translate #'(-0.5 . 1) \vcenter
    {
      "(" \override #'(baseline-skip . 1)
      \center-column
      \fontsize #-4 { \concat { \mysharp "11" } \concat { \myflat "9" } } ")"
    }
  }
  <c e ges b d' a'>-\markup
  \super \vcenter { "13(" \myflat "5)" }
  <c e g b d' fis' a'>-\markup
  \super \vcenter { "13(" \mysharp "11)" }
  <c e b f' a'>-\markup \line {
    \super { 7 \slashed-digit #5 }
    \translate #'(-0.5 . 2.5) \vcenter
    {
      "("
      \override #'(baseline-skip . 1)
      \left-column
      \fontsize #-4 { add11 add13 } ")"
    }
  }
  <c e g b f' a'>-\markup \line {
    \super %\concat \general-align #Y #DOWN
    { 7 }
    \translate #'(-0.5 . 2.5) \vcenter
    {
      "("
      \override #'(baseline-skip . 1)
      \left-column
      \fontsize #-4 { add11 add13 } ")"
    }
  }
  <c e f' a'>-\markup \line {
    \super { \slashed-digit #5 }
    \translate #'(-0.5 . 2.5) \vcenter
    {
      "("
      \override #'(baseline-skip . 1)
      \left-column
      \fontsize #-4 { add11 add13 } ")"
    }
  }
  <c es g h d'>-\markup {
    m
    \super j9
  }
}

chExceptions =
#(append
  (sequential-music-to-chord-exceptions chExceptionMusic #t)
  ignatzekExceptions)

myBlue = #(rgb-color (/ 22 255) (/ 22 255) (/ 92 255))

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