|
|
|
@@ -134,18 +134,23 @@ override-stanza =
|
|
|
|
#}
|
|
|
|
#}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#(define (handle-stanza-numbers context numbers number-formater)
|
|
|
|
|
|
|
|
(let* ((stanzanumbers (ly:assoc-get 'custom-stanzanumber-override (ly:assoc-get 'details (ly:context-grob-definition context 'StanzaNumber) '()) numbers))
|
|
|
|
|
|
|
|
(stanza-style (ly:assoc-get 'style (ly:context-grob-definition context 'StanzaNumber)))
|
|
|
|
|
|
|
|
(roman-format (lambda (stanzanumber) (format #f "~@r" stanzanumber))))
|
|
|
|
|
|
|
|
(ly:context-set-property! context 'stanza
|
|
|
|
|
|
|
|
(number-formater
|
|
|
|
|
|
|
|
(if (eq? stanza-style 'roman)
|
|
|
|
|
|
|
|
(map roman-format stanzanumbers)
|
|
|
|
|
|
|
|
stanzanumbers)))))
|
|
|
|
|
|
|
|
|
|
|
|
#(define (stanza . stanzanumbers)
|
|
|
|
#(define (stanza . stanzanumbers)
|
|
|
|
#{
|
|
|
|
#{
|
|
|
|
\once \override StanzaNumber.details.custom-realstanza = ##t % set this to signal that there is a real stanza and no repeat signs
|
|
|
|
\once \override StanzaNumber.details.custom-realstanza = ##t % set this to signal that there is a real stanza and no repeat signs
|
|
|
|
\applyContext
|
|
|
|
\applyContext
|
|
|
|
#(lambda (context)
|
|
|
|
#(lambda (context)
|
|
|
|
(let* ((stanzanumbers-override (ly:assoc-get 'custom-stanzanumber-override (ly:assoc-get 'details (ly:context-grob-definition context 'StanzaNumber) '()) #f))
|
|
|
|
(handle-stanza-numbers context stanzanumbers
|
|
|
|
(stanza-style (ly:assoc-get 'style (ly:context-grob-definition context 'StanzaNumber)))
|
|
|
|
(lambda (numbers) (string-join (map (lambda (n) (format #f stanzaFormat n)) numbers) ", "))))
|
|
|
|
(stanza-format (lambda (stanzanumber) (format #f (if (eq? stanza-style 'roman) romanStanzaFormat stanzaFormat) stanzanumber))))
|
|
|
|
|
|
|
|
(ly:context-set-property! context 'stanza
|
|
|
|
|
|
|
|
(string-join (map stanza-format
|
|
|
|
|
|
|
|
(if stanzanumbers-override stanzanumbers-override stanzanumbers))
|
|
|
|
|
|
|
|
", "))))
|
|
|
|
|
|
|
|
#}
|
|
|
|
#}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
@@ -153,7 +158,14 @@ ref =
|
|
|
|
#(define-music-function (stanzanumbers lyrics) ((number-list? (list)) ly:music?)
|
|
|
|
#(define-music-function (stanzanumbers lyrics) ((number-list? (list)) ly:music?)
|
|
|
|
#{ \lyricmode {
|
|
|
|
#{ \lyricmode {
|
|
|
|
\once \override StanzaNumber.details.custom-realstanza = ##t % set this to signal that there is a real stanza and no repeat signs
|
|
|
|
\once \override StanzaNumber.details.custom-realstanza = ##t % set this to signal that there is a real stanza and no repeat signs
|
|
|
|
\set stanza = #(make-on-the-fly-markup (lambda (layout props m) ((ly:output-def-lookup layout 'refMarkupFormatter) layout props stanzanumbers)) (make-null-markup))
|
|
|
|
\applyContext
|
|
|
|
|
|
|
|
#(lambda (context)
|
|
|
|
|
|
|
|
(handle-stanza-numbers context stanzanumbers
|
|
|
|
|
|
|
|
(lambda (numbers)
|
|
|
|
|
|
|
|
(make-on-the-fly-markup
|
|
|
|
|
|
|
|
(lambda (layout props m)
|
|
|
|
|
|
|
|
((ly:output-def-lookup layout 'refMarkupFormatter) layout props numbers))
|
|
|
|
|
|
|
|
(make-null-markup)))))
|
|
|
|
#lyrics
|
|
|
|
#lyrics
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#}
|
|
|
|
#}
|
|
|
|
|