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