]> git.donarmstrong.com Git - lilypond.git/blob - mf/feta-slag.mf
partial: 0.1.50.jcn
[lilypond.git] / mf / feta-slag.mf
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 <jan@digicash.com>
8
9
10 % this file is included by feta-scripts.mf
11
12 tfat := 0.3;
13 twidth# := 0.5interline#;
14 theight# := 0.55interline#;
15 tthin# := stafflinethickness#;
16 toverlap# := tfat*twidth#+tthin#;
17 define_pixels(twidth,theight,tthin,toverlap);
18
19 def draw_trillelement = 
20         save x, y;
21
22         pickup pencircle scaled tthin;
23         
24         lft x1 = -twidth;
25         x3 = -tfat*twidth;
26         top y3 = theight;
27
28         z3 - z1 = whatever * (0.5twidth, theight);
29         z2 = tfat[z3, z1];
30
31         path p;
32         p = z3 -- z2 -- z1 -- z2;
33         p := p -- (p scaled -1) -- cycle;
34         filldraw p;
35         labels(1,2,3);
36 enddef;
37
38 def draw_trill_two = 
39         draw_trillelement;
40         currentpicture := currentpicture shifted (-2*twidth+toverlap, 0);
41         draw_trillelement;
42         currentpicture := currentpicture shifted (twidth-0.5toverlap, 0);
43 enddef;
44
45 def draw_trill_three = 
46         draw_trillelement;
47         currentpicture := currentpicture shifted (-2*twidth+toverlap, 0);
48         draw_trillelement;
49         currentpicture := currentpicture shifted (-2*twidth+toverlap, 0);
50         draw_trillelement;
51         currentpicture := currentpicture shifted (2twidth-toverlap, 0);
52 enddef;
53
54 def draw_trill_four = 
55         draw_trillelement;
56         currentpicture := currentpicture shifted (-2*twidth+toverlap, 0);
57         draw_trillelement;
58         currentpicture := currentpicture shifted (-2*twidth+toverlap, 0);
59         draw_trillelement;
60         currentpicture := currentpicture shifted (-2*twidth+toverlap, 0);
61         draw_trillelement;
62         currentpicture := currentpicture shifted (3twidth-1.5toverlap, 0);
63 enddef;
64
65 def draw_mordent(expr a) = 
66         pickup pencircle scaled tthin;
67         save x, y;
68         top y1 = 4/3theight;
69         x1 = x2 = a;
70         y2 = - y1;
71         draw z1 -- z2;
72 enddef;
73
74 fet_beginchar("trilelement", "trilelement", "trilelement")
75 %       set_char_box(twidth#, twidth#, theight#, theight#);
76         set_char_box(twidth#, twidth#-toverlap#, theight#, theight#);
77         draw_trillelement;
78 fet_endchar;
79
80 fet_beginchar("prall", "prall", "prall")
81         trills := 2;
82         set_char_box(trills*twidth#-0.5toverlap#, trills*twidth#-0.5toverlap#, theight#, theight#);
83         draw_trill_two;
84 fet_endchar;
85
86 fet_beginchar("mordent", "mordent", "mordent")
87         trills := 2;
88         set_char_box(trills*twidth#-0.5toverlap#, trills*twidth#-0.5toverlap#, theight#, theight#);
89         draw_trill_two;
90         draw_mordent(0);
91 fet_endchar;
92
93
94 % in modern typesetting, i've seen these double symbols implemented 
95 % as three trills rather than the actual double four [gerou and lusk].
96 % it looks nicer and i don't think it introduces ambiguity.
97 % would like to have more references -- jcn.
98
99 fet_beginchar("prallprall", "prallprall", "prallprall")
100         trills := 3;
101         set_char_box(trills*twidth#-(trills-1)*0.5toverlap#, trills*twidth#-(trills-1)*0.5toverlap#, theight#, theight#);
102         draw_trill_three;
103         draw_mordent(twidth);
104 fet_endchar;
105
106 fet_beginchar("prallmordent", "prallmordent", "prallmordent")
107         trills := 3;
108         set_char_box(trills*twidth#-(trills-1)*0.5toverlap#, trills*twidth#-(trills-1)*0.5toverlap#, theight#, theight#);
109         draw_trill_three;
110         draw_mordent(twidth-toverlap);
111 fet_endchar;
112
113 input feta-sleur;
114
115 fet_beginchar("upprall", "upprall", "upprall")
116 %       trills := 4;
117         trills := 3;
118         set_char_box(trills*twidth#-(trills-1)*0.5toverlap#, trills*twidth#-(trills-1)*0.5toverlap#, theight#, theight#);
119         draw_slur(-2twidth#,-2theight#,-1);
120         currentpicture := currentpicture shifted (-0.5w+1.5tthin,-tfat*theight);
121 %       draw_trill_four;
122         draw_trill_three;
123 fet_endchar;
124
125 fet_beginchar("downprall", "downprall", "downprall")
126         trills := 3;
127         set_char_box(trills*twidth#-(trills-1)*0.5toverlap#, trills*twidth#-(trills-1)*0.5toverlap#, theight#, theight#);
128         draw_slur(-2twidth#,2theight#,1);
129         currentpicture := currentpicture shifted (-0.5w+1.5tthin,-tfat*theight);
130         draw_trill_three;
131 fet_endchar;
132