]> git.donarmstrong.com Git - lilypond.git/blob - mf/feta-eindelijk.mf
release: 1.5.29
[lilypond.git] / mf / feta-eindelijk.mf
1 % feta-eindelijk.mf -- implement rest symbols -*-Fundamental-*-
2 %
3 % part of LilyPond's pretty-but-neat music font
4 %
5 % source file of the Feta (not the Font-En-Tja) music font
6
7 % (c) 1997--2002 Jan Nieuwenhuizen <janneke@gnu.org>
8
9 fet_begingroup("rests");
10
11 begingroup
12
13 thick#:=1/16designsize;
14 define_blacker_pixels(thick);
15
16 rthin:=1/8*staff_space;
17 % rthick:=2rthin;
18 rthick:=2thick+rthin;
19
20 def shift_pic (expr pone, ptwo) =
21   currentpicture:=currentpicture shifted (round(pone),round(ptwo))
22 enddef;
23
24 % stuff for     8th,16th etc rests
25 %
26 save stem, ball_crook_stem, ball_crook_balldiam, flare;
27
28 % stem#:=1/8*staff_space#;
29 stem# = 1/5staff_space#;
30 % flare# = 2/3staff_space#;
31 flare# = 2/3staff_space# - 1/8stafflinethickness#;
32
33 define_pixels(stem,flare);
34
35 ball_crook_stem = stem;
36 ball_crook_balldiam =flare;
37
38
39 save block_rest_y, block_rest_x;
40
41 block_rest_y# = 5/8 staff_space#;
42 block_rest_x# = 3/2 staff_space#;
43
44 define_pixels(block_rest_y, block_rest_x);
45
46 def block_rest =
47         draw_block ((0,0), (block_rest_x, block_rest_y));
48         enddef;
49
50 fet_beginchar( "whole rest", "0", "wholerest");
51         set_char_box(0, block_rest_x#,
52                 block_rest_y#,  0);
53         block_rest;
54         currentpicture := currentpicture shifted (0,- block_rest_y);
55 fet_endchar;
56
57 fet_beginchar("half rest", "1", "halfrest");
58         set_char_box(0, block_rest_x#, 0, block_rest_y#);
59         block_rest;
60 fet_endchar;
61
62
63 %
64 % should use ledgerline thickness?
65 %
66 fet_beginchar( "whole rest (outside staff)", "0o", "outsidewholerest");
67         set_char_box(0, block_rest_x#,
68                 block_rest_y#, ledgerlinethickness#/2);
69         block_rest;
70         currentpicture := currentpicture shifted (0, - block_rest_y);
71         pickup pencircle scaled ledgerlinethickness;
72
73         y5 = y6 = 0;
74         lft x5 = - b - block_rest_y;
75         rt x6 = w + block_rest_y;
76         draw z5 .. z6;
77 fet_endchar;
78
79 fet_beginchar("half rest (outside staff)", "1o", "outsidehalfrest");
80         set_char_box(0, block_rest_x#,
81                 ledgerlinethickness#/2, block_rest_y#);
82         block_rest;
83         pickup pencircle scaled ledgerlinethickness;
84         y5 = y6 = 0;
85         lft x5 = - b - block_rest_y ;  
86         rt x6 = w + block_rest_y;
87         draw z5 .. z6;
88 fet_endchar;
89
90
91 save breve_rest_y, breve_rest_x;
92
93 breve_rest_y# =  staff_space#;
94 breve_rest_x# = 3/5 staff_space#;
95 multi_rest_x# = 4 staff_space#;
96 multi_beam_height# = 1/3 staff_space#;
97
98 define_pixels(breve_rest_y, breve_rest_x, multi_rest_x, multi_beam_height);
99
100 fet_beginchar("breve rest", "-1", "breverest");
101        set_char_box(0, breve_rest_x#, 0, breve_rest_y#);
102        draw_block ((0,0), (breve_rest_x, breve_rest_y));
103 fet_endchar;
104
105 fet_beginchar("longa rest", "-2", "longarest");
106        set_char_box(0, breve_rest_x#, breve_rest_y#, breve_rest_y#);
107        draw_block ((0,-breve_rest_y), (breve_rest_x, breve_rest_y));
108 fet_endchar;
109
110 tracingvariables := 1;
111
112 fet_beginchar("multi rest", "-4", "multirest");
113        set_char_box(multi_rest_x#, multi_rest_x#,
114                     breve_rest_y#, breve_rest_y#);
115        draw_block ((- b, - multi_beam_height),
116                    (w, multi_beam_height));
117        draw_block ((- b,-breve_rest_y),
118                    (rthin - b, breve_rest_y));
119        draw_block ((w - rthin,-breve_rest_y),
120                    (w, breve_rest_y));
121 fet_endchar;
122
123 fet_beginchar("Quarter rest","2","quartrest");
124 %       draw_staff (-2, 2, 0.0);        
125         save alpha, yshift, height;
126         alpha:=-50;
127         yshift# = -1.25 staff_space#;
128         height# = 2.8125 staff_space#;
129         define_pixels (yshift, height);
130
131         
132         set_char_box(0, 27/25staff_space#,
133           -yshift#,
134           yshift# + height#);
135         
136         save ne,nw,se,sw; pair ne,nw,se,sw;
137         
138         se=dir alpha; nw=dir (alpha+180);
139         ne=dir (alpha+90); sw=dir (alpha-90);
140         penpos1(rthin,alpha+90);
141         penpos2(5/4rthick,alpha);
142         penpos4(5/4rthick,alpha);
143         penpos5(rthin,alpha+90);
144         penpos3(3/4rthick,alpha);
145 %       penpos6(5/8rthick,alpha);
146         penpos6(2/3rthick,alpha);
147         penpos7(1/2rthin,alpha+90);
148
149         z10=z2l+1/2rthin*sw;
150 %       z11=z4l+1/2rthin*sw;
151         z11=z4l+1/2rthin*sw+1/2rthin*se;
152         z12=z4r+1/2rthin*ne;
153 %       z13=z2r+1/2rthin*ne;
154         z13=z2r+1/2rthin*ne+1/2rthin*nw;
155
156         y1r = h;
157         x1l=1/3staff_space;
158         z2r=z1+staff_space*se;
159         z3=1/2[z2,z4];
160         x4=3/8staff_space;
161         y4= 0;
162         z5=z4l+1.3staff_space*se;
163         x6l=x4l;
164         y6l=y4r;
165         x7=2/5staff_space;
166         y7= -d;
167         
168         fill z1l{se}..{se}z10..z3l..z11{se}..{se}z5l..z5r{nw}..{nw}z12..z3r..z13{nw}..{nw}z1r.. cycle;
169         fill z5r{nw}..tension1.4..z6l..tension1.4..{se}z7l..z7r{nw}..tension1.4..z6r..tension1.4..{se}z5l..cycle;
170         penlabels(1,2,3,4,5,6,7);
171         penlabels(10,11,12,13);
172         
173 %         3/4 staff_space# + yshift#,
174 %         18/5staff_space# + yshift#)
175
176         fet_endchar;
177
178 def rest_crook(expr a, w) =
179         balled_crook(a, w, ball_crook_balldiam, ball_crook_stem)
180 enddef;
181
182 def draw_eighth_rest =
183 %       draw_staff (-2, 2, 0.0);
184         save yshift, ballcorrection;
185         ballcorrection = 0.005 staff_space;
186
187         yshift# := -1.0 staff_space#;
188         define_pixels(yshift);
189
190
191         set_char_box(0, 4/3staff_space#, -yshift#, yshift# +
192                         5/3staff_space#+7/4stafflinethickness#);
193
194         %
195         % The curve is like a valley causing less space between
196         % the curve and the lower staff line. Correct for this.
197         % 
198         save x,y;
199
200         x1=w-stem/6;
201
202         y1 = yshift + 1.5 staff_space + flare/4 + ballcorrection; 
203         rest_crook (z1,w-stem/6);
204         z2-z1=whatever*dir70;
205         y2= yshift + stem/2;
206         brush(z1,2/3stem,z2,stem);      
207 enddef;
208
209 fet_beginchar("8th rest","3","eighthrest");
210         draw_eighth_rest;
211
212         fet_endchar;
213
214 fet_beginchar("16th rest","4","sixteenthrest");
215 %       draw_staff (-2, 2, 0.0);
216         save yshift, ballcorrection;
217         ballcorrection = 0.005 staff_space;
218
219         yshift# := - 2 staff_space#;
220         define_pixels(yshift);
221
222         save alpha,cw,h,w, height;
223         alpha=74;
224         cw#=7/6staff_space#;
225         height# =  5/3staff_space#+staff_space#+7/4stafflinethickness#;
226         set_char_box(0, cw#+(height#-3/2staff_space#)/tand(alpha),
227                 -yshift#, height# + yshift#);
228
229         define_pixels(cw);
230         save x,y;
231         x1=w-stem/6;
232         y1 = yshift + 2.5 staff_space + flare/4 + ballcorrection;
233
234         z2-z1=whatever*dir alpha;
235         y2= yshift + stem/2;
236         brush(z1,2/3stem,z2,stem);
237         rest_crook (z1,cw);
238         z3-z1=whatever*dir alpha;
239         y3=y1-staff_space;
240         rest_crook (z3,cw);
241         penlabels(1,2);
242         fet_endchar;
243
244 fet_beginchar("32th rest","5","thirtysecondrest");
245 %       draw_staff (-2, 2, 0.0);
246         save yshift, ballcorrection;
247         ballcorrection = 0.005 staff_space;
248
249         yshift# := -2 staff_space#;
250         define_pixels(yshift);
251
252         save alpha,cw,h;
253         alpha=76;
254         cw#=7/6staff_space#;
255         h#=5/3staff_space#+2staff_space#+7/4stafflinethickness#;
256
257         set_char_box(0, cw#+(h#-3/2staff_space#)/tand(alpha),
258                 -yshift#,yshift# +h#);
259         define_pixels(cw);
260         save x,y;
261         x1=w-stem/6;
262         y1 = yshift + 3.5 staff_space + flare/4 + ballcorrection;
263
264         z2-z1=whatever*dir alpha;
265         y2=stem/2 + yshift;
266         brush(z1,2/3stem,z2,stem);
267         rest_crook (z1,cw);
268         z3-z1=whatever*dir alpha;
269         y3=y1-staff_space;
270         rest_crook (z3,cw);
271         z4-z1=whatever*dir alpha;
272         y4=y1-2staff_space;
273         rest_crook (z4,cw);
274         fet_endchar;
275
276 fet_beginchar("64th rest","6","sixtyfourthrest");
277 %       draw_staff (-2, 2, 0.0);
278         save yshift, ballcorrection;
279         ballcorrection = 0.005 staff_space;
280
281         yshift# := -3 staff_space#;
282         define_pixels(yshift);
283
284         save alpha,cw,h,w;
285         alpha=78;
286         cw#=7/6staff_space#;
287         h#=5/3staff_space#+3staff_space#+7/4stafflinethickness#;
288         w#=cw#+(h#-3/2staff_space#)/tand(alpha);
289         set_char_box(0,w#,-yshift# ,yshift# + h#);
290
291         define_pixels(cw);
292         save x,y;
293         x1=w-stem/6;
294
295         y1 = yshift + 4.5 staff_space + flare/4 + ballcorrection;
296
297         z2-z1=whatever*dir alpha;
298         y2=stem/2 + yshift;
299         brush (z1,2/3stem,z2,stem);
300         rest_crook (z1,cw);
301         z3-z1=whatever*dir alpha;
302         y3=y1-staff_space;
303         rest_crook (z3,cw);
304         z4-z1=whatever*dir alpha;
305         y4=y1-2staff_space;
306         rest_crook (z4,cw);
307         z5-z1=whatever*dir alpha;
308         y5=y1-3staff_space;
309         rest_crook (z5,cw);
310
311         fet_endchar;
312
313 fet_beginchar("128th rest","7","hundredtwentyeighthrest"); 
314 %       draw_staff (-2, 2, 0.0);
315         save yshift, ballcorrection;
316         ballcorrection = 0.005 staff_space;
317
318         yshift# := -3 staff_space#;
319         define_pixels(yshift);
320         save alpha,cw,h,w;
321         alpha=78;
322         cw#=7/6staff_space#;
323         h#=5/3staff_space#+4staff_space#+7/4stafflinethickness#;
324         w#=cw#+(h#-3/2staff_space#)/tand(alpha);
325         set_char_box(0,w#, -yshift#,yshift#  + h#);
326         define_pixels(cw);
327         save x,y;
328         x1=w-stem/6;
329         y1 = yshift + 5.5 staff_space + flare/4 + ballcorrection;
330
331         z2-z1=whatever*dir alpha;
332         y2=stem/2 + yshift;
333         brush (z1,2/3stem,z2,stem);
334         rest_crook (z1,cw);
335         z3-z1=whatever*dir alpha;
336         y3=y1-staff_space;
337         rest_crook (z3,cw);
338         z4-z1=whatever*dir alpha;
339         y4=y1-2staff_space;
340         rest_crook (z4,cw);
341         z5-z1=whatever*dir alpha;
342         y5=y1-3staff_space;
343         rest_crook (z5,cw);
344         z6-z1=whatever*dir alpha;
345         y6=y1-4staff_space;
346         rest_crook (z6,cw);
347         
348         fet_endchar;
349
350 fet_beginchar("Classical quarter rest","2classical","clasquartrest");
351         draw_eighth_rest;
352         currentpicture := currentpicture xscaled -1 shifted (w,0);
353         fet_endchar;
354
355 endgroup;
356
357
358 %%%%%%%%
359 %
360 %
361 %
362 % MENSURAL NOTATION
363 %
364 %
365 %
366
367 % Neo-mensural longa and breve are identical with default longa and breve.
368
369 neomens_block_rest_x# = 2/5 staff_space#;
370 neomens_block_rest_y# = 1/1 staff_space#;
371 neomens_half_block_rest_y# = 5/8 staff_space#;
372
373 define_pixels(neomens_block_rest_x,
374               neomens_block_rest_y, neomens_half_block_rest_y);
375
376 def neomens_half_block_rest =
377         draw_block ((0,0), (neomens_block_rest_x, neomens_half_block_rest_y));
378         enddef;
379
380 fet_beginchar("Neo-mensural longa rest", "-2neo_mensural", "neomenslongarest");
381        set_char_box(0, neomens_block_rest_x#,
382                     neomens_block_rest_y#, neomens_block_rest_y#);
383        draw_block ((0,-neomens_block_rest_y),
384                    (neomens_block_rest_x, neomens_block_rest_y));
385 fet_endchar;
386
387 fet_beginchar("Neo-mensural breve rest", "-1neo_mensural", "neomensbreverest");
388        set_char_box(0, neomens_block_rest_x#,
389                     0, neomens_block_rest_y#);
390        draw_block ((0,0), (neomens_block_rest_x, neomens_block_rest_y));
391 fet_endchar;
392
393 fet_beginchar("Neo-mensural whole rest", "0neo_mensural", "neomenssemibrevisrest");
394         set_char_box(0, neomens_block_rest_x#,
395                      neomens_half_block_rest_y#,  0);
396         neomens_half_block_rest;
397         currentpicture :=
398                 currentpicture shifted (0,- neomens_half_block_rest_y);
399 fet_endchar;
400
401 fet_beginchar("Neo-mensural half rest", "1neo_mensural", "neomensminimahalfrest");
402         set_char_box(0, neomens_block_rest_x#,
403                      0, neomens_half_block_rest_y#);
404         neomens_half_block_rest;
405 fet_endchar;
406
407
408 fet_endgroup("rests")