]> git.donarmstrong.com Git - lilypond.git/blob - ly/lyrics-tkit.ly
Web-ja: update introduction
[lilypond.git] / ly / lyrics-tkit.ly
1 %\version "2.19.22"
2
3 %%% The function used by the built-in templates to
4 %   build a lyrics context and associate it with a voice.
5
6 \include "voice-tkit.ly"
7
8 make-one-stanza =
9 #(define-music-function
10   (pos staffPrefix voicePrefix altVoicePrefix lyrics)
11   ((above-or-below? #f)
12    voice-prefix?
13    voice-prefix?
14    (voice-prefix?)
15    vocal-lyrics-or-verses?)
16
17    "Make a single stanza
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)
23          lyrics: the words"
24
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
29                                voicePrefix
30                                altVoicePrefix))
31           (with-clause
32            (if pos
33                #{ \with {
34                     #(string-append "align" pos "Context") = #staff-name
35                   }
36                #}
37                (make-music 'SequentialMusic 'void #t)))
38           (stanza (if (member lyrics lyrics-postfixes)
39                         (make-id voicePrefix lyrics)
40                         (get-id lyrics))))
41    (if (and stanza  ;we need lyrics and at least one associated voice
42             (or music-name
43                 (make-id altVoicePrefix "Music")))
44         #{
45           \new Lyrics = #lyrics-name
46           \with { #with-clause }
47           \lyricsto #(string-append assoc-voice-name "Voice")
48           { #stanza }
49         #}
50         (make-music 'SequentialMusic 'void #t))))