3 % The stems of the natural are brushed (at least, in Barenreiter SCS)
6 def draw_natural (expr arrowup, arrowdown) =
7 save stemwidth, top_stem_thick;
8 save ne, pat_top, pat_bottom;
9 save depth, height, extendleft, extendright, stemlength;
10 save brush_scale_up, brush_scale_down;
12 path pat_top, pat_bottom;
14 top_stem_thick# = stafflinethickness# + .10 staff_space#;
15 stemwidth# = 0.09 staff_space# + .5 stafflinethickness#;
16 define_whole_blacker_pixels (top_stem_thick, stemwidth);
18 stemlength# = 1.5 staff_space#;
19 define_pixels (stemlength);
21 height# = stemlength#;
26 extendleft# := 3 stafflinethickness#;
27 height# := height# + 1.2 staff_space#;
30 extendright# := 3.15 stafflinethickness#;
31 depth# := depth# + 1.2 staff_space#;
33 define_pixels (extendright);
35 set_char_box (extendleft#, 2/3 staff_space#, depth#, height#);
37 d := d - feta_space_shift;
39 pickup pencircle scaled stemwidth;
41 brush_scale_up := 1.0;
42 brush_scale_down := 1.0;
43 % to look nice, arrowed stems must be less brushed
45 brush_scale_up := 0.85;
48 brush_scale_down := 0.85;
51 penpos1 (top_stem_thick, 0);
52 penpos3 (top_stem_thick, 0);
53 penpos2 (stemwidth, 0);
54 penpos4 (stemwidth, 0);
55 % z1' and z3' are needed for the arrowed accidentals
56 penpos1' (top_stem_thick * brush_scale_up, 0);
57 penpos3' (top_stem_thick * brush_scale_down, 0);
64 y1 = y1' = stemlength;
65 y3 = y3' = -stemlength;
66 top y2 = vround (staff_space - 3/2 stafflinethickness);
67 y4 = -y2 + feta_space_shift;
69 pat_bottom := z4r{z4r - z1r}
72 fill simple_serif (z1'l, z1'r, -30)
76 pat_top := z2r{z2r - z3r}
79 fill simple_serif (z3'l, z3'r, 30)
83 ne = (x2 - x4, stafflinethickness);
85 z11' = z3l + whatever * (z2l - z3l);
86 y11' = vround (.5 (staff_space - stafflinethickness));
87 z11 = z11' + whatever * ne;
89 z12 = directionpoint -ne of pat_top;
90 z13 = z12 + whatever * ne;
92 z14 = z11 + whatever * ne;
95 z21' = z4r + whatever * (z1r - z4r);
96 y21' = -y11' + feta_space_shift;
97 z21 = z21' + whatever * ne;
99 z22 = directionpoint -ne of pat_bottom;
100 z23 = z22 + whatever * ne;
102 z24 = z21 + whatever * ne;
116 penlabels (1, 1', 2, 3, 3', 4);
117 labels (11, 11', 12, 13, 14, 21, 21', 22, 23, 24);
120 draw_arrow (z1, top_stem_thick * brush_scale_up,
121 z1'l - z4l, stafflinethickness / 2, false);
124 draw_arrow (z3, top_stem_thick * brush_scale_down,
125 z2r - z3'r, stafflinethickness / 2, true);
126 w := w + extendright;
129 draw_staff_if_debugging (-2, 2);
133 fet_beginchar ("Natural", "natural");
134 draw_natural (false, false);
138 fet_beginchar ("Arrowed Natural (arrow up)", "natural.arrowup");
139 draw_natural (true, false);
143 fet_beginchar ("Arrowed Natural (arrow down)", "natural.arrowdown");
144 draw_natural (false, true);
148 fet_beginchar ("Arrowed Natural (arrows up and down)", "natural.arrowboth");
149 draw_natural (true, true);