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