]> git.donarmstrong.com Git - lilypond.git/blob - mf/feta-slag.mf
release: 1.0.1
[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 <janneke@gnu.org>
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 twidth# := 2/3interline#;
19 theight# := 1/2interline#;
20
21 % uhg/ uhuh?
22 % toverlap# := tfat*twidth#+tthin#;
23 toverlap# := tfat*twidth#+0.45tthin#;
24 define_pixels(twidth,theight,tthin,toverlap);
25
26 def draw_trillelement = 
27         save x, y;
28
29         pickup pencircle scaled tthin;
30         
31         lft x1 = -twidth;
32 %       x3 = -1/3*twidth;
33         x3 = -0.3*twidth;
34         top y3 = theight;
35
36         z3 - z1 = whatever * (0.5twidth, theight);
37         z2 = tfat[z3, z1];
38
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;
45
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;
52
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;
61
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;
72
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;
81
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;
87
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;
93
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;
100
101
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.
106
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         draw_mordent(twidth-0.5toverlap);
112 fet_endchar;
113
114 fet_beginchar("prallmordent", "prallmordent", "prallmordent")
115         trills := 3;
116         set_char_box(trills*twidth#-(trills-1)*0.5toverlap#, trills*twidth#-(trills-1)*0.5toverlap#, theight#, theight#);
117         draw_trill_three;
118         draw_mordent(twidth-0.5toverlap);
119 fet_endchar;
120
121 input feta-sleur;
122
123 fet_beginchar("upprall", "upprall", "upprall")
124 %       trills := 4;
125         trills := 3;
126         set_char_box(trills*twidth#-(trills-1)*0.5toverlap#, trills*twidth#-(trills-1)*0.5toverlap#, theight#, theight#);
127 %       draw_slur(-2twidth#,-2theight#,0,-1);
128 %       currentpicture := currentpicture shifted (-0.5w+tthin,-tfat*theight+0.75tthin);
129         draw_slur(0,-2theight#,0,-1);
130 %       currentpicture := currentpicture shifted (-0.5w+1.3tthin,-tfat*theight+1.5tthin);
131         currentpicture := currentpicture shifted (-0.5w+1.65tthin,-tfat*theight+1.15tthin);
132 %       draw_trill_four;
133         draw_trill_three;
134 fet_endchar;
135
136 fet_beginchar("downprall", "downprall", "downprall")
137         trills := 3;
138         set_char_box(trills*twidth#-(trills-1)*0.5toverlap#, trills*twidth#-(trills-1)*0.5toverlap#, theight#, theight#);
139 %       draw_slur(-2twidth#,2theight#,0,1);
140         draw_slur(0,2theight#,0,1);
141 %       currentpicture := currentpicture shifted (-0.5w+tthin,-tfat*theight+0.75tthin);
142         currentpicture := currentpicture shifted (-0.5w+tthin,-tfat*theight+0.5tthin);
143         draw_trill_three;
144 fet_endchar;
145