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