Sauschädl Polka

Version vom 6. Mai 2020, 15:56 Uhr von Lily (Diskussion | Beiträge)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Zur Navigation springen Zur Suche springen


Lilypond-Code

\version "2.20.0"
\language "deutsch"

myTitel = "Sauschädl Polka"
mycomp=\markup \line \fontsize #-1.5 {
  "Trad."
}

AkkI = {
  \set Staff.shortInstrumentName = \markup \caps "Akk I"
  \set Staff.instrumentName = \markup \caps "Akk I"
}

AkkII = {
  \set Staff.shortInstrumentName = \markup \caps "Akk II"
  \set Staff.instrumentName = \markup \caps "Akk II"
}

BassI = {
  \set Staff.shortInstrumentName = \markup \caps "Bass"
  \set Staff.instrumentName = \markup \caps "Bass"
}

#(define (MM->Script-text evt)
   (if (eq? 'MultiMeasureTextEvent (ly:music-property evt 'name))
       (let ((res (make-music 'TextScriptEvent)))
         (newline) (display (ly:music-mutable-properties evt)) ; if you are curious ...
         (for-each (lambda(props)
                     (ly:music-set-property! res (car props) (cdr props)))
           (ly:music-mutable-properties evt))
         res)
       evt))

ghostMusic =
#(define-music-function (music) (ly:music? )
   (map-some-music
    (lambda(x)
      (let
       ((dur (ly:music-property x 'duration #f)))
       (and
        (or dur (eq? 'EventChord (ly:music-property x 'name)))
        (let
         ((skip (make-music 'SkipEvent 'duration
                  (or dur (make-duration-of-length (ly:music-length x)))))
          (artis (let ((elts (ly:music-property x 'elements #f)))
                   (if elts
                       (filter
                        (lambda(y)   ;; EventChord
                          (not (eq? 'NoteEvent (ly:music-property y 'name))))
                        elts)
                       (map MM->Script-text (ly:music-property x 'articulations '()))))))
         (ly:music-set-property! skip 'articulations artis)
         skip))))
    music))

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

chExBass = {
  <c es g heses>1-\markup \whiteout { "m" }  %% halbverminderter Septakkord
  <c es g b d'>1-\markup \whiteout { "m" } %% c:m9
  <c es ges b d'>1-\markup \whiteout { "m)" \hspace #-3.4 "(" } %% c:m9.5- eingeklammerter Akkord für einbuchstabige AKkordnamen
  <c es g b>1-\markup { "7" }    %% c:m7
  < c es g b d' f' a' >1-\markup { \normal-size-super "o" }  %% c:m13
  <c es g b d' f'>1-\markup { \fontsize #-0.5 "(7)" }  %% c:m11, die 7 in Klammer
}

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

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

#(define (note-name->my-german-markup pitch lowercase?)
   (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
      (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)))))))))

#(define (note-name->underlined-markup pitch lowercase?)
   "Return pitch markup for @var{pitch}."
   (make-underline-markup
    (make-line-markup
     (list
      (make-simple-markup
       (conditional-string-downcase
        (vector-ref #("C" "D" "E" "F" "G" "A" "B") (ly:pitch-notename pitch))
        lowercase?))
      (accidental->markup (ly:pitch-alteration pitch))))))

#(define (note-name->german-underlined-markup pitch lowercase?)
   (make-underline-markup
    (make-line-markup
     (list
      ((chord-name->german-markup-text-alteration #t) pitch lowercase?)))))

gRoot= \once \set ChordNames.chordRootNamer = #note-name->german-underlined-markup

chExceptionMusic = {
  <c es g heses>1-\markup \whiteout { "m" }  %% halbverminderter Septakkord
  <c es g b d'>1-\markup \whiteout { "m" } %% c:m9
  <c es ges b d'>1-\markup \whiteout { "m)" \hspace #-3.4 "(" } %% c:m9.5- eingeklammerter Akkord für einbuchstabige AKkordnamen
  %<c es g b>1-\markup { "7" }    %% c:m7
  < c es g b d' f' a' >1-\markup { "v" }  %% c:m13
  <c es g b d' f'>1-\markup { \fontsize #-0.5 "(7)" }  %% c:m11, die 7 in Klammer
}

chUpperBass =
{
  <c g>1-\markup { "" }
}

chExBasses =
#(append
  (sequential-music-to-chord-exceptions chExBass #t)
  (sequential-music-to-chord-exceptions chUpperBass #t)
  ignatzekExceptions)

firstNote =
#(define-music-function (music )
   (ly:music?)
   (event-chord-reduce music))

#(use-modules (scm accreg))
myBlue = #(x11-color 'sienna4)

\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 {
    \Staff
    beamExceptions = #'()
    \override BreathingSign.text =
    \markup { \musicglyph #"scripts.lvarcomma" }
    \override InstrumentName.font-features = #'("smcp")
  }
  \context {
    \ChordNames
    chordNameLowercaseMinor = ##t
    chordNameExceptions = #chExBasses
    \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 {
    \ChordNames
    \name SecondChords
    \alias ChordNames
    \override Rest.stencil = ##f
    alignAboveContext = #"oben"
  }

  \context {
    \Score
    \accepts SecondChords
    \accepts MyFingers
    \accepts BarNumberStaff
    \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.outside-staff-priority =#'()
    \override BarNumber.padding = #1
    \override BarNumber.font-size = #-1
    \override BarNumber.font-series = #'bold
    \override BarNumber.self-alignment-X = #0
    \override BarNumber.break-visibility = #end-of-line-invisible
  }
  \context {
    \Dynamics
    \override Hairpin.to-barline = ##f
    alignBelowContext = melodie
    \override TextSpanner.outside-staff-priority = ##f
    \override TextSpanner.padding = #'()
    \override DynamicText.outside-staff-priority = ##f
    \override DynamicText.padding = #4
  }
  \context {
    \RhythmicStaff
    \accepts MyFingers
    \consists Clef_engraver
    clefGlyph = #"clefs.percussion"
    clefPosition = #0
    printPartCombineTexts = ##f
    fontSize = #-1
    \override StaffSymbol.staff-space = #(magstep -1)
    \remove Ledger_line_engraver
    \override NoteColumn.before-line-breaking =
    #(lambda (grob)
       (let* ((pap-col (ly:grob-parent grob X))
              (pap-col-elts (ly:grob-object pap-col 'elements))
              (chord-names
               (if (ly:grob-array? pap-col-elts)
                   (filter
                    (lambda (elt)
                      (grob::has-interface elt 'chord-name-interface))
                    (ly:grob-array->list pap-col-elts))
                   '())))
         (for-each
          (lambda (chrd)
            (ly:grob-set-parent! chrd X grob))
          chord-names)))
  }
  \context {
    \StaffGroup
    \accepts SecondChords
    \accepts BarNumberStaff
  }
}

Akk = \chordmode {
  s2
}

cdur = \chordmode {
  c8 c:m g c:m
}

gsib =  \chordmode {
  g8 g:m7 d g:m7
}

csib =  \chordmode {
  c8 c:m7 g c:m7
}

vdur = \chordmode {
  f8 f:m c f:m
}


Bassi = \chordmode {
  \BassI
  \repeat volta 2 {
    \cdur \cdur
    \gsib \gsib
    \gsib \gsib
    \cdur \cdur
    \cdur \cdur
    \gsib \gsib
    \gsib \gsib
    c8 c:m g g:m7
    \cdur
  }

  \repeat volta 2 {
    \vdur \vdur
    \cdur \cdur
    \gsib \gsib
    \cdur \cdur
    \vdur \vdur
    \cdur \cdur
    \gsib \gsib
    c8 c:m g g:m7
    \cdur
  }
  \repeat volta 2 {
    \vdur \csib
    \vdur \vdur
    \csib
  }
  \alternative {
    {
      \csib \vdur \vdur
    }
    {
      \csib
      f8 f:m c c:m7
      \vdur
    }
  }
}

cdurx = {
  c,8 < c e g > g, q
}

gsibx = {
  g,8 < d h, f > d, q
}

csibx = {
 c8 < g e b > g, q
}

vdurx = {
  f,8 < f a, c > c, q
}

Massi =  {
  \key c \major
   \repeat volta 2 {
    \cdurx \cdurx
    \gsibx \gsibx
    \gsibx \gsibx
    \cdurx \cdurx
    \cdurx \cdurx
    \gsibx \gsibx
    \gsibx \gsibx
    c,8 < c e g > g, < d h, f >
    \cdurx
  }

  \repeat volta 2 {
    \vdurx \vdurx
    \cdurx \cdurx
    \gsibx \gsibx
    \cdurx \cdurx
    \vdurx \vdurx
    \cdurx \cdurx
    \gsibx \gsibx
    c,8 < c e g > g, < d h, f >
    \cdurx
  }
  \repeat volta 2 {
    \vdurx \csibx
    \vdurx \vdurx
    \csibx
  }
  \alternative {
    {
      \csibx \vdurx \vdurx
    }
    {
      \csibx
      f,8 < f a c > c < g e b >
      \vdurx
    }
  }
}

AccordionI= \relative c'' {
  \AkkI
  \key c \major
  \time 2/4
  \repeat volta 2 {
    g4 e8 c
    g'4 e8 c
    h4 d8 g h4 r8 g
    g4 f8 h,
    g'4 f8 h,
    c4 e8 g c4 r8 g
    g4 e8 c
    g'4 e8 c
    h4 d8 g h4 r8 g
    g4 f8 h,
    g'4 f8 h,
    c4 g'
    c8 r c r
  }
  \repeat volta 2 {
    a4 a8 a
    a4 h8 f
    e4 g8 c
    g4. e8
    f4 g8 h
    g4. f8
    e4 g8 c g2
    a4 a8 a
    a4 h8 f
    e4 g8 c
    g4. e8
    f4 g8 h
    g g a h
    c r h4
    c8 r c r
  }

  \key f \major
  \repeat volta 2 {
    f,4 g8 a
    b4 a8 b
    c4 f8 c
    a4. c8
    4 e8 c
  }
  \alternative {
    {
      b4. c8
      c4 f8 c
      a2
    }
    {
      b8 b c e
      f r e4
      f8 f16 f f4
    }
  }
}

midI =
{
  \override Script.direction = #DOWN

}

AccordionII = \relative c' {
  \AkkII
  \key c \major
  \repeat volta 2 {
    e4 c8 c
    e4 e8 c
    h4 h8 d g4 r8 h,
    h4 d8 g,
    h4 d8 g, c4 c8 e
    e4 r8 e
    e4 c8 c
    e4 c8 g
    h4 d8 h g'4 r8 h,
    h4 d8 g,
    h4 d8 h
    c4 f
    e8 r e r
  }
  \repeat volta 2 {
    f4 f
    f g8 d
    c4 e8 8
    e4. c8
    d4 f8 g
    f4. d8
    c4 e8 e e2
    f4 f
    f g8 d
    c4 e8 8
    e4. c8
    d4 f8 g
    f f f g
    e r f4
    e8 r e r
  }
  \key f \major
  \repeat volta 2 {
    f4 e8 f
    g4 f8 g
    a4 8 8
    f4. a8
    b4 c8 b
  }
  \alternative {
    {
      g4. b8
      a4 a8 a
      f2
    }
    {
      g8 g c b
      a r b4
      a8 a16 a a4
    }
  }
}

midII =
{
  \override Script.direction = #DOWN

}

Struktur = {
  %\override Score.NonMusicalPaperColumn.page-break-permission = ##f
  %\override Score.SpacingSpanner.common-shortest-duration = #(ly:make-moment 1/6)
  %\override NonMusicalPaperColumn.line-break-permission = ##f

}

kopf=\header {
  title = \markup \line
  {
    #myTitel
  }
  subtitle = ##f
  subsubtitle = ##f
  poet = ##f
  composer = \markup { #mycomp }
  piece = ##f
  opus = ##f
}

\paper {
  top-margin = 0\mm
  ragged-right = ##f
  ragged-last = ##f
  ragged-bottom = ##t
  ragged-last-bottom = ##f
  bottom-margin = 20\mm
  indent = #0
  line-width = 170\mm
  print-all-headers = ##f
  #(include-special-characters)
  print-first-page-number = ##t
  first-page-number = #1
  oddFooterMarkup = ##f
  evenFooterMarkup = ##f
  oddHeaderMarkup = #oddFooterMarkup
  evenHeaderMarkup = #evenFooterMarkup
  top-markup-spacing.padding = #20
  top-system-spacing.padding = #10
}

zzz =
\bookpart {
  \kopf
  \score {
    \new StaffGroup
    <<
      %\override StaffGroup.VerticalAxisGroup.staff-staff-spacing.basic-distance = #12
      \new Staff \new Voice \AccordionI
      \new Staff \new Voice \AccordionII

      \new ChordNames="oben"
      {
        \override Rest.stencil = ##f
        \Bassi
      }
      \new SecondChords
      <<
        \Akk
      >>
      \new RhythmicStaff
      <<
        \new Voice
        {
          \stemDown
          \override Rest.staff-position = #0
          \override Dots.staff-position = #0
          \override Beam.staff-position = #0
          \override NoteHead.staff-position = #0
          \firstNote \Bassi
        }
        \new NullVoice \Struktur
      >>
    >>
  }
}

alle=
\score {
  \new StaffGroup
  \unfoldRepeats
  <<
    \new Staff {
      <<
        \new Voice {
          \set Staff.midiInstrument = "concertina"
          \AccordionI
        }
        \context Voice {
          \midI
        }
      >>
    }
    \new Staff {
      <<
        \set Staff.midiInstrument = "accordion"
        \set Staff.midiMaximumVolume = #0.6
        \new Voice {

          \AccordionII
        }
        \context Voice
        {
          \midII
        }
      >>
    }
    \new Staff {
      \set Staff.midiInstrument = "acoustic bass"
      \time 2/4
      \clef bass
      \Massi
    }
  >>
}

aI =
\score {
  \new StaffGroup
  \unfoldRepeats
  <<
    \new Staff {
      <<
        \new Voice {
          \set Staff.midiInstrument = "concertina"
          s2 * 4 \AccordionI
        }
        \context Voice {
          s2 * 4 \midI
        }
      >>
    }
    \new Staff {
      \set Staff.midiInstrument = "acoustic bass"
      \time 2/4
      \clef bass
      \Massi
    }
  >>
}

aII =
\score {
  \new StaffGroup
  \unfoldRepeats
  <<
    \new Staff {
      <<
        \set Staff.midiInstrument = "accordion"
        \set Staff.midiMaximumVolume = #0.6
        \new Voice {
          s2 * 4
          \AccordionII
        }
        \context Voice
        {
          s2 * 4 \midII
        }
      >>
    }
    \new Staff {
      \set Staff.midiInstrument = "harmonica"
      \time 2/4
      \clef bass
      \Massi
    }
  >>
}

\make-midi-list "sau"    \alle #'(108 112 120