% solfa.mf - implements solfa shaped notes
%
-% (c) 2001--2004 Glen Prideaux <glenprideaux@iname.com>
+% (c) 2001--2005 Glen Prideaux <glenprideaux@iname.com>
% We can use the regular distorted-elliptical head in the feta font
% for the sol head, but we can't use the triangle or diamond heads for
fet_begingroup("solfa");
-noteheight#:=staff_space#+ (overdone_heads) *stafflinethickness#;
+noteheight#:=staff_space# + overdone_heads * stafflinethickness#;
define_pixels(noteheight);
-%%%%%%%%
-%
-%
-% SOLFA SHAPED NOTES
-%
-%
-save pent;
-pent# = stafflinethickness#;
-define_pixels(pent);
-
-def generic_drawnoteshape =
- save a,beta,black,white;
- path black, white;
-
- pickup pencircle scaled pent;
- 2 beta# = noteheight#;
- a# = a_b*beta#;
- wid# := 2a#+pent#;
- hei# := noteheight#+pent#;
- set_char_box(0, wid#,0.5 hei#, 0.5 hei#);
-
- define_pixels(a,beta);
-
- black = noteshape xscaled a yscaled beta shifted (a+pent/2,0);
- filldraw black;
-
- if (solid=false):
- white = noteishape xscaled (a*ai_a) yscaled (beta*bi_b)
- shifted ((dx+1)*(a+pent/2),dy*(beta+pent/2));
- unfill white;
- fi;
-enddef;
-
-def drawnoteshape =
- save solid; boolean solid;
- solid=false;
- generic_drawnoteshape;
-enddef;
-def drawquarternoteshape =
- save solid; boolean solid;
- solid=true;
- generic_drawnoteshape;
-enddef;
-
-% do - equilateral triangle: (0,-h/2) -- (w/2,h/2) -- (w,-h/2) -- cycle;
-% stem attachment: -h/2
-
-save triangle; path triangle;
-triangle := (-1,-1) -- (0,1) -- (1,-1) -- cycle;
+fet_endgroup("solfa")
def drawdoshape =
save noteshape, noteishape, dx, dy, ai_a, bi_b;
path noteshape, noteishape;
noteshape = noteishape = triangle;
- (dx,dy)=(0,0.05);
+ (dx,dy)=(0,0.0);
(ai_a,bi_b)=(i_o,i_o);
- drawnoteshape;
+ draw_solfa_note_shape;
enddef;
-fet_beginchar("Whole dohead", "0do", "wholedohead")
+
+fet_beginchar("Whole dohead", "s0do")
pickup pencircle scaled blot_diameter;
save a_b, i_o;
a_b = 1.8;
drawdoshape;
fet_endchar;
-fet_beginchar("Half dohead", "1do", "halfdohead")
+fet_beginchar("Half dohead", "s1do")
save a_b, i_o;
a_b = 1.5;
i_o = 0.6;
drawdoshape;
fet_endchar;
-fet_beginchar("Quart dohead", "2do", "dohead")
+fet_beginchar("Quart dohead", "s2do")
save a_b, noteshape;
path noteshape;
a_b = 1.54;
noteshape = triangle;
- drawquarternoteshape;
+ draw_solfa_quarter_note_shape;
fet_endchar;
-
-% re - flat top, curved bottom:
-% (0,h/2) {dir -90} .. (w/2,-h/2) .. {dir 90} (w,h/2) -- cycle;
-% (broader along the base and with more vertical sides for half and
-% whole notes)
-% stem attachment: h/2
-
save reshape; path reshape;
reshape = (-1,1)--(-1,0.2){down} ... (0,-1) ... {up}(1,0.2)--(1,1)--cycle;
-fet_beginchar("Whole rehead", "0re", "wholerehead")
+fet_beginchar("Whole rehead", "s0re")
save a_b, ai_a, bi_b, dx, dy, noteshape, noteishape;
path noteshape, noteishape;
noteshape = reshape;
bi_b = 0.65;
ai_a = 0.8;
(dx,dy)=(0,-0.1);
- drawnoteshape;
+ draw_solfa_note_shape;
fet_endchar;
-fet_beginchar("Half rehead", "1re", "halfrehead")
+fet_beginchar("Half rehead", "s1re")
save a_b, ai_a, bi_b, dx, dy, noteshape, noteishape;
path noteshape, noteishape;
noteshape = reshape;
bi_b = 0.65;
ai_a = 0.8;
(dx,dy)=(0,-0.1);
- drawnoteshape;
+ draw_solfa_note_shape;
fet_endchar;
-fet_beginchar("Quart rehead", "2ro", "rehead")
+fet_beginchar("Quart rehead", "s2re")
save a_b, noteshape;
path noteshape;
a_b = 1.54;
noteshape = reshape;
- drawquarternoteshape;
+ draw_solfa_quarter_note_shape;
fet_endchar;
-% me - diamond: (0,0) -- (w/2,h/2) -- (w,0) -- (w/2,-h/2) -- cycle;
-% similar to existing diamond shaped head, but not quite the same
-% stem attachment: 0
-
-save meshape; path meshape;
-meshape = (-1,0)--(0,1)--(1,0)--(0,-1)--cycle;
-
-fet_beginchar("Whole mehead", "0me", "wholemehead")
- save a_b, ai_a, bi_b, dx, dy, noteshape, noteishape;
- path noteshape, noteishape;
- noteshape = meshape;
- noteishape = (meshape slanted -0.35) rotated -10.5;
- a_b = 1.8;
- bi_b = 0.65;
- ai_a = 0.7;
- (dx,dy)=(0,0);
- drawnoteshape;
-fet_endchar;
-
-fet_beginchar("Half mehead", "1me", "halfmehead")
- save a_b, ai_a, bi_b, dx, dy, noteshape, noteishape;
- path noteshape, noteishape;
- noteshape = meshape;
- noteishape = (meshape slanted -0.35) rotated -10.5;
- a_b = 1.5;
- bi_b = 0.65;
- ai_a = 0.7;
- (dx,dy)=(0,0);
- drawnoteshape;
-fet_endchar;
-fet_beginchar("Quart mehead", "2me", "mehead")
- save a_b, noteshape;
- path noteshape;
- a_b = 1.54;
-
- noteshape = meshape;
- drawquarternoteshape;
-fet_endchar;
% fa - scalene triangle:
save fashape; path fashape;
fashape = (-1,1)--(1,1)--(1,-1)--cycle;
-fet_beginchar("Whole fahead", "0fa", "wholefahead")
+fet_beginchar("Whole fahead", "s0fa")
save a_b, ai_a, bi_b, dx, dy, noteshape, noteishape;
path noteshape, noteishape;
noteshape = fashape;
bi_b = 0.6;
ai_a = 0.6;
(dx,dy)=(0.2,.05);
- drawnoteshape;
+ draw_solfa_note_shape;
fet_endchar;
-fet_beginchar("Half stemup fahead", "1fau", "halffauhead")
+fet_beginchar("Half stemup fahead", "u1fa")
save a_b, ai_a, bi_b, dx, dy, noteshape, noteishape;
path noteshape, noteishape;
noteshape = fashape;
bi_b = 0.6;
ai_a = 0.6;
(dx,dy)=(0.2,.05);
- drawnoteshape;
+ draw_solfa_note_shape;
fet_endchar;
-fet_beginchar("Quart stemup fahead", "2fau", "fauhead")
+fet_beginchar("Quart stemup fahead", "u2fa")
save a_b, noteshape;
path noteshape;
a_b = 1.54;
noteshape = fashape;
- drawquarternoteshape;
+ draw_solfa_quarter_note_shape;
fet_endchar;
-fet_beginchar("Half stemdn fahead", "1fad", "halffadhead")
+fet_beginchar("Half stemdn fahead", "d1fa")
save a_b, ai_a, bi_b, dx, dy, noteshape, noteishape;
path noteshape, noteishape;
noteshape = fashape rotated 180;
bi_b = 0.6;
ai_a = 0.6;
(dx,dy)=(-0.2,-.05);
- drawnoteshape;
+ draw_solfa_note_shape;
fet_endchar;
-fet_beginchar("Quart stemdn fahead", "2fad", "fadhead")
+fet_beginchar("Quart stemdn fahead", "d2fa")
save a_b, noteshape;
path noteshape;
a_b = 1.54;
noteshape = fashape rotated 180;
- drawquarternoteshape;
+ draw_solfa_quarter_note_shape;
fet_endchar;
% sol - oval ... the standard "round" note
+
% la - rectangle: (0,h/2)--(w,h.2)--(w,-h/2)--(0,-h/2)--cycle;
% stem attachment: (doesn't much matter)
save lashape; path lashape;
lashape = (-1,-1)--(-1,1)--(1,1)--(1,-1)--cycle;
-fet_beginchar("Whole lahead", "0la", "wholelahead")
+fet_beginchar("Whole lahead", "s0la")
save a_b, ai_a, bi_b, dx, dy, noteshape, noteishape;
path noteshape, noteishape;
noteshape = lashape;
bi_b = 0.6;
ai_a = 0.85;
(dx,dy)=(0,0);
- drawnoteshape;
+ draw_solfa_note_shape;
fet_endchar;
-fet_beginchar("Half lahead", "1la", "halflahead")
+fet_beginchar("Half lahead", "s1la")
save a_b, ai_a, bi_b, dx, dy, noteshape, noteishape;
path noteshape, noteishape;
noteshape = lashape;
bi_b = 0.6;
ai_a = 0.85;
(dx,dy)=(0,0);
- drawnoteshape;
+ draw_solfa_note_shape;
fet_endchar;
-fet_beginchar("Quart lahead", "2la", "lahead")
+fet_beginchar("Quart lahead", "s2la")
save a_b, noteshape;
path noteshape;
a_b = 1.54;
noteshape = lashape;
- drawquarternoteshape;
+ draw_solfa_quarter_note_shape;
fet_endchar;
-% te - an "icecream cone" with about 2/3 of
+
+% ti - an "icecream cone" with about 2/3 of
% the height in the cone and only 1/3 in the curved top:
% (0,h/6)--(w/2,-h/2)--(w,h/6)..(w/2,h/2)..cycle;
% stem attachment: h/6
-save teshape; path teshape;
-teshape = (0,-1)--(-1,0.3)..(0,1)..(1,0.3)--cycle;
+save tishape; path tishape;
+tishape = (0,-1)--(-1,0.3)..(0,1)..(1,0.3)--cycle;
-fet_beginchar("Whole tehead", "0te", "wholetehead")
+fet_beginchar("Whole tihead", "s0ti")
save a_b, ai_a, bi_b, dx, dy, noteshape, noteishape;
path noteshape, noteishape;
- noteshape = teshape;
- noteishape = teshape;
+ noteshape = tishape;
+ noteishape = tishape;
a_b = 1.8;
bi_b = 0.75;
ai_a = 0.75;
(dx,dy)=(0,-.02);
- drawnoteshape;
+ draw_solfa_note_shape;
fet_endchar;
-fet_beginchar("Half tehead", "1te", "halftehead")
+fet_beginchar("Half tihead", "s1ti")
save a_b, ai_a, bi_b, dx, dy, noteshape, noteishape;
path noteshape, noteishape;
- noteshape = teshape;
- noteishape = teshape;
+ noteshape = tishape;
+ noteishape = tishape;
a_b = 1.5;
bi_b = 0.75;
ai_a = 0.75;
(dx,dy)=(0,-.02);
- drawnoteshape;
+ draw_solfa_note_shape;
fet_endchar;
-fet_beginchar("Quart tehead", "2te", "tehead")
+fet_beginchar("Quart tihead", "s2ti")
save a_b, noteshape;
path noteshape;
a_b = 1.54;
- noteshape = teshape;
- drawquarternoteshape;
+ noteshape = tishape;
+ draw_solfa_quarter_note_shape;
fet_endchar;
-fet_endgroup("solfa")
+