lilypond-1.0.8
[lilypond.git] / mf / eindelijk.mf
blob362ed9ab12ffe52513a67014cfc9020378816422
1 % eindelijk.mf
2 % LilyPond's own rest(s)
4 % todo breve/longa rests
7 fet_begingroup("rests");
9 begingroup
11 med#:=1/33designsize;
12 thick#:=1/16designsize;
13 define_blacker_pixels(med,thick);
14 pen med_pen;
15 med_pen:= pencircle scaled med;
17 rthin:=1/8interline;
18 % rthick:=2rthin;
19 rthick:=2thick+rthin;
21 def shift_pic (expr pone, ptwo) =
22   currentpicture:=currentpicture shifted (round(pone),round(ptwo))
23 enddef;
25 % stuff for     8th,16th etc rests
27 save stem, ball_crook_stem, ball_crook_balldiam, flare;
29 define_pixels(stem,flare);
30 % stem#:=1/8interline#;
31 stem# = 1/5interline#;
32 ball_crook_stem = stem;
33 ball_crook_balldiam =flare;
34 flare# = 2/3interline#;
36 save block_rest_y, block_rest_x;
38 block_rest_y# = 1/2 interline#;
39 block_rest_x# = 3 block_rest_y#;
41 define_pixels(block_rest_y, block_rest_x);
43 def block_rest=
44         pickup pencircle scaled blot_diameter;
46         bot y1 = 0;
47         top y2 = block_rest_y;
48         y3 = y2;
49         y4 = y1;
51         rt x1 = block_rest_x;
52         x2 = x1;
53         lft x3 = 0;
54         x4 = x3;
55         save p;
56         path p;
57         p:=z1 -- z2 -- z3 -- z4 -- cycle;
58         draw_rounded_path(p, blot_diameter);
59 enddef;
61 fet_beginchar( "whole rest", "0", "wholerest");
62 set_char_box(0, block_rest_x#, -block_rest_y#, 2 block_rest_y# );
63         block_rest;
64         currentpicture := currentpicture shifted (0,block_rest_y);
65 fet_endchar;
67 fet_beginchar("half rest", "1", "halfrest");
68         set_char_box(0, block_rest_x#, 0, block_rest_y#);
69         block_rest;
70 fet_endchar;
74 % should use ledgerline thickness?
76 fet_beginchar( "whole rest (outside staff)", "0o", "outsidewholerest");
77         set_char_box(block_rest_y#, block_rest_x# + block_rest_y#, -block_rest_y#, 2 block_rest_y# );
78         block_rest;
79         currentpicture := currentpicture shifted (0,block_rest_y);
80         pickup pencircle scaled stafflinethickness;
81         draw (-block_rest_y, interline) .. (block_rest_x + block_rest_y, interline);
82 fet_endchar;
84 fet_beginchar("half rest (outside staff)", "1o", "outsidehalfrest");
85         set_char_box(block_rest_y#, block_rest_x#+ block_rest_y#, 0, block_rest_y#);
86         block_rest;
87         pickup pencircle scaled stafflinethickness;
88         draw (-block_rest_y,0) .. (block_rest_x + block_rest_y,0);
89 fet_endchar;
91 def rest_crook(expr a, w) =
92         balled_crook(a, w, ball_crook_balldiam, ball_crook_stem)
93 enddef;
95 fet_beginchar("Quarter rest","2","quartrest");
96         alpha:=-50;
97         penpos1(rthin,alpha+90);
98         penpos2(5/4rthick,alpha);
99         penpos4(5/4rthick,alpha);
100         penpos3(3/4rthick,alpha);
101         penpos6(rthin,alpha-20);
102 %       penpos6(rthick,alpha-20);
103 %       penpos7(4/3thick,alpha);
104         penpos7(5/8rthick,alpha);
105         penpos8(rthin,-10);
106         y1l=7/2interline; x1l=1/3interline;
107         z2r=z1+(interline*right) rotated alpha;
108         z3=1/2[z2,z4];
109         x4=3/8interline; y4=2interline;
110         z6=z4l+(5/4interline*right) rotated alpha;
111 %       x7l=x4l; y7r=y6l;
112         x7l=x4l; y7l=y4r;
113         x8=2/5interline; y8= 3/4 interline;
114         z5=z6r shifted (sqrt(2)*rthin/4,sqrt(2)*rthin/4);
116         pickup penrazor scaled rthin rotated 45;
117         draw z1--z2r; 
118         draw z4l--z5;
119         penstroke z2e..z3e..z4e;
120         penstroke z6e..tension1.4..z7e..tension1.4..z8e;
121         penlabels(1,2,3,4,5,6,7,8);
122         set_char_box(0, interline#, -3/4 interline#, 7/2 interline#);
123         fet_endchar;
125 fet_beginchar("8th rest","3","eighthrest");
126         set_char_box(0, 4/3interline#,-interline#, 8/3interline#+2stafflinethickness#);
127         save x,y, ht;
128         ht = h + d;
129         x1=w-stem/6; y1=ht-flare/4;
130         rest_crook (z1,w-stem/6);
131         z2-z1=whatever*dir70;
132         y2=stem/2;
133         brush (z1,stem/3,z2,stem);
134         % ugh
135         currentpicture:=currentpicture shifted (0,interline);
136 %       currentpicture:=currentpicture shifted (0,interline+2stafflinethickness);
137         fet_endchar;
139 fet_beginchar("16th rest","4","sixteenthrest");
140         set_char_box(0,4/3interline#,0, 5/3interline#+interline#+2stafflinethickness#);
141         save x,y;
142         x1=w-stem/6; y1=h-flare/4;
143         z2-z1=whatever*dir74;
144         y2=stem/2;
145         brush (z1,stem/2,z2,stem);
146         rest_crook (z1,7/8w);
147         z3-z1=whatever*dir74;
148         y3=y1-interline;
149         rest_crook (z3,7/8w);
150 %       currentpicture:=currentpicture shifted (0,2stafflinethickness);
151         fet_endchar;
153 fet_beginchar("32th rest","5","thirtysecondrest");
154         set_char_box(0,4/3interline#,0, 5/3interline#+2interline#+2stafflinethickness#);
155         save x,y;
156         x1=w-stem/6; y1=h-flare/4;
157         z2-z1=whatever*dir76;
158         y2=stem/2;
159         brush (z1,stem/2,z2,stem);
160         rest_crook (z1,7/8w);
161         z3-z1=whatever*dir76;
162         y3=y1-interline;
163         rest_crook (z3,7/8w);
164         z4-z1=whatever*dir76;
165         y4=y1-2interline;
166         rest_crook (z4,7/8w);
167 %       currentpicture:=currentpicture shifted (0,2stafflinethickness);
168         fet_endchar;
170 fet_beginchar("64th rest","6","sixtyfourthrest");
171         set_char_box(0,4/3interline#,0, 5/3interline#+3interline#+2stafflinethickness#);
172         save x,y;
173         x1=w-stem/6; y1=h-flare/4;
174         z2-z1=whatever*dir78;
175         y2=stem/2;
176         brush (z1,stem/2,z2,stem);
177         rest_crook (z1,7/8w);
178         z3-z1=whatever*dir78;
179         y3=y1-interline;
180         rest_crook (z3,7/8w);
181         z4-z1=whatever*dir78;
182         y4=y1-2interline;
183         rest_crook (z4,7/8w);
184         z5-z1=whatever*dir78;
185         y5=y1-3interline;
186         rest_crook (z5,7/8w);
187 %       currentpicture:=currentpicture shifted (0,2stafflinethickness);
188         fet_endchar;
190 fet_beginchar("128th rest","7","hundredtwentyeighthrest"); 
191         set_char_box(0, 4/3interline#, 0, 5/3interline#+4interline#+2stafflinethickness#);
192         save x,y;
193         x1=w-stem/6; y1=h-flare/4;
194         z2-z1=whatever*dir80;
195         y2=stem/2;
196         brush (z1,stem/2,z2,stem);
197         rest_crook (z1,7/8w);
198         z3-z1=whatever*dir80;
199         y3=y1-interline;
200         rest_crook (z3,7/8w);
201         z4-z1=whatever*dir80;
202         y4=y1-2interline;
203         rest_crook (z4,7/8w);
204         z5-z1=whatever*dir80;
205         y5=y1-3interline;
206         rest_crook (z5,7/8w);
207         z6-z1=whatever*dir80;
208         y6=y1-4interline;
209         rest_crook (z6,7/8w);
210 %       currentpicture:=currentpicture shifted (0,2stafflinethickness);
211         fet_endchar;
213 endgroup;
214 fet_endgroup("rests");