On Sat 15 May 2021 at 21:40:53 (-0700), Aaron Hill wrote:
> lyricSkip =
> #(define-music-function
> (count) (integer?)
> "Inserts the specified number of lyric skips."
> #{ \repeat unfold #count \skip 1 #})Might I suggest an extension to this neat little function: The extended function would insert a lyric, probably a literal, defined in the function itself, and then skip one less than the number supplied. As can be seen from the attached example (which explains the rationale), the literal might be defined as "", or an unbreakable space, or somesuch. (Someone including the function could choose what to use.) How to decrement a variable might be straightforward to work out from somebody's contributed code, but skipping the skip when the count is 1 would be beyond me. (\skip 0 raises an error.) Cheers, David.
\paper {
#(set-paper-size "a5landscape")
}
thenotesA = { c' d' e' f'~ f' }
thenotesB = { g' a' b' }
thewordsP = \lyricmode { last note has tie __ }
thewordsQ = \lyricmode { not always sung }
thewordsR = \lyricmode { now sing this }
durationsP = \lyricmode { last note has tie __ _ }
durationsQ = \lyricmode { not always sung }
durationsR = \lyricmode { now sing this }
lyricSkip =
#(define-music-function
(count) (integer?)
"Inserts the specified number of lyric skips."
#{ \repeat unfold #count \skip 1 #})
nowordsQ = #(skip-of-length durationsQ)
nbsp = \markup \char ##x00A0
nn = \lyricmode { \nbsp }
bl = \lyricmode { "" }
\new Voice { \thenotesA \thenotesB \thenotesA \thenotesB }
\addlyrics { \thewordsP \thewordsQ \thewordsP \thewordsR }
\addlyrics { \thewordsP \lyricSkip 3 \thewordsP \thewordsR }
\addlyrics { \thewordsP _ _ _ \thewordsP \thewordsR }
\addlyrics { \thewordsP " " _ _ \thewordsP \thewordsR }
\addlyrics { \thewordsP "" _ _ \thewordsP \thewordsR }
\addlyrics { \thewordsP \nn _ _ \thewordsP \thewordsR }
<<
\new Voice = vv { \thenotesA \thenotesB \thenotesA \thenotesB }
\new Lyrics { \set associatedVoice = vv
\durationsP \durationsQ \durationsP \durationsR }
\new Lyrics { \set associatedVoice = vv
\durationsP \nowordsQ \durationsP \durationsR }
\new Lyrics { \set associatedVoice = vv
\durationsP \skip 4 \skip 4 \skip 4 \durationsP \durationsR }
\new Lyrics { \set associatedVoice = vv
\durationsP \nn \skip 4 \skip 4 \durationsP \durationsR }
\new Lyrics { \set associatedVoice = vv
\durationsP \bl \skip 4 \skip 4 \durationsP \durationsR }
>>
skipping.pdf
Description: Adobe PDF document
