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