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# = 5/8 interline#;
39 block_rest_x# = 3/2 interline#;
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#, -interline# + block_rest_y#, interline# );
64 currentpicture := currentpicture shifted (0,interline - 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#,
78 -interline# + block_rest_y#, interline#);
80 currentpicture := currentpicture shifted (0,interline - block_rest_y);
81 pickup pencircle scaled ledgerlinethickness;
82 draw (-block_rest_y, interline)
83 .. (block_rest_x + block_rest_y, interline);
86 fet_beginchar("half rest (outside staff)", "1o", "outsidehalfrest");
87 set_char_box(block_rest_y#, block_rest_x#+ block_rest_y#,
90 pickup pencircle scaled ledgerlinethickness;
91 draw (-block_rest_y,0) .. (block_rest_x + block_rest_y,0);
94 def rest_crook(expr a, w) =
95 balled_crook(a, w, ball_crook_balldiam, ball_crook_stem)
98 fet_beginchar("Quarter rest","2","quartrest");
100 penpos1(rthin,alpha+90);
101 penpos2(5/4rthick,alpha);
102 penpos4(5/4rthick,alpha);
103 penpos3(3/4rthick,alpha);
104 penpos6(rthin,alpha-20);
105 % penpos6(rthick,alpha-20);
106 % penpos7(4/3thick,alpha);
107 penpos7(5/8rthick,alpha);
109 y1l=7/2interline; x1l=1/3interline;
110 z2r=z1+(interline*right) rotated alpha;
112 x4=3/8interline; y4=2interline;
113 z6=z4l+(5/4interline*right) rotated alpha;
116 x8=2/5interline; y8= 3/4 interline;
117 z5=z6r shifted (sqrt(2)*rthin/4,sqrt(2)*rthin/4);
119 pickup penrazor scaled rthin rotated 45;
122 penstroke z2e..z3e..z4e;
123 penstroke z6e..tension1.4..z7e..tension1.4..z8e;
124 penlabels(1,2,3,4,5,6,7,8);
125 set_char_box(0, interline#, -3/4 interline#, 7/2 interline#);
128 fet_beginchar("8th rest","3","eighthrest");
129 set_char_box(0, 4/3interline#,-interline#, 8/3interline#+2stafflinethickness#);
132 x1=w-stem/6; y1=ht-flare/4;
133 rest_crook (z1,w-stem/6);
134 z2-z1=whatever*dir70;
136 brush (z1,stem/3,z2,stem);
138 currentpicture:=currentpicture shifted (0,interline);
139 % currentpicture:=currentpicture shifted (0,interline+2stafflinethickness);
142 fet_beginchar("16th rest","4","sixteenthrest");
143 set_char_box(0,4/3interline#,0, 5/3interline#+interline#+2stafflinethickness#);
145 x1=w-stem/6; y1=h-flare/4;
146 z2-z1=whatever*dir74;
148 brush (z1,stem/2,z2,stem);
149 rest_crook (z1,7/8w);
150 z3-z1=whatever*dir74;
152 rest_crook (z3,7/8w);
153 % currentpicture:=currentpicture shifted (0,2stafflinethickness);
156 fet_beginchar("32th rest","5","thirtysecondrest");
157 set_char_box(0,4/3interline#,0, 5/3interline#+2interline#+2stafflinethickness#);
159 x1=w-stem/6; y1=h-flare/4;
160 z2-z1=whatever*dir76;
162 brush (z1,stem/2,z2,stem);
163 rest_crook (z1,7/8w);
164 z3-z1=whatever*dir76;
166 rest_crook (z3,7/8w);
167 z4-z1=whatever*dir76;
169 rest_crook (z4,7/8w);
170 % currentpicture:=currentpicture shifted (0,2stafflinethickness);
173 fet_beginchar("64th rest","6","sixtyfourthrest");
174 set_char_box(0,4/3interline#,0, 5/3interline#+3interline#+2stafflinethickness#);
176 x1=w-stem/6; y1=h-flare/4;
177 z2-z1=whatever*dir78;
179 brush (z1,stem/2,z2,stem);
180 rest_crook (z1,7/8w);
181 z3-z1=whatever*dir78;
183 rest_crook (z3,7/8w);
184 z4-z1=whatever*dir78;
186 rest_crook (z4,7/8w);
187 z5-z1=whatever*dir78;
189 rest_crook (z5,7/8w);
190 % currentpicture:=currentpicture shifted (0,2stafflinethickness);
193 fet_beginchar("128th rest","7","hundredtwentyeighthrest");
194 set_char_box(0, 4/3interline#, 0, 5/3interline#+4interline#+2stafflinethickness#);
196 x1=w-stem/6; y1=h-flare/4;
197 z2-z1=whatever*dir80;
199 brush (z1,stem/2,z2,stem);
200 rest_crook (z1,7/8w);
201 z3-z1=whatever*dir80;
203 rest_crook (z3,7/8w);
204 z4-z1=whatever*dir80;
206 rest_crook (z4,7/8w);
207 z5-z1=whatever*dir80;
209 rest_crook (z5,7/8w);
210 z6-z1=whatever*dir80;
212 rest_crook (z6,7/8w);
213 % currentpicture:=currentpicture shifted (0,2stafflinethickness);
217 fet_endgroup("rests");