]> git.donarmstrong.com Git - lilypond.git/blob - mf/feta-accordion.mf
release: 1.3.44
[lilypond.git] / mf / feta-accordion.mf
1 % -*- Fundamental -*-
2
3 accreg_dot_size# := .5staff_space#;
4 accreg_linethickness# := 1.3stafflinethickness#;
5
6 % This dimention is the same on all registersymbols.
7 % The different symbols should calculate their other
8 % dimensions from this and accreg_dot_size
9 accreg_lh# := 1.0staff_space#;
10
11 define_pixels(accreg_dot_size, accreg_linethickness, accreg_lh);
12 pen accreg_pen;
13 accreg_pen := pencircle xscaled accreg_linethickness yscaled 0.7accreg_linethickness;
14
15 fet_beginchar("accDiscant", "accDiscant", "accDiscant")
16         save r, sx;
17         r# = 3/2accreg_lh#;
18         define_pixels(r);
19 %       set_char_box(r#, r#, 2r#, 0);
20         set_char_box(r#, r#, 0r#, 2r#); %% arg3 = under linjen, arg4 = over
21         pickup accreg_pen;
22         draw fullcircle scaled 2r;
23         sx = cosd(19.471221);
24         draw (-sx*r, r/3)--(sx*r, r/3);
25         draw (-sx*r, -r/3)--(sx*r, -r/3);
26         currentpicture := currentpicture shifted (0, r);
27 fet_endchar;
28
29 fet_beginchar("accDot", "accDot", "accDot")
30         set_char_box(accreg_dot_size#, accreg_dot_size#, 0, 0);
31         pickup pencircle scaled accreg_dot_size;
32         draw(0, 0);
33 fet_endchar;
34
35 fet_beginchar("accFreebase", "accFreebase", "accFreebase")
36         save r;
37         r#= accreg_lh#;
38         define_pixels(r);
39         set_char_box(r#, r#, 0, 2r#);
40         pickup accreg_pen;
41         draw fullcircle scaled 2r;
42         draw (-r, 0)--(r, 0);
43         currentpicture := currentpicture shifted (0, r);
44 fet_endchar;
45
46 fet_beginchar("accStdbase", "accStdbase", "accStdbase")
47         save r, sx;
48         r# = 2accreg_lh#;
49         define_pixels(r);
50         sx = cosd 30 ;
51         set_char_box(r#, r#, 0, 2r#);
52         pickup accreg_pen;
53         draw fullcircle scaled 2r;
54         draw (-r, 0)--(r, 0);
55         draw (-sx*r, r/2)--(sx*r, r/2);
56         draw (-sx*r, -r/2)--(sx*r, -r/2);
57         currentpicture := currentpicture shifted (0, r);
58 fet_endchar;
59
60 %%% strange turning path.
61 fet_beginchar("accBayanbase", "accBayanbase", "accBayanbase")
62         save lh;
63         lh = accreg_lh;
64 %       set_char_box(accreg_lh#, accreg_lh#, 3accreg_lh#, 0);
65         set_char_box(accreg_lh#, accreg_lh#, 0, 3accreg_lh#);
66         pickup pencircle scaled accreg_linethickness;
67         %draw (0, 0)--(2w, 0)--(2w, 3accreg_lh)--(0, 3accreg_lh)--(0, 0);
68         draw (0, 0)--(2w, 0)--(2w, 3accreg_lh)--(0, 3accreg_lh)--cycle;
69         draw (0, accreg_lh)--(2w, accreg_lh);
70         draw (0, 2accreg_lh)--(2w, 2accreg_lh);
71         currentpicture := currentpicture shifted (-w, 0);% -3lh);
72 fet_endchar;
73
74 def def_B(expr w, h) = 
75         % huh?
76         % pickup pencircle scaled 0.1pt;
77         pickup pencircle scaled 0.15stafflinethickness;
78         penpos10(thin, -90);
79         penpos11(thin, -90);
80         penpos12(thick, 0);
81         penpos13(thin, 90);
82         penpos14(thin, 90);
83
84         penpos15(thick, 180);
85         penpos16(thin, -90);
86         penpos17(thin, -90);
87         penpos18(thick, 0);
88         penpos19(thick, 0);
89         z10 = (0, 0);
90         z11 = (cOne*w, 0);
91         z12 = (w, .5mb*h);
92         z13 = (cTwo*w, mb*h);
93         z14 = (2thick, mb*h);
94         z15 = (.94w, h-.5mt*h);
95         z16 = z13 + (0, mt*h);
96         z17 = (0, h);
97         z18 = (1.5thick, 0);
98         z19 = (1.5thick, h);
99 enddef;
100
101 def def_S(expr w, h) =
102         % huh?
103         %pickup pencircle scaled 0.02pt;
104         pickup pencircle scaled 0.03stafflinethickness;
105         penpos1(thin, 180);
106         penpos2(thin, -90);
107         penpos3(thick, 0);
108         penpos4(.5thick, 90);
109         penpos5(thick, 0);
110         penpos6(thin, -90);
111         penpos7(thin, 180);
112         penpos8(thin, 180);
113         penpos9(thin, 0);
114         z1 = (0, hs);
115         z2 = (w/2, 0);
116         z3 = (w-.5thick, .5mb*h);
117         z4 = (w/2, mb*h);
118         z5 = (.5thick, h-.5mt*h);
119         z6 = (w/2, h);
120         z7 = (w, h-hs);
121         z8 = (0, y2r);
122         z9 = (w, y6l);
123         path bue, bueoverst;
124         bue=z2{left}..z1{up};
125         numeric t;
126         t:=xpart(bue intersectiontimes(z8l--z7l));
127         show t;
128         bueoverst=z6{right}..z7{down};
129 enddef;
130
131 def def_some_vars =
132         save hs, mb, mt, thin, thick, height, width, cOne, cTwo;
133         width = .8staffsize;
134         height = 2.4staff_space;
135         % URG.  smaller sizes should be wider and fatter
136         %thin = 0.05staff_space;
137         %thick = 0.2staff_space;
138         save bx,hx; 4hx+bx=1.15; 10hx+bx=1;
139         fatten:=designsize*hx+bx*1.2;
140         thick:= 0.2staff_space*fatten;
141         % urg: mustn't ever go thinner than blot!
142         thin#:= blot_diameter#;
143         define_pixels (thin);
144
145         hs = 0.4staff_space;
146         mb = .53;
147         mt = .47;       
148         cOne = 0.65;
149         cTwo = 0.60;
150 enddef;
151
152 def print_penpos (suffix $)=
153         message str $ &": ("&decimal x.$.l&", "&decimal y.$.l&"); ("&decimal x.$.r&", "&decimal y.$.r&");";
154 enddef;
155
156 fet_beginchar("accSB", "accSB", "accSB")
157         set_char_box(.4staffsize#, .4staffsize#, 0, 2.4staff_space#);
158         def_some_vars;
159         def_B(.35width, .7height);
160
161         penstroke z10e--z11e{right}..z12e..z13e{left}--z14e;
162         penlabels(10, 11, 12, 13, 14);
163
164         penstroke z13e{right}..z15e{up}..z16e{left}--z17e;
165         penstroke z18e--z19e;
166         pickup pencircle scaled .5thick;
167         drawdot (.37width, .10thick);
168         currentpicture := currentpicture shifted(.40width, 0);
169
170         def_S(.35width, .7height);
171         penlabels(1, 2, 3, 4, 5, 6, 7, 8, 9);
172         filldraw z1r--z8r--z8l--subpath(t, 1) of bue--cycle;
173         filldraw subpath(t, 1) of bueoverst--z7l--z9r--z9l--cycle;
174         penstroke z1e{down}..z2e{right}..z3e
175                 ..z4e
176                 ..z5e..z6e{right}...z7e{down};
177         pickup pencircle scaled .5thick;
178         drawdot (.37width, .10thick);
179         currentpicture := currentpicture shifted (-.40width, -.85height);
180         draw (-.5width, 0)--(.5width, 0)--(.5width, -height)
181                 --(-.5width, -height)--(-.5width, 0);
182         currentpicture := currentpicture shifted (0, 2.4staff_space);
183 fet_endchar;
184
185 fet_beginchar("accBB", "accBB", "accBB")
186         set_char_box(.4staffsize#, .4staffsize#, 0, 2.4staff_space#);
187         def_some_vars;
188         def_B(.35width, .7height);
189
190         penstroke z10e--z11e{right}..z12e{up}..z13e{left}--z14e;
191
192         penstroke z13e{right}..z15e{up}..z16e{left}--z17e;
193         penstroke z18e--z19e;
194         penlabels(1, 2, 3, 4, 5, 6, 7, 8, 9);
195         pickup pencircle scaled .5thick;
196         drawdot(.37width, .10thick);
197         currentpicture := currentpicture shifted (.40width, 0);
198         penstroke z10e--z11e{right}..z12e{up}..z13e{left}--z14e;
199         penstroke z13e{right}..z15e{up}..z16e{left}--z17e;
200         penstroke z18e--z19e;
201         drawdot(.37width, .10thick);
202         currentpicture := currentpicture shifted(-.40width, -.85height);
203         draw (-.5width, 0)--(.5width, 0)--(.5width, -height)
204                 --(-.5width, -height)--(-.5width, 0);
205         penlabels(10, 11, 12, 13, 14, 15, 16, 17, 18, 19 );
206         currentpicture := currentpicture shifted (0, 2.4staff_space);
207 fet_endchar;
208
209
210 %%% strange turning path.
211 fet_beginchar("accOldEE", "accOldEE", "accOldEE")
212         set_char_box(staff_space#, staff_space#, 0, 2staff_space#);
213         show w;
214         show h;
215         r = staff_space;
216         lr = .3staff_space;
217         ir = .6staff_space;
218         pickup accreg_pen;
219         draw fullcircle scaled 2r;
220         pickup penrazor;
221         filldraw fullcircle scaled lr;
222         z1 = (ir, 0);
223         z2 = (0, 0) + ir*(dir 45);
224         z3 = (0, ir);
225         numeric pp;
226         for pp := 0 step 45 until 360:
227                 filldraw fullcircle scaled lr shifted (ir*(dir pp));
228         endfor;
229         for pp := 0 step 45 until 360:
230                 filldraw ((0, 0)--(.2lr, ir)--(-.2lr, ir)--cycle) rotated pp;
231         endfor
232         currentpicture := currentpicture shifted (0, r);
233 fet_endchar;
234
235 fet_beginchar("accOldEES", "accOldEES", "accOldEES")
236         set_char_box(staff_space#, staff_space#, 0, 2staff_space#);
237         save r, shy;
238         r = staff_space;
239         shy = .3;
240         pickup accreg_pen;
241         draw fullcircle scaled 2r;
242         currentpicture := currentpicture shifted (w/2, shy*h);
243         save thin, thick, sw, ch, cw, mb, mt;
244         ch = .6h;
245         cw = .8w;
246         % URG.  smaller sizes should be wider and fatter
247         %thin = .05cw;
248         %thick = .17w;
249         save bx,hx; 4hx+bx=1.15; 10hx+bx=1;
250         fatten:=designsize*hx+bx*1.2;
251         thick:= .17w*fatten;
252
253         % urg: mustn't ever go thinner than blot!
254         %thin = 0.05staff_space;
255         %blot#:=.4pt#;
256         thin#:= blot_diameter#;
257         define_pixels (thin);
258
259
260         hs = 0.4staff_space;
261
262         mb = .53; mt = .47;
263         sw = .8thick;
264         z1 = (0, ch-.5thin); penpos1 (thin, -90);
265         z2 = (.7cw, y1); penpos2 (thin, -90);
266         z3 = (cw, (mb+.5mt)*ch); penpos3(thick, -180);
267         z4 = (.65cw, mb*ch); penpos4(thin, 90);
268         z5 = (sw+thick, mb*ch); penpos5(thin, 90);
269         z6 = (.9cw, .5mb*ch); penpos6(thick, 0);
270         z7 = (1.2cw, 0); penpos7(thin, 90);
271         z8 = (1.3cw, .2mb*ch); penpos8(thin, 180);
272         penlabels(1, 2, 3, 4, 5, 6, 7, 8);
273
274         %%AAARG
275         pickup pencircle scaled 0.001pt;
276         filldraw (0, 0)--(0, thin)--(sw, thin)--(sw, ch-thin)
277                 --(sw+thick, ch-thin)--(sw+thick, thin)
278                 --(2sw+thick, thin)--(2sw+thick, 0)--cycle;
279
280         penstroke z1e--z2e{right}..z3e..z4e{left}--z5e;
281
282         penstroke z4e{right}..z6e{down}..z7e{right}..z8e{up};
283         currentpicture := currentpicture shifted (-w/2, -shy*h);
284         currentpicture := currentpicture shifted (0, r);
285 fet_endchar;