Akkordeon Diskantregister

Zur Navigation springen Zur Suche springen

Eine Liste von möglichen Registern

Änderung von 2.21 auf 2.22
#(use-modules (scm accreg))  %% bis Version 2.21
#(use-modules (lily accreg)) %% ab  Version 2.22
\version "2.22.0"
\language "deutsch"

#(use-modules (scm accreg))
#(use-modules (ice-9 regex))

\markuplist \fontsize #2 {
  \override #'(padding . 5)
  \override #'(baseline-skip . 3)
  \table
  #'(-1 -1)
  {
    "\discant #\"1\"" \discant #"1"
    "\discant #\"1+0\"" \discant #"1+0"
    "\discant #\"10\"" \discant #"10"
    "\discant #\"1-0\"" \discant #"1-0"
    "\discant #\"11\"" \discant #"11"
    "\discant #\"101\"" \discant #"101"
    "\discant #\"20\"" \discant #"20"
    "\discant #\"2+0\"" \discant #"2+0"
    "\discant #\"2-0\"" \discant #"2-0"
    "\discant #\"120\"" \discant #"120"
    "\discant #\"21\"" \discant #"21"
    "\discant #\"121\"" \discant #"121"
    "\discant #\"30\"" \discant #"30"
    "\discant #\"31\"" \discant #"31"
    "\discant #\"131\"" \discant #"131"
    "\discant #\"111\"" \discant #"111"
    "\discant #\"120\"" \discant #"120"
    "\discant #\"130\"" \discant #"130"
  }
}
#(use-modules (lily accreg))
#(use-modules (ice-9 regex))

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

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 e g b>1-\markup { "7" }
  <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
gRootc = \set ChordNames.chordRootNamer = #note-name->german-underlined-markup
gRootu = \unset ChordNames.chordRootNamer

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
  < c es f >1-\markup { \super 7 \hspace #-0.5 "+" }
}

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

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

myBlue = #(x11-color 'sienna4)

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

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

myOttava =
#(define-music-function (o) (integer?)
   (let ((text (case o
                 ((0) #f)
                 ((1 -1) "8")
                 ((2 -2) "15"))))
     #{
       \ottava #o
       \set Staff.ottavation = #text
     #}))

myStaff =
#(define-music-function (nummer)
   (markup?)
   #{
     \set Staff.shortInstrumentName = \markup \concat { \caps "Akk " $nummer }
     \set Staff.instrumentName = \markup \concat
     { \caps "Akkordeon " $nummer }
   #}
   )

pullNoteHead =
#(define-music-function
  () ()
  #{
    \once\override NoteHead.stencil =
    #(lambda (grob)
       (grob-interpret-markup grob
         #{
           \markup \path #.5 #'((moveto 2 0)
                                (lineto 0 0)
                                (lineto 0 -3)
                                )
         #}))
    \once\omit Stem
  #})

pushNoteHead =
#(define-music-function
  () ()
  #{
    \once\override NoteHead.stencil =
    #(lambda (grob)
       (grob-interpret-markup grob
         #{
           \markup \path #.5 #'((moveto -2 0)
                                (lineto 0 0)
                                (lineto 0 -3)
                                )
         #}))
    \once\omit Stem
  #})

addParenthesizedNumber =
#(define-music-function (number)(number?)
   #{
     \override Score.BarNumber.before-line-breaking =
     #(add-parenthesized-number number)
   #})

compressFullBarRests = #compressEmptyMeasures

staffSize =
#(define-music-function (new-size) (number?)
   #{
     \set fontSize = #new-size
     %\magnifyStaff #new-size
     \override StaffSymbol.staff-space = #(magstep new-size)
     \override StaffSymbol.thickness = #(magstep new-size)
   #})

pull = \markup \path #.5 #'((moveto 2 0)
                            (lineto 0 0)
                            (lineto 0 -3)
                            )

push = \markup \path #.5 #'((moveto -2 0)
                            (lineto 0 0)
                            (lineto 0 -3)
                            )

#(define (add-parenthesized-number number)
   (lambda (grob)
     (ly:grob-set-property! grob 'self-alignment-X CENTER)
     (ly:grob-set-property! grob 'text
       #{
         \markup \halign #CENTER {
           #(ly:grob-property grob 'text)
           \override #'(padding . 0)
           \parenthesize
           #(number->string
             (+ number
               (string->number
                (markup->string (ly:grob-property grob 'text)))))
         }
       #})))

hairpinWithCenteredText =
#(define-music-function (text) (markup?)
   #{
     \once \override Voice.Hairpin.after-line-breaking =
     #(lambda (grob)
        (let* ((stencil (ly:hairpin::print grob))
               (par-y (ly:grob-parent grob Y))
               (dir (ly:grob-property par-y 'direction))
               (staff-line-thickness
                (ly:output-def-lookup (ly:grob-layout grob) 'line-thickness))
               (new-stencil (ly:stencil-aligned-to
                             (ly:stencil-combine-at-edge
                              (ly:stencil-aligned-to stencil X CENTER)
                              Y dir
                              (ly:stencil-aligned-to
                               (grob-interpret-markup
                                grob
                                (make-fontsize-markup
                                 (magnification->font-size
                                  (+ (ly:staff-symbol-staff-space grob)
                                    (/ staff-line-thickness 2)))
                                 text)) X CENTER))
                             X LEFT))
               (staff-space (ly:output-def-lookup
                             (ly:grob-layout grob) 'staff-space))
               (par-x (ly:grob-parent grob X))
               (dyn-text (grob::has-interface par-x 'dynamic-text-interface))
               (dyn-text-stencil-x-length
                (if dyn-text
                    (interval-length
                     (ly:stencil-extent (ly:grob-property par-x 'stencil) X))
                    0))
               (x-shift
                (if dyn-text
                    (-
                     (+ staff-space dyn-text-stencil-x-length)
                     (* 0.5 staff-line-thickness)) 0)))

          (ly:grob-set-property! grob 'Y-offset 0)
          (ly:grob-set-property! grob 'stencil
            (ly:stencil-translate-axis
             new-stencil
             x-shift X))))
   #})

#(define-markup-command (ezscore layout props mus) (ly:music?)
   #:properties ((size -2))
   (interpret-markup layout props
     #{
       \markup {
         \score {
           \new RhythmicStaff { \stemUp $mus }
           \layout {
             \context {
               \RhythmicStaff
               \remove Clef_engraver
               \remove Time_signature_engraver
               \omit StaffSymbol
               fontSize = #size
               \override StaffSymbol.staff-space = #(magstep size)
               \override StaffSymbol.thickness = #(magstep size)
             }
             \context {
               \Score
               \override SpacingSpanner.base-shortest-duration = #(ly:make-moment 1/1)
             }
             indent = 0
             ragged-last = ##t
             ragged-right = ##t
             line-width = 7
           }
         }
       }
     #}))

#(define-markup-command (dashed-full-line layout props)
   ()
   #:category graphic
   #:properties ((thickness 1)
                 (on .4)
                 (off .4)
                 (phase 0)
                 (line-width)
                 (full-length #t))
   ;A dashed line full horizontal width, no parameters
   ;derived from draw-dashed-line

   (let* ((line-thickness (ly:output-def-lookup layout 'line-thickness))
          (line-width (ly:output-def-lookup layout 'line-width))
          ;; Calculate the thickness to be used.
          (th (* line-thickness thickness))
          (half-thick (/ th 2))
          ;; Get the extensions in x- and y-direction. x=line width, y=0
          (x line-width)
          (y 0)
          ;; Calculate the length of the dashed line.
          (line-length line-width))

     (if (and full-length (not (= (+ on off) 0)))
         (begin
          ;; Add double-thickness to avoid overlapping.
          (set! off (+ (* 2 th) off))
          (let* (;; Make a guess how often the off/on-pair should be printed
                  ;; after the initial `on´.
                  ;; Assume a minimum of 1 to avoid division by zero.
                  (guess (max 1 (round (/ (- line-length on) (+ off on)))))
                  ;; Not sure about the value or why corr is necessary at all,
                  ;; but it seems to be necessary.
                  (corr (if (= on 0)
                            (/ line-thickness 10)
                            0))
                  ;; Calculate a new value for off to fit the
                  ;; line-length.
                  (new-off (/ (- line-length corr (* (1+ guess) on)) guess))
                  )
            (cond

             ;; Settings for (= on 0). Resulting in a dotted line.

             ;; If line-length isn't shorter than `th´, change the given
             ;; value for `off´ to fit the line-length.
             ((and (= on 0) (< th line-length))
              (set! off new-off))

             ;; If the line-length is shorter than `th´, it makes no
             ;; sense to adjust `off´. The rounded edges of the lines
             ;; would prevent any nice output.
             ;; Do nothing.
             ;; This will result in a single dot for very short lines.
             ((and (= on 0) (>= th line-length))
              #f)

             ;; Settings for (not (= on 0)). Resulting in a dashed line.

             ;; If line-length isn't shorter than one go of on-off-on,
             ;; change the given value for `off´ to fit the line-length.
             ((< (+ (* 2 on) off) line-length)
              (set! off new-off))
             ;; If the line-length is too short, but greater than
             ;; (* 4 th) set on/off to (/ line-length 3)
             ((< (* 4 th) line-length)
              (set! on (/ line-length 3))
              (set! off (/ line-length 3)))
             ;; If the line-length is shorter than (* 4 th), it makes
             ;; no sense trying to adjust on/off. The rounded edges of
             ;; the lines would prevent any nice output.
             ;; Simply set `on´ to line-length.
             (else
              (set! on line-length))))))

     ;; If `on´ or `off´ is negative, or the sum of `on' and `off' equals zero a
     ;; ghostscript-error occurs while calling
     ;; (ly:make-stencil (list 'dashed-line th on off x y phase) x-ext y-ext)
     ;; Better be paranoid.
     (if (or (= (+ on off) 0)
             (negative? on)
             (negative? off))
         (begin
          (ly:warning (_ "Can't print a line - setting on/off to default"))
          (set! on 1)
          (set! off 1)))

     ;; To give the lines produced by \draw-line and \draw-dashed-line the same
     ;; length, half-thick has to be added to the stencil-extensions.
     (ly:make-stencil
      (list 'dashed-line th on off x y phase)
      (interval-widen (ordered-cons 0 x) half-thick)
      (interval-widen (ordered-cons 0 y) half-thick))))

nachschlag = \markup \score
{
  \new RhythmicStaff {
    \relative {
      r4 c c
    }
  }
  \layout {
    \context {
      \RhythmicStaff
      \remove Clef_engraver
      \remove Time_signature_engraver
      %\omit StaffSymbol
      fontSize = #-1
      \override StaffSymbol.staff-space = #(magstep -1)
      \override StaffSymbol.thickness = #(magstep -1)
    }
    indent = 0
    ragged-right = ##t
  }
}

ZugDruck = \markup \concat \vcenter { "Zug:  " \pull "   Druck: " \push }
oob = { \once \override Score.BarNumber.stencil = ##f \bar "" }
bnf = \once \override Score.BarNumber.stencil = ##f

zwei=\markup \ezscore ##{ { c8[ c] } #}
drei=\markup \ezscore ##{ \tuplet 3/2 { c4 c8 } #}
swing = \markup \concat { \zwei " = " \drei }

twGrau = #(define-music-function (myNotes)
            (ly:music?)
            #{
              \tweak font-size #-2
              \tweak color #grey
              $myNotes
            #})

twF = #(define-music-function (myNotes)
         (ly:music?)
         #{
           \tweak font-size #-2 $myNotes
         #})
\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")
    \RemoveEmptyStaves
  }
  \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 UpperChords
    \override ChordName.self-alignment-X = #LEFT
    chordNameLowercaseMinor = ##f
    \alias ChordNames
    \override Rest.stencil = ##f
    chordChanges = ##f
    chordNameLowercaseMinor = ##f
    chordNameExceptions = #chExceptions
    chordRootNamer = #germanChords
    %majorSevenSymbol = \markup { maj7 }
    \override ChordName.font-name = #"Orator10 BT"
    \override ChordName.font-size = #-0.2
    chordNoteNamer = #(chord-name->german-markup #f)
    noChordSymbol = ##f % \markup { \musicglyph #"rests.2" } % ##f
    alignAboveContext = #"melodie"
  }
  \context {
    \ChordNames
    \name SecondChords
    \alias ChordNames
    \override Rest.stencil = ##f
    alignAboveContext = #"oben"
  }
  \context {
    \Score
    \accepts SecondChords
    \accepts BarNumberStaff
    \accepts UpperChords
    \override VerticalAxisGroup.remove-first = ##t
    \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.after-line-breaking = ##f   %BarNumer wird dadurch am 1. Staff ausgerichtet
    \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
    skipBars = ##t
  }
  \context {
    \Lyrics
    \override VerticalAxisGroup.staff-affinity = #CENTER
    \override LyricText.font-name = "Minion pro"
    \override LyricText.font-size = #-0.3
  }
  \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
    \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
    \accepts UpperChords
  }
}

Links