summaryrefslogtreecommitdiff
path: root/muse2/share/scoreglyphs/feta-original/parmesan-timesig.mf
blob: 8d0ab9d45cfb2ba9216b9c6deba36cbfecf8135f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
% -%-Fundamental-%- -*-Metafont-*-
% parmesan-timesig.mf -- implement ancient time signatures
% 
% source file of LilyPond's pretty-but-neat music font
% 
% (c) 1998--2009 Mats Bengtsson <matsb@s3.kth.se>,
%		 Christian Mondrup <scancm@biobase.dk>
% (c) 2002--2009 Juergen Reuter <reuter@ipd.uka.de>
% 

fet_begingroup ("timesig");


path threequartercircle;

threequartercircle := halfcircle & quartercircle rotated 180;

save mensural_Cdiameter, mensural_Cthickness, mensural_Chairpin;

mensural_Cdiameter# := 3/2 staff_space#;
mensural_Cthickness# := 2 linethickness#;
mensural_Chairpin# := 0.5 linethickness#;

define_pixels (mensural_Cdiameter, mensural_Cthickness, mensural_Chairpin);


%%%%%%%%
%
%
%
% MENSURAL NOTATION
%
%
%

def draw_nail (expr bottom_left, top_right) =
	save round;

	round = floor min (blot_diameter,
			   xpart (top_right-bottom_left),
			   ypart (top_right-bottom_left));

	pickup pencircle scaled round;

	z2 + (round / 2, round / 2) = top_right +
					(mensural_Cthickness / 2, 0);
	z4 - (round / 2,round / 2) = bottom_left;
	y3 = y2;
	y4 = y1;
	x2 = x1 + mensural_Cthickness / 2;
	x2 - x1 = x4 - x3;
	x5 = x1;
	x6 = x4;
	y5 = y6 = y2 - 2 mensural_Cthickness;

	fill bot z1{right}
	     .. rt z1{up}
	     -- rt z5{up}
	     .. rt z2
	     .. top z2{left}
	     -- top z3{left}
	     .. lft z3
	     .. lft z6{down}
	     -- lft z4{down}
	     .. bot z4{right}
	     -- cycle;

%	labels (1, 2, 3, 4, 5, 6);
enddef;


def mensural_timesig (expr verbose_name, internal_name,
			   full_circle, reverse_circle, slashed, dotted) =
	fet_beginchar (verbose_name, internal_name);
		if slashed:
			set_char_box (
			  0,
			  mensural_Cdiameter# + mensural_Cthickness#,
			  .75 (mensural_Cdiameter# + mensural_Cthickness#),
			  .75 (mensural_Cdiameter# + mensural_Cthickness#));

			if (full_circle or dotted):
				draw_nail ((-mensural_Cthickness / 2, -d),
					   (mensural_Cthickness / 2, h));
			elseif reverse_circle:
				draw_nail ((0, -d), (mensural_Cthickness, h));
			else:
				draw_nail ((-mensural_Cthickness, -d), (0, h));
			fi;
		else:
			set_char_box (
			  0,
			  mensural_Cdiameter# + mensural_Cthickness#,
			  .5 (mensural_Cdiameter# + mensural_Cthickness#),
			  .5 (mensural_Cdiameter# + mensural_Cthickness#));
		fi;

		save ellipse, pat;
		path ellipse, pat;

		ellipse := fullcircle xscaled mensural_Cthickness
				      yscaled mensural_Chairpin;

		save rot;

		if reverse_circle:
			rot := 225;
		else:
			rot := 45;
		fi;

		if full_circle:
			pat := fullcircle scaled mensural_Cdiameter;

			fill get_subpoint (ellipse,
					   direction 0 of pat,
					   point 0 of pat)
			     for i = 1 step 1 until length pat:
				     .. get_subpoint (ellipse,
						      direction i of pat,
						      point i of pat)
			     endfor
			     .. cycle;
			unfill get_subpoint (ellipse,
					     -direction 0 of pat,
					     point 0 of pat)
			       for i = 1 step 1 until length pat:
				       .. get_subpoint (ellipse,
							-direction i of pat,
							point i of pat)
			       endfor
			       .. cycle;
		else:
			pat := threequartercircle rotated rot
						  scaled mensural_Cdiameter;

			fill get_subpath (ellipse,
					  -direction 0 of pat,
					  direction 0 of pat,
					  point 0 of pat)
			     for i = 1 step 1 until (length pat - 1):
				     .. get_subpoint (ellipse,
						      direction i of pat,
						      point i of pat)
			     endfor
			     .. get_subpath (ellipse,
					     direction infinity of pat,
					     -direction infinity of pat,
					     point infinity of pat)
			     for i = (length pat - 1) step -1 until 1:
				     .. get_subpoint (ellipse,
						      -direction i of pat,
						      point i of pat)
			     endfor
			     .. cycle;
		fi;

		if dotted:
			pickup pencircle scaled 4 linethickness;
			drawdot (0, 0);
		fi;

		currentpicture := currentpicture
				    shifted 0.5 (mensural_Cdiameter
						 + mensural_Cthickness, 0);
	fet_endchar;
enddef;


%% tempus imperfectum cum prolatione imperfecta
mensural_timesig ("Mensural 4/4 meter", "mensural44",
		  false, false, false, false);


%% tempus imperfectum cum prolatione imperfecta proportio dupla
mensural_timesig ("Mensural 2/2 meter", "mensural22",
		  false, false, true, false);


%% tempus perfectum cum prolatione imperfecta
mensural_timesig ("Mensural 3/2 meter", "mensural32",
		  true, false, false, false);


%% tempus imperfectum cum prolatione perfecta
mensural_timesig ("Mensural 6/4 meter", "mensural64",
		  false, false, false, true);


%% tempus perfectum cum prolatione perfecta
mensural_timesig ("Mensural 9/4 meter", "mensural94",
		  true, false, false, true);


%% tempus perfectum cum prolatione imperfecta proportio dupla
mensural_timesig ("Mensural 3/4 meter", "mensural34",
		  true, false, true, false);


%% tempus imperfectum cum prolatione perfecta proportio dupla
mensural_timesig ("Mensural 6/8 meter", "mensural68",
		  false, false, true, true);


%% tempus perfectum cum prolatione perfecta proportio dupla
mensural_timesig ("Mensural 9/8 meter", "mensural98",
		  true, false, true, true);

	
%% tempus imperfectum cum prolatione imperfecta diminutio simplex
mensural_timesig ("Mensural 4/8 meter", "mensural48",
		  false, true, false, false);


%% tempus imperfectum cum prolatione perfecta diminutio simplex
mensural_timesig ("Mensural 6/8 meter", "mensural68alt",
		  false, true, false, true);


%% tempus imperfectum cum prolatione imperfecta diminutio duplex
mensural_timesig ("Mensural 2/4 meter", "mensural24",
		  false, true, true, false);


%%%%%%%%
%
%
%
% NEO-MENSURAL NOTATION
%
%
%

save neomensural_Cdiameter, neomensural_Cthickness;

neomensural_Cdiameter# := 3/2 staff_space#;
neomensural_Cthickness# := 2 linethickness#;

define_pixels (neomensural_Cdiameter, neomensural_Cthickness);


def neomensural_timesig (expr verbose_name, internal_name,
			      full_circle, reverse_circle, slashed, dotted) =
	fet_beginchar (verbose_name, internal_name);
		set_char_box (
		  0,
		  neomensural_Cdiameter# + neomensural_Cthickness#,
		  .5 (neomensural_Cdiameter# + neomensural_Cthickness#),
		  .5 (neomensural_Cdiameter# + neomensural_Cthickness#));

		if slashed:
			pickup penrazor scaled neomensural_Cthickness;

			save t;
			t := neomensural_Cthickness / 2;

			if (full_circle or dotted):
				draw (0, -d + t)
				     -- (0, h - t);
			elseif reverse_circle:
				draw (t, -d + t)
				     -- (t, h - t);
			else:
				draw (-t, -d + t)
				     -- (-t, h - t);
			fi;
		fi;

		save ellipse, pat;
		path ellipse, pat;

		ellipse := fullcircle scaled neomensural_Cthickness;

		save rot;

		if reverse_circle:
			rot := 225;
		else:
			rot := 45;
		fi;

		if full_circle:
			pat := fullcircle scaled neomensural_Cdiameter;

			fill get_subpoint (ellipse,
					   direction 0 of pat,
					   point 0 of pat)
			     for i = 1 step 1 until length pat:
				     .. get_subpoint (ellipse,
						      direction i of pat,
						      point i of pat)
			     endfor
			     .. cycle;
			unfill get_subpoint (ellipse,
					     -direction 0 of pat,
					     point 0 of pat)
			       for i = 1 step 1 until length pat:
				       .. get_subpoint (ellipse,
							-direction i of pat,
							point i of pat)
			       endfor
			       .. cycle;
		else:
			pat := threequartercircle rotated rot
						  scaled neomensural_Cdiameter;

			fill get_subpath (ellipse,
					  -direction 0 of pat,
					  direction 0 of pat,
					  point 0 of pat)
			     for i = 1 step 1 until (length pat - 1):
				     .. get_subpoint (ellipse,
						      direction i of pat,
						      point i of pat)
			     endfor
			     .. get_subpath (ellipse,
					     direction infinity of pat,
					     -direction infinity of pat,
					     point infinity of pat)
			     for i = (length pat - 1) step -1 until 1:
				     .. get_subpoint (ellipse,
						      -direction i of pat,
						      point i of pat)
			     endfor
			     .. cycle;
		fi;

		if dotted:
			pickup pencircle scaled 4 linethickness;
			drawdot (0, 0);
		fi;

		currentpicture := currentpicture
				     shifted 0.5 (neomensural_Cdiameter
						  + neomensural_Cthickness, 0);
	fet_endchar;
enddef;


%% tempus imperfectum cum prolatione imperfecta
neomensural_timesig ("Mensural 4/4 meter", "neomensural44",
		     false, false, false, false);


%% tempus imperfectum cum prolatione imperfecta proportio dupla
neomensural_timesig ("Mensural 2/2 meter", "neomensural22",
		     false, false, true, false);


%% tempus perfectum cum prolatione imperfecta
neomensural_timesig ("Mensural 3/2 meter", "neomensural32",
		     true, false, false, false);


%% tempus imperfectum cum prolatione perfecta
neomensural_timesig ("Mensural 6/4 meter", "neomensural64",
		     false, false, false, true);


%% tempus perfectum cum prolatione perfecta
neomensural_timesig ("Mensural 9/4 meter", "neomensural94",
		     true, false, false, true);


%% tempus perfectum cum prolatione imperfecta proportio dupla
neomensural_timesig ("Mensural 3/4 meter", "neomensural34",
		     true, false, true, false);


%% tempus imperfectum cum prolatione perfecta proportio dupla
neomensural_timesig ("Mensural 6/8 meter", "neomensural68",
		     false, false, true, true);


%% tempus perfectum cum prolatione perfecta proportio dupla
neomensural_timesig ("Mensural 9/8 meter", "neomensural98",
		     true, false, true, true);

	
%% tempus imperfectum cum prolatione imperfecta diminutio simplex
neomensural_timesig ("Mensural 4/8 meter", "neomensural48",
		     false, true, false, false);


%% tempus imperfectum cum prolatione perfecta diminutio simplex
neomensural_timesig ("Mensural 6/8 meter", "neomensural68alt",
		     false, true, false, true);


%% tempus imperfectum cum prolatione imperfecta diminutio duplex
neomensural_timesig ("Mensural 2/4 meter", "neomensural24",
		     false, true, true, false);


fet_endgroup ("timesig");