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