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