]> git.donarmstrong.com Git - lilypond.git/blob - ly/vocal-tkit.ly
Merge branch 'master' of /home/jcharles/GIT/Lily/. into translation
[lilypond.git] / ly / vocal-tkit.ly
1 %\version "2.19.22"
2
3 \include "lyrics-tkit.ly"
4 \include "staff-tkit.ly"
5
6 make-one-voice-vocal-staff =
7 #(define-music-function (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 (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   (upperName upperClef lowerName lowerClef
62     v1name v2name v3name v4name verses)
63   (voice-prefix? string? voice-prefix? string?
64     voice-prefix? voice-prefix? voice-prefix? voice-prefix? list?)
65
66   "Make two two-voice vocal staves with several stanzas between them.
67 The number of stanzas is determined by the number of populated verse names.
68   upperName: the prefix to the upper staff name
69   upperClef: the clef to use on the upper staff
70   lowerName: the prefix to the lower staff name
71   lowerClef: the clef to use on the lower staff
72      vxname: the prefix to the name of voice x, x = 1..4
73      verses: the list of verse names containing the stanzas"
74
75     #{
76         <<
77           \make-two-voice-vocal-staff
78             #upperName #upperClef #v1name #v2name
79           #(make-simultaneous-music
80             (map
81              (lambda (verse-name)
82               #{ \make-one-stanza
83                    #upperName #v1name #v2name #verse-name #} )
84             verses))
85           \make-two-voice-vocal-staff
86             #lowerName #lowerClef #v3name #v4name
87         >>
88       #} )
89