]> git.donarmstrong.com Git - lilypond.git/blob - input/new/incipit.ly
Merge master into nested-bookparts
[lilypond.git] / input / new / incipit.ly
1 \version "2.11.61"
2 \header {
3   lsrtags = "staff-notation,ancient-notation"
4   texidoc = "Incipits can be added using the instrument name grob, but
5 keeping separate the instrument name definition and the incipit definition."
6   doctitle = "Incipit"
7 }
8
9 incipit =
10 #(define-music-function (parser location incipit-music) (ly:music?)
11   #{
12     \once \override Staff.InstrumentName #'self-alignment-X = #RIGHT
13     \once \override Staff.InstrumentName #'self-alignment-Y = #UP
14     \once \override Staff.InstrumentName #'Y-offset = #4
15     \once \override Staff.InstrumentName #'padding = #0.3
16     \once \override Staff.InstrumentName #'stencil = 
17     #(lambda (grob)
18        (let* ((instrument-name (ly:grob-property grob 'long-text))
19               (layout (ly:output-def-clone (ly:grob-layout grob)))
20               (music (make-music 'SequentialMusic
21                       'elements (list (make-music 'ContextSpeccedMusic
22                                         'context-type 'MensuralStaff
23                                         'element (make-music 'PropertySet
24                                                    'symbol 'instrumentName
25                                                    'value instrument-name))
26                                       $incipit-music)))
27               (score (ly:make-score music))
28               (mm (ly:output-def-lookup layout 'mm))
29               (indent (ly:output-def-lookup layout 'indent))
30               (width (ly:output-def-lookup layout 'incipit-width))
31               (incipit-width (if (number? width)
32                                  (* width mm)
33                                  (* indent 0.5))))
34          (ly:output-def-set-variable! layout 'indent (- indent incipit-width))
35          (ly:output-def-set-variable! layout 'line-width indent)
36          (ly:output-def-set-variable! layout 'ragged-right #f)
37          (ly:output-def-set-variable! layout 'ragged-last #f)
38          (ly:output-def-set-variable! layout 'system-count 1)
39          (ly:score-add-output-def! score layout)
40          (set! (ly:grob-property grob 'long-text)
41                (markup #:score score))
42          (ly:system-start-text::print grob)))
43   #})
44
45 %%%%%%%%%%%%%%%%%%%%%%%%%
46
47 global = {
48   \set Score.skipBars = ##t
49   \key g \major
50   \time 4/4
51   
52   %make the staff lines invisible on staves
53   \override Staff.BarLine #'transparent = ##t
54   % the actual music
55   \skip 1*8
56
57   % let finis bar go through all staves
58   \override Staff.BarLine #'transparent = ##f
59
60   % finis bar
61   \bar "|."
62 }
63
64 discantusIncipit = <<
65   \new MensuralVoice = "discantusIncipit" <<
66     \repeat unfold 9 { s1 \noBreak }
67     {
68       \clef "neomensural-c1"
69       \key f \major
70       \time 2/2
71       c''1.
72     }
73   >>
74   \new Lyrics \lyricsto discantusIncipit { IV- }
75 >>
76
77 discantusNotes = {
78   \transpose c' c'' {
79     \clef "treble"
80     d'2. d'4 |
81     b e' d'2 |
82     c'4 e'4.( d'8 c' b |
83     a4) b a2 |
84     b4.( c'8 d'4) c'4 |
85     \once \override NoteHead #'transparent = ##t
86     c'1 |
87     b\breve |
88   }
89 }
90
91 discantusLyrics = \lyricmode {
92   Ju -- bi -- |
93   la -- te De -- |
94   o, om --
95   nis ter -- |
96   ra, __ om- |
97   "..." |
98   -us. |
99 }
100
101 altusIncipit = <<
102   \new MensuralVoice = "altusIncipit" <<
103     \repeat unfold 9 { s1 \noBreak }
104     {
105       \clef "neomensural-c3"
106       \key f \major
107       \time 2/2
108       r1 f'1.
109     }
110   >>
111   \new Lyrics \lyricsto altusIncipit { IV- }
112 >>
113
114 altusNotes = {
115   \transpose c' c'' {
116     \clef "treble"
117     % two measures
118     r2 g2. e4 fis g |
119     a2 g4 e |
120     fis g4.( fis16 e fis4) |
121     g1 |
122     \once \override NoteHead #'transparent = ##t
123     g1 |
124     g\breve |
125   }
126 }
127
128 altusLyrics = \lyricmode {
129   % two measures
130   Ju -- bi -- la -- te |
131   De -- o, om -- |
132   nis ter -- ra, |
133   "..." |
134   -us. |
135 }
136
137 tenorIncipit = <<
138   \new MensuralVoice = "tenorIncipit" <<
139     \repeat unfold 9 { s1 \noBreak }
140     {
141       \clef "neomensural-c4"
142       \key f \major
143       \time 2/2
144       r\longa
145       r\breve
146       r1 c'1.
147     }
148   >>
149   \new Lyrics \lyricsto tenorIncipit { IV- }
150 >>
151
152 tenorNotes = {
153   \transpose c' c' {
154     \once \override Staff.VerticalAxisGroup #'minimum-Y-extent = #'(-6 . 3)
155     \clef "treble_8"
156     R1 |
157     R1 |
158     R1 |
159     % two measures
160     r2 d'2. d'4 b e' |
161     \once \override NoteHead #'transparent = ##t
162     e'1 |
163     d'\breve |
164   }
165 }
166
167 tenorLyrics = \lyricmode {
168   % two measures
169   Ju -- bi -- la -- te |
170   "..." |
171   -us. 
172 }
173
174 bassusIncipit = <<
175   \new MensuralVoice = "bassusIncipit" <<
176     \repeat unfold 9 { s1 \noBreak }
177     {
178       \clef "bass"
179       \key f \major
180       \time 2/2
181       %% incipit
182       r\maxima
183       f1.
184     }
185   >>
186   \new Lyrics \lyricsto bassusIncipit { IV- }
187 >>
188
189 bassusNotes = {
190   \transpose c' c' {
191     \clef "bass"
192     R1 |
193     R1 |
194     R1 |
195     R1 |
196     g2. e4 |
197     \once \override NoteHead #'transparent = ##t
198     e1 |
199     g\breve |
200   }
201 }
202
203 bassusLyrics = \lyricmode {
204   Ju -- bi- |
205   "..." |
206   -us.
207 }
208
209 \score {
210   <<
211     \new StaffGroup = choirStaff <<
212       \new Voice = "discantusNotes" <<
213         \global
214         \set Staff.instrumentName = #"Discantus"
215         \incipit \discantusIncipit
216         \discantusNotes
217       >>
218       \new Lyrics = "discantusLyrics" \lyricsto discantusNotes { \discantusLyrics }
219       \new Voice = "altusNotes" <<
220         \global
221         \set Staff.instrumentName = #"Altus"
222         \incipit \altusIncipit
223         \altusNotes
224       >>
225       \new Lyrics = "altusLyrics" \lyricsto altusNotes { \altusLyrics }
226       \new Voice = "tenorNotes" <<
227         \global
228         \set Staff.instrumentName = #"Tenor"
229         \incipit \tenorIncipit
230         \tenorNotes
231       >>
232       \new Lyrics = "tenorLyrics" \lyricsto tenorNotes { \tenorLyrics }
233       \new Voice = "bassusNotes" <<
234         \global
235         \set Staff.instrumentName = #"Bassus"
236         \incipit \bassusIncipit
237         \bassusNotes
238       >>
239     >>
240     \new Lyrics = "bassusLyrics" \lyricsto bassusNotes { \bassusLyrics }
241     %% Keep the bass lyrics outside of the staff group to avoid bar lines
242     %% between the lyrics.
243   >>
244   \layout {
245     \context {
246       \Score
247       %% no bar lines in staves
248       \override BarLine #'transparent = ##t
249     }
250     %% the next three instructions keep the lyrics between the bar lines
251     \context {
252       \Lyrics
253       \consists "Bar_engraver" 
254       \override BarLine #'transparent = ##t
255     } 
256     \context {
257       \StaffGroup
258       \consists "Separating_line_group_engraver"
259     }
260     \context {
261       \Voice
262       %% no slurs
263       \override Slur #'transparent = ##t
264       %% Comment in the below "\remove" command to allow line
265       %% breaking also at those bar lines where a note overlaps
266       %% into the next measure.  The command is commented out in this
267       %% short example score, but especially for large scores, you
268       %% will typically yield better line breaking and thus improve
269       %% overall spacing if you comment in the following command.
270       %%\remove "Forbid_line_break_engraver"
271     }
272     indent = 6\cm
273     incipit-width = 4\cm
274   }
275 }