Compare commits
3 Commits
7f7cac99f4
...
5884ab9d2c
Author | SHA1 | Date | |
---|---|---|---|
5884ab9d2c | |||
199f515be9 | |||
8c7386807b |
@ -100,6 +100,15 @@ generalLayout = \layout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#(define-public (custom-lyric-text::print grob)
|
||||||
|
"Allow interpretation of tildes as lyric tieing marks."
|
||||||
|
;; See also similar code in Lyric_performer.
|
||||||
|
(let ((text (ly:grob-property grob 'text)))
|
||||||
|
|
||||||
|
(grob-interpret-markup grob (if (string? text)
|
||||||
|
(make-pad-right-markup -0.1 (make-tied-lyric-markup text))
|
||||||
|
text))))
|
||||||
|
|
||||||
lyricsWithChordsLayout = \layout {
|
lyricsWithChordsLayout = \layout {
|
||||||
\generalLayout
|
\generalLayout
|
||||||
\context {
|
\context {
|
||||||
@ -108,14 +117,16 @@ lyricsWithChordsLayout = \layout {
|
|||||||
}
|
}
|
||||||
\context {
|
\context {
|
||||||
\Lyrics
|
\Lyrics
|
||||||
\override VerticalAxisGroup.nonstaff-relatedstaff-spacing.basic-distance = 0
|
\override VerticalAxisGroup.nonstaff-relatedstaff-spacing.basic-distance = #(- (- songTextLineHeigth songTextChordFontSize) 1)
|
||||||
\override LyricText.parent-alignment-X = #LEFT
|
\override LyricText.parent-alignment-X = #LEFT
|
||||||
\override LyricText.self-alignment-X = #LEFT
|
\override LyricText.self-alignment-X = #LEFT
|
||||||
\override LyricText.word-space = 0.8
|
\override LyricText.word-space = 0.8
|
||||||
\override LyricSpace.minimum-distance = 0.8
|
\override LyricSpace.minimum-distance = 0.8
|
||||||
|
\override LyricText.stencil = #custom-lyric-text::print
|
||||||
}
|
}
|
||||||
\context {
|
\context {
|
||||||
\Score
|
\Score
|
||||||
|
\override PaperColumn.keep-inside-line = ##f
|
||||||
\override SpacingSpanner.uniform-stretching = ##t
|
\override SpacingSpanner.uniform-stretching = ##t
|
||||||
\override SpacingSpanner.spacing-increment = 0
|
\override SpacingSpanner.spacing-increment = 0
|
||||||
\remove Bar_number_engraver
|
\remove Bar_number_engraver
|
||||||
|
@ -3,6 +3,11 @@
|
|||||||
composerPrefix = "Weise:"
|
composerPrefix = "Weise:"
|
||||||
compositionPrefix = "Satz:"
|
compositionPrefix = "Satz:"
|
||||||
poetAndComposerEqualPrefix = "Worte und Weise:"
|
poetAndComposerEqualPrefix = "Worte und Weise:"
|
||||||
|
voicePrefix = "Stimme:"
|
||||||
|
versePrefix = "Strophe:"
|
||||||
|
translationPrefix = "Übersetzung:"
|
||||||
|
interludePrefix = "Zwischenspiel:"
|
||||||
|
bridgePrefix = "Bridge:"
|
||||||
|
|
||||||
authorFormat =
|
authorFormat =
|
||||||
#(lambda (noDetails name trail_name birth_year death_year organization)
|
#(lambda (noDetails name trail_name birth_year death_year organization)
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#(use-modules (ice-9 receive))
|
||||||
#(define-markup-command (print-songinfo layout props) ()
|
#(define-markup-command (print-songinfo layout props) ()
|
||||||
(define (songinfo-from songId key)
|
(define (songinfo-from songId key)
|
||||||
(let ((song (if (defined? 'SONG_DATA) (assoc-ref SONG_DATA songId) #f)))
|
(let ((song (if (defined? 'SONG_DATA) (assoc-ref SONG_DATA songId) #f)))
|
||||||
@ -39,40 +40,108 @@
|
|||||||
)) authors)
|
)) authors)
|
||||||
)
|
)
|
||||||
|
|
||||||
(define (render-contribution-numbers contributionNumbers)
|
(define (numbered-contribution-prefix contributionNumbers prefixLookup)
|
||||||
(string-join (map (lambda (contributionNumber) (ly:format "~a." contributionNumber)) contributionNumbers) ", ")
|
(string-append
|
||||||
)
|
(string-join (map (lambda (contributionNumber) (ly:format "~a." contributionNumber)) contributionNumbers) ", ")
|
||||||
(define (render-verse-contribution contributionNumbers)
|
" "
|
||||||
(string-append (render-contribution-numbers contributionNumbers) " Strophe: ")
|
(ly:output-def-lookup layout prefixLookup)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
(define (render-voice-contribution contributionNumbers)
|
(define referencedAuthors '())
|
||||||
(string-append (render-contribution-numbers contributionNumbers) " Stimme: ")
|
|
||||||
|
(define (format-authors authorIds)
|
||||||
|
(map (lambda (authorId)
|
||||||
|
(format-author
|
||||||
|
authorId
|
||||||
|
(if (member authorId referencedAuthors)
|
||||||
|
#t
|
||||||
|
(begin
|
||||||
|
(set! referencedAuthors (cons authorId referencedAuthors))
|
||||||
|
#f)))
|
||||||
|
) authorIds)
|
||||||
|
)
|
||||||
|
|
||||||
|
(define (render-contribution-group contributionPrefix authorIds)
|
||||||
|
(if (null? authorIds)
|
||||||
|
""
|
||||||
|
(string-append contributionPrefix " " (string-join (format-authors authorIds) ", ")))
|
||||||
|
)
|
||||||
|
|
||||||
|
(define (render-partial-contribution-group prefixLookup authorData)
|
||||||
|
(if (null? authorData)
|
||||||
|
""
|
||||||
|
(let ((firstAuthorContributions (cdar authorData)))
|
||||||
|
(receive (authorDataSame authorDataOther)
|
||||||
|
(partition (lambda (authorEntry) (equal? (cdr authorEntry) firstAuthorContributions)) authorData)
|
||||||
|
(string-append
|
||||||
|
(render-contribution-group (numbered-contribution-prefix firstAuthorContributions prefixLookup) (map car authorDataSame))
|
||||||
|
" "
|
||||||
|
(render-partial-contribution-group prefixLookup authorDataOther)
|
||||||
|
))))
|
||||||
|
)
|
||||||
|
|
||||||
|
(define (join-present items joiner)
|
||||||
|
(string-join (filter (lambda (item) (and (string? item) (not (string-null? (string-trim-both item))))) items) joiner)
|
||||||
)
|
)
|
||||||
|
|
||||||
(define (poet-and-composer-from-authors authors)
|
(define (poet-and-composer-from-authors authors)
|
||||||
(if authors
|
(if authors
|
||||||
(let* (
|
(let (
|
||||||
(poetIds (find-author-ids-by 'text authors))
|
(poetIds (find-author-ids-by 'text authors))
|
||||||
|
(translatorIds (find-author-ids-by 'translation authors))
|
||||||
(versePoetData (find-author-id-with-part-numbers 'verse authors))
|
(versePoetData (find-author-id-with-part-numbers 'verse authors))
|
||||||
(allPoetIds (append poetIds (map car versePoetData)))
|
|
||||||
(composerIds (find-author-ids-by 'melody authors))
|
(composerIds (find-author-ids-by 'melody authors))
|
||||||
(compositionIds (find-author-ids-by 'composition authors))
|
(verseComposerData (find-author-id-with-part-numbers 'meloverse authors))
|
||||||
(voiceComposerData (find-author-id-with-part-numbers 'voice authors))
|
(voiceComposerData (find-author-id-with-part-numbers 'voice authors))
|
||||||
(poets (append
|
(compositionIds (find-author-ids-by 'composition authors))
|
||||||
(map (lambda (poetId) (format-author poetId #f)) poetIds)
|
(bridgeIds (find-author-ids-by 'bridge authors))
|
||||||
(map (lambda (versePoetEntry) (string-append (render-verse-contribution (cdr versePoetEntry)) (format-author (car versePoetEntry) (member (car versePoetEntry) poetIds)))) versePoetData)
|
(interludeIds (find-author-ids-by 'interlude authors))
|
||||||
))
|
(year_text (chain-assoc-get 'header:year_text props #f))
|
||||||
(composers (append
|
(year_translation (chain-assoc-get 'header:year_translation props #f))
|
||||||
(map (lambda (composerId) (format-author composerId (member composerId allPoetIds))) composerIds)
|
(year_melody (chain-assoc-get 'header:year_melody props #f))
|
||||||
(map (lambda (composerId) (string-append (ly:output-def-lookup layout 'compositionPrefix) " " (format-author composerId (member composerId allPoetIds)))) compositionIds)
|
(year_composition (chain-assoc-get 'header:year_composition props #f))
|
||||||
(map (lambda (voiceComposerEntry) (string-append (render-voice-contribution (cdr voiceComposerEntry)) (format-author (car voiceComposerEntry) (member (car voiceComposerEntry) allPoetIds)))) voiceComposerData)
|
)
|
||||||
)))
|
(if (and (equal? poetIds composerIds) (null? translatorIds) (null? versePoetData) (null? verseComposerData) (null? voiceComposerData) (null? compositionIds) (null? bridgeIds) (null? interludeIds))
|
||||||
(if (and (equal? poetIds composerIds) (null? versePoetData) (null? voiceComposerData) (null? compositionIds))
|
|
||||||
(list (string-append (ly:output-def-lookup layout 'poetAndComposerEqualPrefix) " " (string-join poets ", ")) #f)
|
|
||||||
(list
|
(list
|
||||||
(string-append (ly:output-def-lookup layout 'poetPrefix) " " (string-join poets ", "))
|
(render-contribution-group (ly:output-def-lookup layout 'poetAndComposerEqualPrefix) poetIds)
|
||||||
(string-append (ly:output-def-lookup layout 'composerPrefix) " " (string-join composers ", ")))))
|
#f)
|
||||||
|
(list
|
||||||
|
(if (and (null? poetIds) (null? versePoetData) (null? translatorIds)) #f
|
||||||
|
(string-append
|
||||||
|
(ly:output-def-lookup layout 'poetPrefix)
|
||||||
|
" "
|
||||||
|
(join-present (list
|
||||||
|
(join-present (list
|
||||||
|
(render-contribution-group "" poetIds)
|
||||||
|
year_text
|
||||||
|
) ", ")
|
||||||
|
(render-partial-contribution-group 'versePrefix versePoetData)
|
||||||
|
(join-present (list
|
||||||
|
(render-contribution-group (ly:output-def-lookup layout 'translationPrefix) translatorIds)
|
||||||
|
year_translation
|
||||||
|
) ", ")
|
||||||
|
) "; ")
|
||||||
|
))
|
||||||
|
(if (and (null? composerIds) (null? compositionIds) (null? verseComposerData) (null? voiceComposerData) (null? bridgeIds) (null? interludeIds)) #f
|
||||||
|
(string-append
|
||||||
|
(ly:output-def-lookup layout 'composerPrefix)
|
||||||
|
" "
|
||||||
|
(join-present (list
|
||||||
|
(join-present (list
|
||||||
|
(render-contribution-group "" composerIds)
|
||||||
|
year_melody
|
||||||
|
) ", ")
|
||||||
|
(render-partial-contribution-group 'versePrefix verseComposerData)
|
||||||
|
(render-partial-contribution-group 'voicePrefix voiceComposerData)
|
||||||
|
(join-present (list
|
||||||
|
(render-contribution-group (ly:output-def-lookup layout 'compositionPrefix) compositionIds)
|
||||||
|
year_composition
|
||||||
|
) ", ")
|
||||||
|
(render-contribution-group (ly:output-def-lookup layout 'bridgePrefix) bridgeIds)
|
||||||
|
(render-contribution-group (ly:output-def-lookup layout 'interludePrefix) interludeIds)
|
||||||
|
) "; ")
|
||||||
|
)))))
|
||||||
(list #f #f)
|
(list #f #f)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -91,8 +160,8 @@
|
|||||||
(copyright (chain-assoc-get 'header:copyright props #f))
|
(copyright (chain-assoc-get 'header:copyright props #f))
|
||||||
(translation (chain-assoc-get 'header:translation props #f))
|
(translation (chain-assoc-get 'header:translation props #f))
|
||||||
(pronunciation (chain-assoc-get 'header:pronunciation props #f))
|
(pronunciation (chain-assoc-get 'header:pronunciation props #f))
|
||||||
(year_text (chain-assoc-get 'header:year_text props #f))
|
(year_text (if (string? (car poet-and-composers)) #f (chain-assoc-get 'header:year_text props #f)))
|
||||||
(year_melody (chain-assoc-get 'header:year_melody props #f)))
|
(year_melody (if (string? (car poet-and-composers)) #f (chain-assoc-get 'header:year_melody props #f))))
|
||||||
(markup
|
(markup
|
||||||
#:override (cons 'songinfo:poet-maybe-with-composer
|
#:override (cons 'songinfo:poet-maybe-with-composer
|
||||||
(if (and poet-maybe-with-composer (not (and (string? poet-maybe-with-composer) (string-null? poet-maybe-with-composer)))) poet-maybe-with-composer #f))
|
(if (and poet-maybe-with-composer (not (and (string? poet-maybe-with-composer) (string-null? poet-maybe-with-composer)))) poet-maybe-with-composer #f))
|
||||||
|
@ -203,29 +203,49 @@
|
|||||||
y)
|
y)
|
||||||
`(,amount . 0))))
|
`(,amount . 0))))
|
||||||
|
|
||||||
|
#(define-markup-command (pad-right layout props amount arg)
|
||||||
|
(number? markup?)
|
||||||
|
(let* ((m (interpret-markup layout props arg))
|
||||||
|
(x (ly:stencil-extent m X))
|
||||||
|
(y (ly:stencil-extent m Y)))
|
||||||
|
(ly:make-stencil (ly:stencil-expr m)
|
||||||
|
(cons (car x) (+ (cdr x) amount))
|
||||||
|
y)))
|
||||||
|
|
||||||
|
#(define-markup-command (score-equal-height layout props reference-height lines)
|
||||||
|
(number? markup-list?)
|
||||||
|
#:category music
|
||||||
|
#:properties ((baseline-skip))
|
||||||
|
(stack-stencils Y DOWN baseline-skip
|
||||||
|
(map
|
||||||
|
(lambda (line) (ly:make-stencil (ly:stencil-expr line) (ly:stencil-extent line X) `(0 . ,reference-height)))
|
||||||
|
(interpret-markup-list layout props lines))))
|
||||||
|
|
||||||
#(define-markup-command (chordlyrics layout props lyrics) (ly:music?)
|
#(define-markup-command (chordlyrics layout props lyrics) (ly:music?)
|
||||||
#:properties ((verse-chords #f)
|
#:properties ((verse-chords #f)
|
||||||
(verse-reference-voice #f)
|
(verse-reference-voice #f)
|
||||||
(verse-break-voice #f))
|
(verse-break-voice #f)
|
||||||
|
(verse-line-height songTextLineHeigth)
|
||||||
|
(intraverse-vspace 0))
|
||||||
"Vers mit Akkorden"
|
"Vers mit Akkorden"
|
||||||
(interpret-markup layout props
|
(interpret-markup layout props
|
||||||
#{
|
#{
|
||||||
\markup {
|
\markup {
|
||||||
\override #'(baseline-skip . 0.3)
|
\override #`(baseline-skip . ,intraverse-vspace)
|
||||||
\pad-left #-10
|
\pad-left #-5
|
||||||
\score {
|
\score-equal-height #verse-line-height \score-lines {
|
||||||
\transposable
|
\transposable
|
||||||
<<
|
<<
|
||||||
\new Devnull { #(if (ly:music? verse-break-voice) verse-break-voice) }
|
\new Devnull { #(if (ly:music? verse-break-voice) verse-break-voice) }
|
||||||
#(if (ly:music? verse-chords) verse-chords songChords)
|
#(if (ly:music? verse-chords) (music-clone verse-chords) #{ \chords { \verseChords } #})
|
||||||
\new NullVoice { #(if (ly:music? verse-reference-voice) verse-reference-voice firstVoice) }
|
\new NullVoice { #(if (ly:music? verse-reference-voice) verse-reference-voice #{ \global \firstVoice #}) }
|
||||||
\addlyrics { #lyrics }
|
\addlyrics { #lyrics }
|
||||||
>>
|
>>
|
||||||
\layout {
|
\layout {
|
||||||
\lyricsWithChordsLayout
|
\lyricsWithChordsLayout
|
||||||
\context {
|
\context {
|
||||||
\Staff
|
\Staff
|
||||||
\override LeftEdge.space-alist.first-note = #'(fixed-space . 10.0)
|
\override LeftEdge.space-alist.first-note = #'(fixed-space . 5.0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -237,5 +257,8 @@
|
|||||||
#(define-markup-command (nochordlyrics layout props lyrics) (ly:music?)
|
#(define-markup-command (nochordlyrics layout props lyrics) (ly:music?)
|
||||||
"Vers ohne Akkorde"
|
"Vers ohne Akkorde"
|
||||||
(interpret-markup layout props
|
(interpret-markup layout props
|
||||||
(markup #:override `(verse-chords . ,#{#}) #:chordlyrics lyrics))
|
(markup
|
||||||
|
#:override `(verse-chords . ,#{#})
|
||||||
|
#:override `(verse-line-height . ,(- songTextLineHeigth 2))
|
||||||
|
#:chordlyrics lyrics))
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user