2023-07-22 22:07:57 +02:00
|
|
|
% Akkorde können auch geklammert sein
|
|
|
|
#(define (parenthesis-ignatzek-chord-names in-pitches bass inversion context)
|
|
|
|
(markup #:line ( "(" (ignatzek-chord-names in-pitches bass inversion context) ")" )))
|
|
|
|
klamm = #(define-music-function (parser location chords) (ly:music?)
|
|
|
|
#{
|
|
|
|
\set chordNameFunction = #parenthesis-ignatzek-chord-names
|
|
|
|
$chords
|
|
|
|
\set chordNameFunction = #ignatzek-chord-names
|
|
|
|
#})
|
|
|
|
|
2023-09-18 18:08:33 +02:00
|
|
|
repeats-around-chords =
|
|
|
|
#(define-music-function (parser location chords) (ly:music?)
|
|
|
|
#{
|
|
|
|
\once \set noChordSymbol = \markup { \normal-text \repStart }
|
|
|
|
r4
|
|
|
|
$chords
|
|
|
|
\once \set noChordSymbol = \markup { \normal-text \repStop }
|
|
|
|
r4
|
|
|
|
#})
|
|
|
|
|
2023-07-22 22:07:57 +02:00
|
|
|
bchord =
|
|
|
|
#(define-music-function (parser location chords) (ly:music?)
|
|
|
|
#{
|
|
|
|
\override ChordName.font-series = #'bold
|
|
|
|
$chords
|
|
|
|
\revert ChordName.font-series
|
|
|
|
#})
|
|
|
|
|
2023-08-10 09:39:07 +02:00
|
|
|
shiftChord = #(define-music-function (parser location xshift chord) (number? ly:music?)
|
|
|
|
#{
|
|
|
|
\once \override ChordName.extra-offset = #`(,xshift . 0)
|
|
|
|
$chord
|
|
|
|
#})
|
|
|
|
|
2024-02-16 20:00:10 +01:00
|
|
|
shiftChords = #(define-music-function (parser location xshift chords) (number? ly:music?)
|
|
|
|
#{
|
|
|
|
\override ChordName.extra-offset = #`(,xshift . 0)
|
|
|
|
$chords
|
|
|
|
#})
|
|
|
|
|
2024-09-04 09:39:57 +02:00
|
|
|
altChord = #(define-music-function (parser location mainchord altchord) (ly:music? ly:music?)
|
|
|
|
(define (chord-namer in-pitches bass inversion context)
|
|
|
|
#{
|
|
|
|
\markup {
|
|
|
|
\translate #'(-0.5 . 0)
|
|
|
|
\score {
|
|
|
|
\chords { #mainchord \klamm #altchord }
|
|
|
|
\layout {
|
|
|
|
\LAYOUT
|
|
|
|
\context {
|
|
|
|
\ChordNames
|
|
|
|
\override ChordName.extra-spacing-width = #'(0 . 0.3)
|
|
|
|
}
|
|
|
|
\context {
|
|
|
|
\Score
|
|
|
|
\override SpacingSpanner.spacing-increment = 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#})
|
|
|
|
#{
|
|
|
|
\once \set chordNameFunction = #chord-namer
|
|
|
|
#mainchord
|
|
|
|
#})
|
|
|
|
|
2023-07-22 22:07:57 +02:00
|
|
|
% kleine Mollakkorde und Alteration ausgeschrieben
|
|
|
|
#(define (note-name->german-markup-nosym pitch lowercase?)
|
|
|
|
(define (pitch-alteration-semitones pitch) (inexact->exact (round (* (ly:pitch-alteration pitch) 2))))
|
|
|
|
(define (accidental->markup alteration name)
|
|
|
|
(if (= alteration 0)
|
|
|
|
(make-line-markup (list empty-markup))
|
|
|
|
(if (= alteration FLAT)
|
|
|
|
(if (equal? name "B")
|
|
|
|
""
|
|
|
|
; (make-line-markup (list (make-hspace-markup 0.2)
|
|
|
|
; (make-tiny-markup (make-raise-markup 1.2
|
|
|
|
; (make-musicglyph-markup (assoc-get alteration standard-alteration-glyph-name-alist ""))))
|
|
|
|
; ))
|
|
|
|
(if (or (equal? name "E") (equal? name "A")) "s" "es"))
|
|
|
|
"is")
|
|
|
|
))
|
|
|
|
(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 . -2)))
|
|
|
|
(cons 7 (+ 0 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?))
|
|
|
|
(accidental->markup (/ (cdr n-a) 2) (vector-ref #("C" "D" "E" "F" "G" "A" "H" "B") (car n-a)) ))))
|
|
|
|
)
|
|
|
|
|
|
|
|
% additional bass notes should get uppercased
|
|
|
|
#(define (bassnote-name->german-markup-nosym pitch lowercase?)(note-name->german-markup-nosym pitch #f))
|
|
|
|
|
2023-07-24 08:39:30 +02:00
|
|
|
|
|
|
|
#(define chordNameExceptions
|
|
|
|
(if (defined? 'customChordPrintings)
|
|
|
|
(sequential-music-to-chord-exceptions customChordPrintings #t)
|
|
|
|
'()))
|
|
|
|
|
2023-07-22 22:07:57 +02:00
|
|
|
generalLayout = \layout {
|
|
|
|
\generalLayout
|
|
|
|
\context {
|
|
|
|
\ChordNames
|
|
|
|
\semiGermanChords
|
|
|
|
\override ChordName.font-size = \songScoreChordFontSize
|
|
|
|
\override ChordName.font-series = \songChordFontSeries
|
2023-10-28 09:34:26 +02:00
|
|
|
\override ChordName.font-family = #'serif
|
2023-07-22 22:07:57 +02:00
|
|
|
chordNameLowercaseMinor = ##t
|
|
|
|
chordChanges = ##t
|
|
|
|
% eigenen chordRootNamer damit F# = Fis und Gb = Ges (also alteration ausgeschrieben)
|
|
|
|
chordRootNamer = #note-name->german-markup-nosym
|
|
|
|
chordNoteNamer = #bassnote-name->german-markup-nosym
|
|
|
|
majorSevenSymbol = "maj7"
|
2023-07-24 08:39:30 +02:00
|
|
|
chordNameExceptions = \chordNameExceptions
|
2023-07-22 22:07:57 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
% Akkord mit Bunddiagramm anzeigen
|
|
|
|
#(define-markup-command (fret-chord layout props fret chord) (string? string?)
|
|
|
|
(interpret-markup layout props
|
|
|
|
#{ \markup { \override #'(baseline-skip . 2)
|
|
|
|
\center-column {
|
2023-11-22 15:28:31 +01:00
|
|
|
\score { \new ChordNames {
|
|
|
|
#(ly:parser-include-string (string-append "\\chordmode { s4 " chord " }"))
|
|
|
|
} \layout { \generalLayout } }
|
|
|
|
\override #'(fret-diagram-details . ((barre-type . straight))) {
|
|
|
|
\fret-diagram-terse #fret
|
2023-07-22 22:07:57 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#}))
|
2024-11-02 19:51:10 +01:00
|
|
|
|
|
|
|
% If you add this engraver to ChordNames Context chords get only printed on chordchanges and not at newline.
|
|
|
|
% See https://lists.gnu.org/archive/html/lilypond-user/2020-07/msg00187.html
|
|
|
|
Ignoring_newline_chord_changes_engraver =
|
|
|
|
#(lambda (ctx)
|
|
|
|
(let* ((chord #f)
|
|
|
|
(last-chord #f))
|
|
|
|
|
|
|
|
(define (at-line-beginning? grob)
|
|
|
|
(let* ((col (ly:item-get-column grob))
|
|
|
|
(ln (ly:grob-object col 'left-neighbor))
|
|
|
|
(col-to-check (if (ly:grob? ln) ln col)))
|
|
|
|
(and (eq? #t (ly:grob-property col-to-check 'non-musical))
|
|
|
|
(= 1 (ly:item-break-dir col-to-check)))))
|
|
|
|
|
|
|
|
(make-engraver
|
|
|
|
(acknowledgers
|
|
|
|
((chord-name-interface this-engraver grob source-engraver)
|
|
|
|
|
|
|
|
(if chord
|
|
|
|
(begin
|
|
|
|
(set! last-chord chord)
|
|
|
|
(set! chord #f)))
|
|
|
|
|
|
|
|
(set! chord (ly:grob-property grob 'text))
|
|
|
|
|
|
|
|
;; If two subsequent chords are equal and chordChanges is enabled,
|
|
|
|
;; set 'after-line-breaking to a procedure which sets the stencil
|
|
|
|
;; to an empty-stencil if the new chord is at line-start.
|
|
|
|
(if (and (equal? chord last-chord)
|
|
|
|
(ly:context-property ctx 'chordChanges #f))
|
|
|
|
(ly:grob-set-property! grob 'after-line-breaking
|
|
|
|
(lambda (grob)
|
|
|
|
(if (at-line-beginning? grob)
|
|
|
|
(ly:grob-set-property! grob 'stencil empty-stencil))
|
|
|
|
;; keep default
|
|
|
|
(ly:chord-name::after-line-breaking grob))))))
|
|
|
|
((finalize this-engraver)
|
|
|
|
;; house keeping
|
|
|
|
(set! chord #f)
|
|
|
|
(set! last-chord #f)))))
|