User:Akkordeonnoten/incl.ly

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
#(use-modules (scm accreg))
myBlue = #(x11-color 'sienna4)

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

AkkI = {
  \set Staff.shortInstrumentName = \markup \caps "Akk. I"
  \set Staff.instrumentName = \markup \caps "Akkordeon I"
}
AkkII = {
  \set Staff.shortInstrumentName = \markup \caps "Akk. II"
  \set Staff.instrumentName = \markup \caps "Akkordeon II"
}
AkkIII = {
  \set Staff.shortInstrumentName = \markup \caps "Akk. III"
  \set Staff.instrumentName = \markup \caps "Akkordeon III"
}
AkkIV = {
  \set Staff.shortInstrumentName = \markup \caps "Akk. IV"
  \set Staff.instrumentName = \markup \caps "Akkordeon IV"
}
AkkV = {
  \set Staff.shortInstrumentName = \markup \caps "Akk. V"
  \set Staff.instrumentName = \markup \caps "Akkordeon V"
}
AkkVI = {
  \set Staff.shortInstrumentName = \markup \caps "Akk. VI"
  \set Staff.instrumentName = \markup \caps "Akkordeon VI"
}
AkkVII = {
  \set Staff.shortInstrumentName = \markup \caps "Akk. VII"
  \set Staff.instrumentName = \markup \caps "Akkordeon VII"
}

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

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 grosseSchrift 1)  %% Schrifttext vergrößern wegen besserer Lesbarkeit

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

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

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
}

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

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

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% deutsche Akkordbezeichnungen
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

#(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->german-underlined-markup pitch lowercase?)
   (make-underline-markup
    (make-line-markup
     (list
      ((chord-name->german-markup-text-alteration #t) pitch lowercase?)))))

#(define ((chord-name->my-german-markup-text-alteration) 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))
          ;; The following condition is weird. Though, we let them in to ease
          ;; comporability with the original.
          (n-a (cond ((member (cons name alt-semitones) `((6 . -1) (6 . -1)))
                      (cons 7 alt-semitones))
                 (else (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 (= 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 myGermanChords (chord-name->my-german-markup-text-alteration))

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

myLayoutOne =
\layout {
  \context {
    \ChordNames
    %chordRootNamer = #(chord-name->my-german-markup #t)
    chordNoteNamer = #note-name->german-markup
  }
}

%% extrahiert aus einem Akkord die oberste Note
%% wird zum Erzeugen des Rhythmus gebraucht
firstNote =
#(define-music-function (music )
   (ly:music?)
   (event-chord-reduce music))