]> git.donarmstrong.com Git - lilypond.git/blob - ly/vocal-tkit.ly
Issue 3799: New satb.ly built-in template and template framework
[lilypond.git] / ly / vocal-tkit.ly
1 %\version "2.19.19"
2
3 \include "lyrics-tkit.ly"
4 \include "staff-tkit.ly"
5
6 make-one-voice-vocal-staff =
7 #(define-music-function (parser location name clef)
8    (voice-prefix? string?)
9
10    "Make a staff with one voice and lyrics beneath
11      name: the default prefix for instrument name and music
12      clef: the clef for this staff "
13
14    (if (make-id name "Music")
15      #{
16        <<
17          \make-one-voice-staff #name #clef "Up"
18          #(make-simultaneous-music
19            (reverse (map
20              (lambda (lyrics-postfix)
21                #{ \make-one-stanza "Below" #name #name #lyrics-postfix #} )
22                lyrics-postfixes)))
23        >>
24      #}
25      (make-music 'SequentialMusic 'void #t)))
26
27 make-two-voice-vocal-staff =
28 #(define-music-function (parser location name clef v1name v2name)
29    (voice-prefix? string? voice-prefix? voice-prefix?)
30
31    "Make a vocal staff with two voices and lyrics above and below
32       name: the prefix to the staff name
33       clef: the clef to use
34     v1name: the prefix to the name of voice one
35     v2name: the prefix to the name of voice two "
36
37    (define v1music (make-id v1name "Music"))
38    (define v2music (make-id v2name "Music"))
39
40    #{
41      <<
42        \make-two-voice-staff #name #clef #v1name #v2name
43        #(if v1music
44            (make-simultaneous-music
45               (map
46                (lambda (lyrics-postfix)
47                  #{ \make-one-stanza "Above" #name #v1name #lyrics-postfix #} )
48                lyrics-postfixes)))
49
50        #(if v2music
51             (make-simultaneous-music
52              (reverse (map
53               (lambda (lyrics-postfix)
54                  #{ \make-one-stanza "Below" #name #v2name #lyrics-postfix #} )
55                lyrics-postfixes))))
56      >>
57    #} )
58
59 make-two-vocal-staves-with-stanzas =
60 #(define-music-function
61   (parser location
62     upperName upperClef lowerName lowerClef
63     v1name v2name v3name v4name verses)
64   (voice-prefix? string? voice-prefix? string?
65     voice-prefix? voice-prefix? voice-prefix? voice-prefix? list?)
66
67   "Make two two-voice vocal staves with several stanzas between them.
68 The number of stanzas is determined by the number of populated verse names.
69   upperName: the prefix to the upper staff name
70   upperClef: the clef to use on the upper staff
71   lowerName: the prefix to the lower staff name
72   lowerClef: the clef to use on the lower staff
73      vxname: the prefix to the name of voice x, x = 1..4
74      verses: the list of verse names containing the stanzas"
75
76     #{
77         <<
78           \make-two-voice-vocal-staff
79             #upperName #upperClef #v1name #v2name
80           #(make-simultaneous-music
81             (map
82              (lambda (verse-name)
83               #{ \make-one-stanza
84                    #upperName #v1name #v2name #verse-name #} )
85             verses))
86           \make-two-voice-vocal-staff
87             #lowerName #lowerClef #v3name #v4name
88         >>
89       #} )
90