% grosub=\sub \fontsize #+1.5

chExceptionMusic = {
  <c d e f g a h>1-\markup { "-Dur" }
  <c d es f g as b>1-\markup { "-Moll natural" }
  <c d es f g as h>1-\markup { "-Moll harm." }
  <c d es f g a h>1-\markup { "-Moll mel." }
  <c des e f g as b >1-\markup { "-Spanish Gypsy" }
  <c d es f ges g as h>1-\markup { "-Algerian" }
  <c d e f fis gis b>1-\markup { "-Arabic " }
  <c cis e f g gis h>1-\markup { "-Byzantine" }
  <c cis dis e f fis gis ais>1-\markup { "-Eight Tone Spanish" }
  <c des e fis gis ais h>1-\markup { "-Enigmatic asc." }
  <c des e f gis ais h>1-\markup { "-Enigmatic desc." }
  <c d es f g as b>1-\markup { "-Geez" }
  <c d e f g as b>1-\markup { "-Aeolian Dominant" }
  <c des f ges b>1-\markup { "Hirajoshi" }
  <c d es fis g as h>1-\markup { "Hungarian" }
  <c d e fis g a b>1-\markup { "Acoustic Scale" }
  <c cis f g ais>1-\markup { "-Japanese" }
  <c d es fis g a ais>1-\markup { "-Romanian Minor" }
  <c d e f g as h>1-\markup { "-Maqams" }
  <c es f g b>1-\markup { "-Minor Pentatonic" }
  <c es f fis g b>1-\markup { "-Minor Blues" }
  <c d es e g a>1-\markup { "-Major Blues" }
  <c des d es f g a b>1-\markup { "-Adonai Malakh" }
  <c d e fis g a b>1-\markup { "-Bartok" }
  <c des es f ges g as h>1-\markup { "-Bebop Half-Diminished" }
  <c d e f g a b h>1-\markup { "-Bebop Dominant" }
  <c d es e f g a b>1-\markup { "-Bebop Minor" }
  <c d e f g gis a h>1-\markup { "-Bebop Major I" }
  <c d f g b>1-\markup { "-Egyptian" }
  <c d es f g a b>1-\markup { "-Dorisch" }
  <c des es f g as b >1-\markup { "-Phrygisch" }
  <c d e fis g a h>1-\markup { "-Lydisch" }
  <c d e f g a b>1-\markup { "-Mixolydisch" }
  <c d es f g as b>1-\markup { "-Äolisch" }
  <c des es g ges as b>1-\markup { "-Lokrisch" }
  <c d e fis gis b>1-\markup { "-Ganzton" }
  <c d e fis gis ais>1-\markup { "-Ganzton" }
  <cis dis fis gis ais>1-\markup { "-Halbton" }
   <c d es f g as b>1-\markup { "-Moll natural" }
  <c d es f g as h>1-\markup { "-Moll harm." }
  <c d es f g a h>1-\markup { "-Moll mel." }

  <c>1-\markup { \sub "bass" }
  <c es ges>1-\markup { \sub \fontsize #+1.5 "dim" }
  <c e gis>1-\markup { \sub \fontsize #+1.5 "j" }
  <c e geses>1-\markup { \sub \fontsize #+1.5 "ddim" }
  <c eses ges >1-\markup { \super "dddim" }
  <c e g h>1-\markup { \sub "j" \super "7" }
  <c e g h a'>1-\markup { \sub "j" \super "7(add13)" }
  <c g >1-\markup { \super "5" }
  <c g d'>1-\markup { \super "5(add9)" }
  <c e gis dis'>1-\markup { \sub "aug" \super { \smaller \sharp "9" } }
  <c e gis des'>1-\markup { \sub "aug" \super { \smaller \flat "9" } }
  <c e gis d'>1-\markup { \sub "aug" \super  "(add9)" }
  <c g des'>1-\markup { \super "5" \super { \smaller \flat "9"  } }
  <c g dis'>1-\markup { \super "5"  \super { \smaller \sharp "9"} }
  <c e g a b>1-\markup { \super "7(add6)" }
  <c es g h>1-\markup { \sub \fontsize #+1.5 "m" \super "j7" }
  <c es g h d' f'>1-\markup { \sub \fontsize #+1.5 "m" \super "j11" }
  <c es g b c'>1-\markup { \sub \fontsize #+1.5 "m" \super "7add8" }
  <c es g b d' e'>1-\markup { \sub \fontsize #+1.5 "m" \super "9add10" }
  <c es g b d' f' g'>1-\markup { \sub \fontsize #+1.5 "m" \super "11add12" }
  <c es ges h>1-\markup { \sub \fontsize #+1.5 "m" \super { "j7" \smaller \flat "5" } }
   <c es ges b des>1-\markup { \sub \fontsize #+1.5 "m" \super { "7" \smaller \flat "5" \smaller \flat "9" } }
  <c es ges b>1-\markup { \sub \fontsize #+1.5 "dim" \super { "7" \smaller \sharp "5" } }
  <c es ges heses>1-\markup { \sub "dim" \super "7" }
  <c es ges heses des >1-\markup { \sub "dim" \super { "7" \smaller \flat "9" } }
  <c e  ges h>1-\markup { \sub \fontsize #+1.5 "j7" \super {  \smaller \flat "5" } }
  <c e g h d'>1-\markup { \sub \fontsize #+1.5 "j" \super "9" }
  <c e g h d' a'>1-\markup { \sub \fontsize #+1.5 "j9" \super "(add13)" }
  <c e g b  a' >1-\markup { \super "7(add13)" }
  %<c e g  d' >1-\markup { \super "add9" }
  <c e g b des' as' >1-\markup { \super { \smaller \flat "9" \smaller \flat 13 } }
  <c e g b d' a' >1-\markup { \super "13" }
  <c e g a d'>1-\markup {  \super "6(add9)" }
  <c e g a f'>1-\markup { \super "6(add11)" }
  <c e g b d' f' a'>1-\markup { \super "13(add11)" }
  <c e g a a'>1-\markup { \super "6(add13)" }
  %<c e g a fis'>1-\markup { \super "6(add" \super { \sharp "11)" } }
  % <c es g as h>1-\markup { "m" \super "7(add" \super { \flat "6)" } }
  <c es g as h>1-\markup { \sub \fontsize #+1.5 "m" \super "7(add" \super { \smaller \flat "6)" } }
  <c es g a h>1-\markup { \sub \fontsize #+1.5 "m" \super "7(add6)" }
  <c es g h f'>1-\markup { \sub \fontsize #+1.5 "m" \super "j7(add11)" }
  <c es g a h d'>1-\markup { \sub \fontsize #+1.5 "m" \super "j9(add6)" }
  <c e gis h>1-\markup { \sub \fontsize #+1.5 "j" \super "7" \super { \smaller \sharp 5 } }
  <c e g a h>1-\markup { \sub \fontsize #+1.5 "j" \super "7(add6)" }
  <c f gis d'>1-\markup { \sub \fontsize #+1.5 "j" \super "sus4" \super { \smaller \sharp "5(add9)" } }
  <c e g h dis'>1-\markup { \super { "j7" \smaller \sharp "9" } }
  <c e gis h d'>1-\markup { \super { "j9" \smaller \sharp "5" } }
  <c es g h d'>1-\markup { \sub \fontsize #+1.5 "m"  \super { "j9" } }
  <c f g d'>1-\markup { \super "sus4(add9)" }
  <c es g a f'>1-\markup { \sub \fontsize #+1.5 "m" \super "6(add11)" }
  <c es ges b >1-\markup { \sub \fontsize #+1.5 "m" \super "7" \super { \smaller \flat "5" } }
}

inst =
#(define-music-function
  (string)
  (string?)
  #{ <>^\markup \bold \box #string #})

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

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

FootLeft = #(string-append "" )
FootCenter = #(string-append "")
FootRight = #(string-append "gesetzt mit LILYPOND " (lilypond-version) " am " (strftime "%d.%m.%Y %H:%M:%S" (localtime (current-time))))