This repository has been archived by the owner on Jul 16, 2020. It is now read-only.
forked from tahongawaka/LilyPond-BHS-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
staff-tkit-bhs.ily
205 lines (185 loc) · 7.39 KB
/
staff-tkit-bhs.ily
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
%{
Copyright 2018 Jeremy Marcus
This is distributed under the terms of the GNU General Public License.
This file is part of LilyPond Barbershop Template.
LilyPond Barbershop Template is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
LilyPond Barbershop Template is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with LilyPond Barbershop Template. If not, see <http://www.gnu.org/licenses/>.
%}
%\version "2.19.22"
\include "voice-tkit-bhs.ily"
%{
Staff-oriented functions
These assume the following lists have been defined:
* voice-prefixes eg "Lead"
* voice-postfixes eg "Music"
* lyrics-postfixes eg "Lyrics"
* lyrics-names eg "VerseOne"
* variable-names eg "Time"
The first three lists are used to generate compound
names such as "LeadLyrics" and "LeadInstrumentName"
The last two lists of names are used as-is.
JEREMY'S NOTE:
This edited version of staff-tkit.ly was created to allow me to change some hard-coded formatting placed in the
original version of the tkit, e.g. forced all-caps instrument names.
%}
bhs-make-one-voice-staff =
#(define-music-function (show-barNums show-instrName show-shortInstrName name clef dynamic-direction)
((boolean? #f) (boolean? #t) (boolean? #f) voice-prefix? string? (up-or-down? ""))
"Make a staff with one voice (no lyrics)
show-barNums: show bar numbers on this staff?
show-instrName: show instrument names?
show-shortInstrName: show short instrument names?
name: the default prefix for instrument name and music
clef: the clef for this staff
dynamic-direction: dynamics are up, down or neither"
(define music (make-id name "Music"))
(define instrName (make-id name "InstrumentName"))
(define shortInstrName (make-id name "ShortInstrumentName"))
(define midiName (make-id name "MidiInstrument"))
(define dynUp (equal? dynamic-direction "Up"))
(define dynDown (equal? dynamic-direction "Down"))
(if music
#{
\new Staff = #(string-append name "Staff")
\with {
\override BarNumber.break-visibility = #(if show-barNums
#(#f #t #t)
#(#f #f #f))
instrumentName = \markup {
#(if show-instrName
(if instrName instrName name)
"")
}
shortInstrumentName = \markup {
#(if show-shortInstrName
(cond
(shortInstrName shortInstrName)
(instrName (substring instrName 0 1))
(else (substring name 0 1)))
"")
}
midiInstrument = #(if midiName midiName "voice oohs")
#(cond
(dynUp dynamicUp)
(dynDown dynamicDown)
(else dynamicNeutral))
}
{
#(if Key Key)
\clef #clef
\make-voice-bhs #name
}
#}
(make-music 'SequentialMusic 'void #t)))
bhs-make-two-voice-staff =
#(define-music-function (show-barNums show-instrName show-shortInstrName name clef v1name v2name)
((boolean? #f) (boolean? #t) (boolean? #f) voice-prefix? string? voice-prefix? voice-prefix?)
"Make a vocal staff with two voices
show-barNums: show bar numbers on this staff?
show-instrName: show instrument names?
show-shortInstrName: show short instrument names?
name: the prefix to the staff name
clef: the clef to use
v1name: the prefix to the name of voice one
v2name: the prefix to the name of voice two"
(define v1music (make-id v1name "Music"))
(define v2music (make-id v2name "Music"))
(define instrName (make-id name "InstrumentName"))
(define v1InstrName (make-id v1name "InstrumentName"))
(define v2InstrName (make-id v2name "InstrumentName"))
(define shortInstrName (make-id name "ShortInstrumentName"))
(define v1ShortInstrName (make-id v1name "ShortInstrumentName"))
(define v2ShortInstrName (make-id v2name "ShortInstrumentName"))
(define v1midiName (make-id v1name "MidiInstrument"))
(define v2midiName (make-id v2name "MidiInstrument"))
(if (or v1music v2music)
#{
<<
\new Staff = #(string-append name "Staff")
\with {
\override BarNumber.break-visibility = #(if show-barNums
#(#f #t #t)
#(#f #f #f))
\remove "Staff_performer"
instrumentName =
#(if show-instrName
(if instrName
#{ \markup #instrName #}
#{ \markup \left-column {
#(if v1music
(if v1InstrName v1InstrName v1name)
"")
#(if v2music
(if v2InstrName v2InstrName v2name)
"")
} #} )
#{ \markup "" #})
shortInstrumentName =
#(if show-shortInstrName
(if shortInstrName
#{ \markup #shortInstrName #}
#{ \markup \left-column {
#(if v1music
(cond
(v1ShortInstrName v1ShortInstrName)
(v1InstrName (substring v1InstrName 0 1))
(else (substring v1name 0 1)))
"")
#(if v2music
(cond
(v2ShortInstrName v2ShortInstrName)
(v2InstrName (substring v2InstrName 0 1))
(else (substring v2name 0 1)))
"")
} #} )
#{ \markup "" #})
}
<<
#(if Key Key)
\clef #clef
#(if v1music
#{
\new Voice = #(string-append v1name "Voice")
\with {
\consists "Staff_performer"
\dynamicUp
midiInstrument =
#(if v1midiName v1midiName "voice oohs")
}
<<
#(if KeepAlive KeepAlive)
#(if Time Time)
#(if v2music voiceOne oneVoice)
{\bar ""}
{#v1music \bar "|."}
>>
#} )
#(if v2music
#{
\new Voice = #(string-append v2name "Voice")
\with {
\consists "Staff_performer"
\dynamicDown
midiInstrument =
#(if v2midiName v2midiName "voice oohs")
}
<<
#(if KeepAlive KeepAlive)
#(if Time Time)
#(if v1music voiceTwo oneVoice)
{\bar ""}
{#v2music \bar "|."}
>>
#} )
>>
>>
#}
(make-music 'SequentialMusic 'void #t)))