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