+fet_beginchar("Coda", "coda", "coda")
+ save thin, thick, codawidth, codaheight;
+ thin# = 1.2 stafflinethickness#;
+ thick# = 3.5 stafflinethickness#;
+ codawidth# = 2/3 staff_space#;
+ codaheight# = 1 staff_space#;
+ define_pixels(thin, thick, codawidth, codaheight);
+
+ set_char_box(codawidth#+thick#, codawidth#+thick#,
+ codaheight#+thick#, codaheight#+thick#);
+
+ penpos1(thick,0);
+ penpos2(thin,-90);
+ penpos3(thick,180);
+ x1l=-codawidth;
+ y2l=codaheight;
+ y1=0;
+ x2=0;
+ z3 = - z1;
+ penlabels(1,2,3);
+
+ path halfcoda;
+ halfcoda := z1l{up} .. z2l{right} .. z3l{down} --
+ z3r{up} .. z2r{left} .. z1r{down} .. cycle;
+ fill halfcoda;
+ fill (halfcoda scaled -1);
+
+ draw_gridline((0,-h),(0,h),thin);
+ draw_gridline((-w,0),(w,0),thin);
+
+fet_endchar;
+
+def draw_comma =
+ save alpha, thick, thin, ht;
+ alpha:=35;
+ thin# = 1.2 stafflinethickness#;
+ thick# = 3 stafflinethickness#;
+ ht# = .6staff_space#;
+ define_pixels(thin, thick,ht);
+ set_char_box(0, .5staff_space#, ht#, ht#);
+
+ penpos1(thick, alpha);
+ penpos2(thick, alpha+90);
+ penpos3(thin, 180-alpha);
+ penpos4(thin, 90-alpha);
+ x3r=0;
+ x1l=x3l;
+ y2r=-y4l=h;
+ z1=z2;
+ z3=z4;
+ penlabels(1,2,3,4);
+ fill z1l{dir (alpha+90)} .. z2r{dir alpha} .. z1r{dir (alpha-90)} ..
+ z3l{dir (270-alpha)} .. z4l{dir (alpha+180)} ..
+ z3r{dir (90-alpha)} .. cycle;
+enddef;
+
+fet_beginchar("Right Comma","rcomma","rcomma");
+ draw_comma;
+fet_endchar;
+
+fet_beginchar("Left Comma","lcomma","lcomma");
+ draw_comma;
+ xy_mirror_char;
+fet_endchar;
+
+thick#:=1/24designsize;
+define_blacker_pixels(thick);
+
+rthin:=1/8*staff_space;
+rthick:=2thick+rthin;
+
+def draw_arpeggio =
+ save alpha;
+ alpha:=-40;
+ save ne,nw,se,sw; pair ne,nw,se,sw;
+ save x,y;
+
+ se=dir alpha; nw=dir (alpha+180);
+ ne=dir (alpha+90); sw=dir (alpha-90);
+ penpos1(rthin,alpha+90);
+ penpos2(5/4rthick,alpha);
+ penpos4(5/4rthick,alpha);
+ penpos5(rthin,alpha+90);
+ penpos3(3/4rthick,alpha);
+
+ z1=(width/2, height) - overshoot*se;
+ z2=2[z4,(width/2,height/2)];
+ z3=1/2[z2,z4];
+ x4=2/8staff_space;
+ y4=rthin;
+
+ z5=2[z1,(width/2,height/2)];
+ z6=z2l+1/2rthin*sw;
+ z7=z4l+1/2rthin*sw+1/2rthin*se;
+ z8=2[z6,(width/2,height/2)];
+ z9=2[z7,(width/2,height/2)];
+
+ fill z1l{se}..{se}z6..z3l..z7{se}..{se}z5l..z5r{nw}..{nw}z8..z3r..z9{nw}..{nw}z1r.. cycle;
+ penlabels(1,2,3,4,5,6,7,8,9);
+ enddef;
+
+fet_beginchar("Arpeggio","arpeggio","arpeggio");
+ %draw_staff (-2, 2, 0.0);
+ save height, overshoot, width;
+ height# = staff_space#;
+ width# = 0.8height#;
+ overshoot# = 0.25 staff_space#;
+ define_pixels (height,overshoot,width);
+ set_char_box(0, width#, 0, height#);
+ draw_arpeggio;
+ fet_endchar;
+
+% Extendable Trill symbol.
+% Not yet used
+% Rename me to Trill, rename Trill to Tr?
+fet_beginchar("Trill-element","trill-element","trillelement");
+ save height, overshoot;
+ height# = staff_space#;
+ width# = 0.8height#;
+ overshoot# = 0.25 staff_space#;
+ define_pixels (height,overshoot,width);
+ set_char_box(0, height#, 0, width#);
+ draw_arpeggio;
+ currentpicture := currentpicture shifted -(width/2, height/2);
+ currentpicture := currentpicture rotated 90;
+ currentpicture := currentpicture shifted (height/2, width/2);
+ fet_endchar;
+
+
+
+%
+% Arpeggio arrow by Chris Jackson <chris@fluffhouse.org.uk>
+%
+
+def draw_arpeggio_arrow =
+ save thinness, height, width, overshoot, se, sw, ne, nw, alpha;
+ pair ne, nw, se, sw;
+ height# = staff_space#;
+ width# = 0.8height#;
+ overshoot# = 0.25 staff_space#;
+ define_pixels (height,overshoot,width);
+ set_char_box(0, width#, 0, height#);
+ alpha := -40;
+ nw = dir (alpha+180);
+ sw = dir (alpha-90); se = dir alpha;
+
+ penpos1(rthin, alpha+90);
+ penpos2(5/4 rthick, alpha);
+ penpos3(5/4 rthick, 0);
+
+ z1 = (width/2, height) - overshoot*se; % numbering is consistent with the arpeggio symbol
+ z2 = 2[z4,(width/2,height/2)];
+ z3 = (0.5 width, 0.5 height);
+ z4 = (0.25 staff_space, rthin);
+ z6 = z2l + 1/2rthin*sw;
+ z9 = (width/2, height) + overshoot*se;
+ fill z1l {se}..{se} z6 .. z3l .. z3r.. z9{nw} ..{nw} z1r.. cycle;
+
+ bot z10 = ( 0.5w, 0 );
+ lft z11 = (-0.3w, 0.8h);
+ rt z12 = ( 1.3w, 0.8h);
+ pickup pencircle scaled 0.5 rthin;
+ filldraw z3 -- z12 {dir -130} .. {dir -110} z10 {dir 110} .. {dir 130} z11 -- cycle;
+enddef;
+
+fet_beginchar("Arpeggio arrow down", "arpeggio-arrow--1", "arpeggioarrowdown");
+ draw_arpeggio_arrow;
+fet_endchar;
+
+
+fet_beginchar("Arpeggio arrow up", "arpeggio-arrow-1", "arpeggioarrowup");
+ draw_arpeggio_arrow;
+ currentpicture := currentpicture scaled -1 shifted (0.8staff_space, staff_space);
+fet_endchar;
+
+
+
+
+% Hmm
+input feta-slag;