]> git.donarmstrong.com Git - lilypond.git/blob - input/les-nereides.ly
585c3e424d66975418b6737c2970439a7697680b
[lilypond.git] / input / les-nereides.ly
1 %{
2 cpp -P -traditional -o l.ly les-nereides.ly
3 cpp -P -traditional -o l-fake.ly  -DFAKE_GRACE les-nereides.ly
4 %}
5
6 \header{
7     composer =   "ARTHUR GRAY";
8     title =      "LES N\\'ER\\'EIDES";
9     subtitle =   "THE NEREIDS";
10     enteredby =  "JCN";
11     %piece =      "Allegretto scherzando";
12     copyright =  "public domain";
13     description = "Natiest piece of competition at http://www.orphee.com/comparison/study.html, see http://www.orphee.com/comparison/gray.pdf";
14     comment =     "LilyPond (1.3.93) can't really do this yet, I guess";
15 }
16
17
18 %% cpp: don't start on first column
19  #(define (grace-beam-space-function multiplicity)
20          (* (if (<= multiplicity 3) 0.816 0.844) 0.8))
21
22 %% cpp: don't start on first column
23  #(define (make-text-checker text)
24   (lambda (elt)
25      ;; huh, string-match undefined?
26      ;; (string-match text (ly-get-elt-property elt 'text))
27      (equal? text (ly-get-elt-property elt 'text))
28     ))
29
30
31 global = \notes{
32     \partial 2;
33     \key a \major;
34     \skip 2;
35     \skip 1*2;
36
37 #ifndef FAKE_GRACE
38     \skip 1;
39 #else % FAKE_GRACE
40     \skip 2.; \partial 32*24;
41     \skip 32*24;
42 #endif % FAKE_GRACE
43
44     \bar "||";
45 }
46
47 treble = \context Voice=treble \notes\relative c''{
48     % Broken?
49     \property Voice.NoteColumn \push #'horizontal-shift = #0
50     \outputproperty #(make-type-checker 'text-item-interface) 
51             #'extra-offset = #'(-6 . 2)
52     %% *Style* = Large??
53     \property Voice.TextScript \push #'style = #"Large"
54     r2^"Allegretto scherzando"
55     \property Voice.TextScript \pop #'style
56     %2
57     \property Voice.Stem \pop #'direction
58     \property Voice.Stem \push #'direction = #1
59     r4 <cis\arpeggio eis a cis> r2
60     %3
61     r4 <cis\arpeggio fis a cis> r8.
62     % Huh, urg?  Implicit \context Staff lifts us up to Staff context???
63     \translator Staff=bass
64     % Get back
65     \context Voice 
66     \outputproperty #(make-text-checker "m.d.")
67             #'extra-offset = #'(-3 . -4)
68     % currently, this can't be (small) italic, because in the paperblock
69     % we set italic_magnifictation to get large italics.
70     cis,16^2^"m.d."( <fis8 fis,> <e! e,!>
71     %4
72     <)dis,4 a' dis>
73     % Urg, this lifts us up to staff context
74     \translator Staff=treble
75     % Get back
76     \context Voice 
77     \property Voice.Slur \pop #'direction
78     \property Voice.Slur \push #'direction = #1
79     \property PianoStaff.connectArpeggios = ##t
80     \property Voice.TextSpanner \pop #'type
81
82     %% Ghostview is ok, but xdvi shows a solid line
83     \property Voice.TextSpanner \push #'line-thickness = #2
84     \property Voice.TextSpanner \push #'dash-period = #0.5
85
86     \property Voice.TextSpanner \push #'type = #"dotted-line"
87     \property Voice.TextSpanner \push #'edge-height = #'(0 . 1.5)
88     \property Voice.TextSpanner \push #'edge-text = #'("8 " . "")
89     % Huh, urg?  Implicit \context Staff lifts us up to Staff context???
90     \property Staff."c0-position" = #-13
91     % Get back
92     \context Voice 
93     \outputproperty #(make-text-checker "m.g.")
94             #'extra-offset = #'(-3 . -2)
95     % currently, this can't be (small) italic, because in the paperblock
96     % we set italic_magnifictation to get large italics.
97     cis''''4^"m.g."\arpeggio \spanrequest \start "text"  (
98
99 #ifndef FAKE_GRACE
100
101     \property Voice.Stem \pop #'direction
102
103     % grace is a mess
104     % maybe we should fake this and put 5/4 in this bar?
105
106     \grace {
107         )cis8
108         \property Grace.Stem \pop #'direction
109         \property Grace.Stem \push #'direction = #0
110         \property Grace.Beam \push #'space-function = #grace-beam-space-function
111         %% urg, dim. during grace dumps core here
112         %% [a16-5( fis dis \spanrequest \stop "text" ]
113         %% [cis'32 a-1 fis-4 dis] [cis a )fis-2]
114         [a16-5( fis dis \spanrequest \stop "text" ]
115         \property Staff."c0-position" = #-6
116         [cis32 a-1 fis-4 dis] [cis a )fis-2]
117     }
118
119 #else % FAKE_GRACE 
120
121     \property Score.PaperColumn  \push #'space-factor = #0.6
122     \property Score.PaperColumn  \push #'to-musical-spacing-factor = #0.04
123     \property Voice.NoteHead \push #'font-relative-size = #-1
124     \property Voice.Stem \push #'font-relative-size = #-1
125     \property Voice.Stem \push #'length = #6
126     \property Voice.Stem \push #'beamed-lengths =
127         #(map (lambda (x) (* 1.25 x)) '(0.0 2.5 2.0 1.5))
128     \property Voice.Stem \push #'beamed-minimum-lengths =
129         #(map (lambda (x) (* 1.25 x)) '(0.0 1.5 1.25 1.0))
130
131     \property Voice.Beam \push #'font-relative-size = #-1
132     \property Voice.TextScript \push #'font-relative-size = #-1
133     \property Voice.Fingering \push #'font-relative-size = #-1
134     \property Voice.Slur \push #'font-relative-size = #-1
135     \property Staff.Accidentals \push #'font-relative-size = #-1
136     \property Voice.Beam \push #'space-function = #grace-beam-space-function
137
138     )cis16
139     \property Voice.Stem \pop #'direction
140     \property Voice.Stem \push #'direction = #0
141     %% [a16^5( fis dis \spanrequest \stop "text" ]
142     %% [cis'32 a-1 fis-4 dis] [cis a )fis-2] s s s
143     [a16^5( fis dis \spanrequest \stop "text" ]
144     \property Staff."c0-position" = #-6
145     [cis32 a^1 fis^4 dis] [cis a )fis-2] s % s s
146
147     \property Voice.NoteHead \pop #'font-relative-size
148     \property Voice.Stem \pop #'font-relative-size
149     \property Voice.Stem \pop #'length
150     \property Voice.Stem \pop #'beamed-lengths
151     \property Voice.Stem \pop #'beamed-minimum-lengths
152     \property Voice.Beam \pop #'font-relative-size
153     \property Voice.TextScript \pop #'font-relative-size
154     \property Voice.Fingering \pop #'font-relative-size
155     \property Voice.Slur \pop #'font-relative-size
156     \property Staff.Accidentals \pop #'font-relative-size
157     \property Voice.Beam \pop #'space-function
158     \property Score.PaperColumn  \pop #'space-factor
159     \property Score.PaperColumn \pop #'to-musical-spacing-factor
160 #endif % FAKE_GRACE
161     
162
163     \property Voice.Stem \pop #'direction
164     \property Voice.Stem \push #'direction = #1
165     cis'4()bis
166     r8
167     <a'8( a,> <gis gis,> <fis fis,> <gis gis,> <fis fis,> )e^" "^1^4^5 r|
168     r<a8( a,> <gis gis,> <fis fis,> <gis gis,> <fis fis,> )e r|
169 }
170
171 trebleTwo = \context Voice=trebleTwo \notes\relative c''{
172     \property Voice.NoteColumn \push #'horizontal-shift = #1
173     s2
174     s1*2
175     s4
176     \property Voice.Stem \pop #'direction
177     \property Voice.Stem \push #'direction = #-1
178     <cis'4\arpeggio a fis dis>
179
180 #ifdef FAKE_GRACE
181     s32*16
182 #endif
183
184     \property Voice.NoteColumn \push #'force-hshift = #-0.2
185     <e,2 gis, e d!>
186     % Hmm s/r?
187     %r8 cis4. d4
188     s8 cis4. d4
189     \property Voice.NoteColumn \pop #'force-hshift
190     [<cis8( e,> <b-3 d,-1> |
191     \property Voice.NoteColumn \push #'force-hshift = #-0.2
192     <)a-2 cis,-1>] cis4. d4 
193     \property Voice.NoteColumn \pop #'force-hshift
194     [<cis8( e,> <b d,> |
195     <)a cis,>]
196 }
197
198 bass = \context Voice=bass \notes\relative c{
199     % Allow ugly slurs
200     \property Voice.Slur \push #'beautiful = #5.0
201     \property Voice.Slur \push #'attachment-offset = #'((0 . -3) . (0 . -6))
202     \property Voice.Stem \pop #'direction
203     \property Voice.Slur \push #'direction = #-1
204     % huh, auto-beamer?
205     r8. e,16-2( [<a8 a,> <b b,>] <cis4 cis,> |
206     %2
207     % Huh, urg?  Implicit \context Staff lifts us up to Staff context???
208     \translator Staff=treble
209     % Get back
210     \context Voice 
211     \property Voice.Stem \pop #'direction
212     \property Voice.Stem \push #'direction = #-1
213     \property Voice.slurEndAttachment = #'stem
214     <)a''4\arpeggio eis cis> 
215     %\stemboth
216     \property Voice.slurEndAttachment = ##f
217     % Huh, urg?  Implicit \context Staff lifts us up to Staff context???
218     \translator Staff=bass
219     % Get back
220     \context Voice 
221     \property Voice.Stem \pop #'direction
222     \property Voice.Slur \pop #'y-free
223     \property Voice.Slur \push #'y-free = #0.1
224     \property Voice.Slur \pop #'attachment-offset
225     \property Voice.Slur \push #'attachment-offset = #'((0 . -3) . (0 . -8))
226     r8. cis,,16( <fis8 fis,> <gis gis,>
227     %3
228     \property Voice.Stem \pop #'length
229     \property Voice.Stem \push #'length = #5
230     <a4 a,>
231     % Huh, urg?  Implicit \context Staff lifts us up to Staff context???
232     \translator Staff=treble
233     % Get back
234     \context Voice 
235     \property Voice.Stem \pop #'length
236     \property Voice.Stem \pop #'direction
237     \property Voice.Stem \push #'direction = #-1
238     <)a'\arpeggio fis cis>
239     % Huh, urg?  Implicit \context Staff lifts us up to Staff context???
240     \translator Staff=bass
241     % Get back
242     \context Voice 
243     \property Voice.Stem \pop #'direction
244     r2
245     %4
246     \property Voice.Slur \pop #'beautiful
247     \property Voice.Slur \pop #'attachment-offset
248     \property Voice.Stem \pop #'direction
249     \property Voice.Stem \push #'direction = #-1
250     <b,,4 b,>
251     \clef treble;
252     \property Voice.Stem \pop #'direction
253     \property Voice.Stem \push #'direction = #0
254     <
255         %urg: staff-change: ! on dis
256         <cis''\arpeggio a fis dis!>
257 %       { s8. \clef bass;}
258     >
259
260 #ifndef FAKE_GRACE
261     %Hmm
262     %\grace { s16 s s s s32 s s s s \clef bass; s }
263     \clef bass;
264     \grace { <e,,,32( e,> } <)gis'2 e>
265 #else
266     s4 s8 s32 s  s \clef bass;
267     \property Score.PaperColumn  \push #'space-factor = #0.6
268     \property Score.PaperColumn  \push #'to-musical-spacing-factor = #0.1
269     \property Voice.NoteHead \push #'font-relative-size = #-1
270     \property Voice.Stem \push #'font-relative-size = #-1
271     \property Voice.Stem \push #'length = #6
272     \property Voice.Slur \push #'font-relative-size = #-1
273     \property Voice.Slur \push #'attachment-offset = #'((-0.5 . 0) . (0.5 . 0))
274     <e,,,32( e,>
275
276     \property Voice.NoteHead \pop #'font-relative-size
277     \property Voice.Stem \pop #'font-relative-size
278     \property Voice.Stem \pop #'length
279     \property Voice.Slur \pop #'font-relative-size
280     \property Score.PaperColumn  \pop #'space-factor
281     \property Score.PaperColumn \pop #'to-musical-spacing-factor
282      <)gis'2 e>
283     \property Voice.Slur \pop #'attachment-offset
284 #endif
285     %5
286     \property Voice.Slur \pop #'direction
287     \property Voice.Slur \push #'direction = #1
288     a,8 [e'-5(<)a-2 cis-3>]
289     r b,-5 <e4-3 gis-5 d'>
290     \property Voice.Slur \pop #'direction
291     \property Voice.Slur \push #'direction = #0
292     [e,8-5(|
293     %6
294     )a-2]
295     \property Voice.Slur \pop #'direction
296     \property Voice.Slur \push #'direction = #1
297     [e'(<)a cis>] r b, <e4 gis d'>
298     \property Voice.Slur \pop #'direction
299     \property Voice.Slur \push #'direction = #0
300     [e,8(|
301     %7
302     )a]
303 }
304
305 bassTwo = \context Voice=bassTwo \notes\relative c{
306     \skip 2;
307     \skip 1*2;
308     \skip 2;
309
310 #ifdef FAKE_GRACE
311     \skip 32*16;
312 #endif
313
314     \property Voice.Stem \pop #'direction
315     \property Voice.Stem \push #'direction = #1
316     \property Voice.Slur \pop #'direction
317     \property Voice.Slur \push #'direction = #1
318
319     cis'4()bis
320 }
321
322 middleDynamics = \context Dynamics=middle \notes{
323     s8 s16 s\f s4
324     s1*2
325     %4
326     s2
327
328 #ifdef FAKE_GRACE
329     s32*12
330     \outputproperty #(make-type-checker 'dynamic-interface) 
331             #'extra-offset = #'(0 . 1.5)
332     s32\> s s \!s
333 #endif
334     s32 
335     \outputproperty #(make-type-checker 'text-item-interface) 
336             #'extra-offset = #'(0 . 1.5)
337     s-"rall." s s
338     s8 s4
339
340     \outputproperty #(make-type-checker 'dynamic-interface) 
341             #'extra-offset = #'(0 . 4)
342     %s1\mf-"a tempo"
343     s2\mf-"a tempo" s4
344     \outputproperty #(make-type-checker 'crescendo-interface) 
345             #'extra-offset = #'(0.5 . -1)
346     s\> \!s8
347     \outputproperty #(make-type-checker 'dynamic-interface) 
348             #'extra-offset = #'(-1 . 4)
349     s8\mf s4 s4 s8\> s32 s s \!s
350 }
351
352 lowerDynamics = \context Dynamics=lower \notes{
353     s2
354     %2
355     s2\sustaindown s8. s16\sustainup s4
356     %3
357     s2\sustaindown s8. s16\sustainup s4
358     %3
359
360 #ifndef FAKE_GRACE
361     s4\sustaindown s16
362     s32 s s\sustainup s
363     s32\sustaindown s s s
364     s8
365 #else
366     s2\sustaindown
367     s32*12
368     s32 s s\sustainup s
369     s32\sustaindown s s s
370 #endif
371
372     \property Dynamics.stopSustain = #""
373     s4 s16. s32\sustainup
374
375     %5
376     s8\sustaindown s s
377     \property Dynamics.stopSustain = #"*"
378     \property Dynamics.stopStartSustain = #"-P"
379     s s\sustainup\sustaindown s s
380     s\sustainup
381
382     %6
383     \property Dynamics.stopStartSustain = #""
384     s8\sustaindown s s
385     \property Dynamics.stopStartSustain = #"-P"
386     s s\sustainup\sustaindown s s
387     s\sustainup
388 }
389
390 \score{
391     \context PianoStaff <
392         \context Staff=treble <
393             \global
394             \treble
395             \trebleTwo
396         >
397         \context Dynamics=middle <
398             \global
399             \middleDynamics
400         >
401         \context Staff=bass <
402             \clef bass;
403             \global
404             \bass
405             \bassTwo
406         >
407         \context Dynamics=lower <
408             \global
409             \lowerDynamics
410         >
411     >
412     \paper {
413         %%BURP
414         magnification_italic = 1.;
415         \translator {
416             \ScoreContext
417             TimeSignature \push #'style = #"C"
418             SpacingSpanner \push #'maximum-duration-for-spacing = #(make-moment 1 4)
419
420             \remove Bar_number_engraver;
421         }
422         \translator {
423             \type "Engraver_group_engraver";
424             \name Dynamics;
425             \consists "Output_property_engraver";
426             Generic_property_list = #generic-voice-properties
427             \consists "Property_engraver";
428             DynamicsMinimumVerticalExtent = #(cons -3 -3)
429             VerticalAlignment \push #'threshold = #'(9 . 9) 
430
431             startSustain = #"Ped."
432             stopSustain = #"*"
433             stopStartSustain = #"*Ped."
434             startUnaChorda = #"una chorda"
435             stopUnaChorda = #"tre chorde"
436             
437             \consists "Piano_pedal_engraver";
438             \consists "Script_engraver";
439             \consists "Dynamic_engraver";
440             \consists "Text_engraver";
441             %GURGURGU, text is initialised using TextScript
442             TextScript \push #'style = #"italic"
443             %%% TextScript \push #'font-relative-size = #2
444
445             \consists "Skip_req_swallow_translator";
446
447             \consistsend "Axis_group_engraver";
448         }
449
450         \translator {
451             \PianoStaffContext
452             \accepts Dynamics;
453             VerticalAlignment \push #'threshold = #'(7 . 7)
454         }
455         \translator {
456             \GraceContext
457             Stem \push #'flag-style = #""
458         }
459     }
460 }