3 %%% The function used by the built-in templates to
4 % build a lyrics context and associate it with a voice.
6 \include "voice-tkit.ly"
9 #(define-music-function
10 (pos staffPrefix voicePrefix altVoicePrefix lyrics)
15 vocal-lyrics-or-verses?)
18 (pos: positioned Above or Below the named staff)
19 staffPrefix: voice prefix for the staff to be positioned against
20 voicePrefix: voice prefix for the associated voice
21 (altVoicePrefix: voice prefix for the associated voice
22 if the first is not present)
25 (let* ((lyrics-name (string-append voicePrefix lyrics))
26 (staff-name (string-append staffPrefix "Staff"))
27 (music-name (make-id voicePrefix "Music"))
28 (assoc-voice-name (if music-name
34 #(string-append "align" pos "Context") = #staff-name
37 (make-music 'SequentialMusic 'void #t)))
38 (stanza (if (member lyrics lyrics-postfixes)
39 (make-id voicePrefix lyrics)
41 (if (and stanza ;we need lyrics and at least one associated voice
43 (make-id altVoicePrefix "Music")))
45 \new Lyrics = #lyrics-name
46 \with { #with-clause }
47 \lyricsto #(string-append assoc-voice-name "Voice")
50 (make-music 'SequentialMusic 'void #t))))