3 Commits

Author SHA1 Message Date
tux aa5acfae37 new engraver for spacing in chordlyrics 2025-08-10 23:54:56 +04:00
tux 45e751fa24 fix updown to only modify first character 2025-08-10 18:46:25 +02:00
tux 9fb2d96765 multiple stanza numbers for one verse 2025-08-09 13:27:38 +02:00
+13 -9
View File
@@ -121,16 +121,18 @@ override-stanza =
#} #}
) )
stanza = #(define (stanza . stanzanumbers)
#(define-music-function (parser location stanzanumber) (number?)
#{ #{
\once \override StanzaNumber.layer = 23 % set this to signal that there is a real stanza and no repeat signs \once \override StanzaNumber.layer = 23 % set this to signal that there is a real stanza and no repeat signs
\applyContext \applyContext
#(lambda (context) #(lambda (context)
(let* ((stanzanumber (ly:assoc-get 'forced-spacing (ly:context-grob-definition context 'StanzaNumber) stanzanumber)) (let* ((stanzanumber-override (ly:assoc-get 'forced-spacing (ly:context-grob-definition context 'StanzaNumber) #f))
(stanzastyle (ly:assoc-get 'style (ly:context-grob-definition context 'StanzaNumber))) (stanza-style (ly:assoc-get 'style (ly:context-grob-definition context 'StanzaNumber)))
(formattedStanzaNumber (format #f (if (eq? stanzastyle 'roman) romanStanzaFormat stanzaFormat) stanzanumber))) (stanza-format (lambda (stanzanumber) (format #f (if (eq? stanza-style 'roman) romanStanzaFormat stanzaFormat) stanzanumber))))
(ly:context-set-property! context 'stanza formattedStanzaNumber))) (ly:context-set-property! context 'stanza
(string-join (map stanza-format
(if stanzanumber-override (list stanzanumber-override) stanzanumbers))
", "))))
#} #}
) )
@@ -192,12 +194,14 @@ alt =
updown = updown =
#(define-music-function (parser location word) (string?) #(define-music-function (parser location word) (string?)
(let ((first-char (string-take word 1))
(rest (substring word 1 (string-length word))))
#{ #{
\lyricmode { \lyricmode {
\tag #'up { \markup { #(string-capitalize word) } } \tag #'up { \markup { #(string-append (string-capitalize first-char) rest) } }
\tag #'down { \markup { #(string-downcase word) } } \tag #'down { \markup { #(string-append (string-downcase first-char) rest) } }
} }
#}) #}))
dottedExtender = { dottedExtender = {
\override LyricExtender.style = #'dotted-line \override LyricExtender.style = #'dotted-line