2 % LilyPond's own rest(s)
4 % todo breve/longa rests
7 fet_begingroup("rests");
12 thick#:=1/16designsize;
13 define_blacker_pixels(med,thick);
15 med_pen:= pencircle scaled med;
21 def shift_pic (expr pone, ptwo) =
22 currentpicture:=currentpicture shifted (round(pone),round(ptwo))
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);
44 pickup pencircle scaled blot_diameter;
47 top y2 = block_rest_y;
57 p:=z1 -- z2 -- z3 -- z4 -- cycle;
58 draw_rounded_path(p, blot_diameter);
61 fet_beginchar( "whole rest", "0", "wholerest");
62 set_char_box(0, block_rest_x#, -block_rest_y#, 2 block_rest_y# );
64 currentpicture := currentpicture shifted (0,block_rest_y);
67 fet_beginchar("half rest", "1", "halfrest");
68 set_char_box(0, block_rest_x#, 0, block_rest_y#);
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# );
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);
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#);
87 pickup pencircle scaled stafflinethickness;
88 draw (-block_rest_y,0) .. (block_rest_x + block_rest_y,0);
91 def rest_crook(expr a, w) =
92 balled_crook(a, w, ball_crook_balldiam, ball_crook_stem)
95 fet_beginchar("Quarter rest","2","quartrest");
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);
106 y1l=7/2interline; x1l=1/3interline;
107 z2r=z1+(interline*right) rotated alpha;
109 x4=3/8interline; y4=2interline;
110 z6=z4l+(5/4interline*right) rotated alpha;
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;
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#);
125 fet_beginchar("8th rest","3","eighthrest");
126 set_char_box(0, 4/3interline#,-interline#, 8/3interline#+2stafflinethickness#);
129 x1=w-stem/6; y1=ht-flare/4;
130 rest_crook (z1,w-stem/6);
131 z2-z1=whatever*dir70;
133 brush (z1,stem/3,z2,stem);
135 currentpicture:=currentpicture shifted (0,interline);
136 % currentpicture:=currentpicture shifted (0,interline+2stafflinethickness);
139 fet_beginchar("16th rest","4","sixteenthrest");
140 set_char_box(0,4/3interline#,0, 5/3interline#+interline#+2stafflinethickness#);
142 x1=w-stem/6; y1=h-flare/4;
143 z2-z1=whatever*dir74;
145 brush (z1,stem/2,z2,stem);
146 rest_crook (z1,7/8w);
147 z3-z1=whatever*dir74;
149 rest_crook (z3,7/8w);
150 % currentpicture:=currentpicture shifted (0,2stafflinethickness);
153 fet_beginchar("32th rest","5","thirtysecondrest");
154 set_char_box(0,4/3interline#,0, 5/3interline#+2interline#+2stafflinethickness#);
156 x1=w-stem/6; y1=h-flare/4;
157 z2-z1=whatever*dir76;
159 brush (z1,stem/2,z2,stem);
160 rest_crook (z1,7/8w);
161 z3-z1=whatever*dir76;
163 rest_crook (z3,7/8w);
164 z4-z1=whatever*dir76;
166 rest_crook (z4,7/8w);
167 % currentpicture:=currentpicture shifted (0,2stafflinethickness);
170 fet_beginchar("64th rest","6","sixtyfourthrest");
171 set_char_box(0,4/3interline#,0, 5/3interline#+3interline#+2stafflinethickness#);
173 x1=w-stem/6; y1=h-flare/4;
174 z2-z1=whatever*dir78;
176 brush (z1,stem/2,z2,stem);
177 rest_crook (z1,7/8w);
178 z3-z1=whatever*dir78;
180 rest_crook (z3,7/8w);
181 z4-z1=whatever*dir78;
183 rest_crook (z4,7/8w);
184 z5-z1=whatever*dir78;
186 rest_crook (z5,7/8w);
187 % currentpicture:=currentpicture shifted (0,2stafflinethickness);
190 fet_beginchar("128th rest","7","hundredtwentyeighthrest");
191 set_char_box(0, 4/3interline#, 0, 5/3interline#+4interline#+2stafflinethickness#);
193 x1=w-stem/6; y1=h-flare/4;
194 z2-z1=whatever*dir80;
196 brush (z1,stem/2,z2,stem);
197 rest_crook (z1,7/8w);
198 z3-z1=whatever*dir80;
200 rest_crook (z3,7/8w);
201 z4-z1=whatever*dir80;
203 rest_crook (z4,7/8w);
204 z5-z1=whatever*dir80;
206 rest_crook (z5,7/8w);
207 z6-z1=whatever*dir80;
209 rest_crook (z6,7/8w);
210 % currentpicture:=currentpicture shifted (0,2stafflinethickness);
214 fet_endgroup("rests");