lilypond-1.3.20
[lilypond.git] / mf / feta-slag.mf
blob47ec9438ab9c175d812fef893daa262879f4fb83
1 % -*- Fundamental -*-  (emacs-20 mf mode mucks
2 % feta-slag.mf --  implement trill symbols
3
4 % source file of the Feta (defintively not an abbreviation for Font-En-Tja)
5 % music font
6
7 % (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
8
10 % this file is included by feta-scripts.mf
12 tfat := 1/2;
13 %twidth# := 0.5staff_space#;
14 %theight# := 0.55staff_space#;
15 % tthin# := stafflinethickness#;
16 tthin# := 1.6stafflinethickness#;
18 twidth# := 2/3staff_space#;
19 theight# := 1/2staff_space#;
21 % uhg/ uhuh?
22 % toverlap# := tfat*twidth#+tthin#;
23 toverlap# := tfat*twidth#+0.45tthin#;
24 define_pixels(twidth,theight,tthin,toverlap);
26 def draw_trillelement = 
27         save x, y;
29         pickup pencircle scaled tthin;
30         
31         lft x1 = -twidth;
32 %       x3 = -1/3*twidth;
33         x3 = -0.3*twidth;
34         top y3 = theight;
36         z3 - z1 = whatever * (0.5twidth, theight);
37         z2 = tfat[z3, z1];
39         path p;
40         p = z3 -- z2 -- z1 -- z2;
41         p := p -- (p scaled -1) -- cycle;
42         filldraw p;
43         labels(1,2,3);
44 enddef;
46 def draw_trill_two = 
47         draw_trillelement;
48         currentpicture := currentpicture shifted (-2*twidth+toverlap, 0);
49         draw_trillelement;
50         currentpicture := currentpicture shifted (twidth-0.5toverlap, 0);
51 enddef;
53 def draw_trill_three = 
54         draw_trillelement;
55         currentpicture := currentpicture shifted (-2*twidth+toverlap, 0);
56         draw_trillelement;
57         currentpicture := currentpicture shifted (-2*twidth+toverlap, 0);
58         draw_trillelement;
59         currentpicture := currentpicture shifted (2twidth-toverlap, 0);
60 enddef;
62 def draw_trill_four = 
63         draw_trillelement;
64         currentpicture := currentpicture shifted (-2*twidth+toverlap, 0);
65         draw_trillelement;
66         currentpicture := currentpicture shifted (-2*twidth+toverlap, 0);
67         draw_trillelement;
68         currentpicture := currentpicture shifted (-2*twidth+toverlap, 0);
69         draw_trillelement;
70         currentpicture := currentpicture shifted (3twidth-1.5toverlap, 0);
71 enddef;
73 def draw_mordent(expr a) = 
74         pickup pencircle scaled tthin;
75         save x, y;
76         top y1 = 4/3theight;
77         x1 = x2 = a;
78         y2 = - y1;
79         draw z1 -- z2;
80 enddef;
82 fet_beginchar("trilelement", "trilelement", "trilelement")
83 %       set_char_box(twidth#, twidth#, theight#, theight#);
84         set_char_box(twidth#, twidth#-toverlap#, theight#, theight#);
85         draw_trillelement;
86 fet_endchar;
88 fet_beginchar("prall", "prall", "prall")
89         trills := 2;
90         set_char_box(trills*twidth#-0.5toverlap#, trills*twidth#-0.5toverlap#, theight#, theight#);
91         draw_trill_two;
92 fet_endchar;
94 fet_beginchar("mordent", "mordent", "mordent")
95         trills := 2;
96         set_char_box(trills*twidth#-0.5toverlap#, trills*twidth#-0.5toverlap#, theight#, theight#);
97         draw_trill_two;
98         draw_mordent(0);
99 fet_endchar;
102 % in modern typesetting, i've seen these double symbols implemented 
103 % as three trills rather than the actual double four [gerou and lusk].
104 % it looks nicer and i don't think it introduces ambiguity.
105 % would like to have more references -- jcn.
107 fet_beginchar("prallprall", "prallprall", "prallprall")
108         trills := 3;
109         set_char_box(trills*twidth#-(trills-1)*0.5toverlap#, trills*twidth#-(trills-1)*0.5toverlap#, theight#, theight#);
110         draw_trill_three;
111 fet_endchar;
113 fet_beginchar("prallmordent", "prallmordent", "prallmordent")
114         trills := 3;
115         set_char_box(trills*twidth#-(trills-1)*0.5toverlap#, trills*twidth#-(trills-1)*0.5toverlap#, theight#, theight#);
116         draw_trill_three;
117         draw_mordent(twidth-0.5toverlap);
118 fet_endchar;
120 input feta-sleur;
123 % URG.   The attached slurs look weird, and discontinuous in their connection to the 
124 % main part.  --hwn
126 fet_beginchar("upprall", "upprall", "upprall")
127 %       trills := 4;
128         trills := 3;
129         set_char_box(trills*twidth#-(trills-1)*0.5toverlap#, trills*twidth#-(trills-1)*0.5toverlap#, theight#, theight#);
130 %       draw_slur(-2twidth#,-2theight#,0,-1);
131 %       currentpicture := currentpicture shifted (-0.5w+tthin,-tfat*theight+0.75tthin);
132         draw_slur(0,-2theight#,0,-1);
133 %       currentpicture := currentpicture shifted (-0.5w+1.3tthin,-tfat*theight+1.5tthin);
134         currentpicture := currentpicture shifted (-0.5w+1.65tthin,-tfat*theight+1.15tthin);
135 %       draw_trill_four;
136         draw_trill_three;
137 fet_endchar;
139 fet_beginchar("downprall", "downprall", "downprall")
140         trills := 3;
141         set_char_box(trills*twidth#-(trills-1)*0.5toverlap#, trills*twidth#-(trills-1)*0.5toverlap#, theight#, theight#);
142 %       draw_slur(-2twidth#,2theight#,0,1);
143         draw_slur(0,2theight#,0,1);
144 %       currentpicture := currentpicture shifted (-0.5w+tthin,-tfat*theight+0.75tthin);
145         currentpicture := currentpicture shifted (-0.5w+tthin,-tfat*theight+0.5tthin);
146         draw_trill_three;
147 fet_endchar;