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