+def draw_slur(expr dxs,dys,d) =
+ save x, y;
+ save b, dx, dy, indent;
+ dx#:=dxs*1pt#;
+ dy#:=dys*1pt#;
+ define_pixels(dx,dy);
+ b#:=length(dx#,dy#);
+ % ugh: huh? 2/5
+ indent#:=2/5*sluralpha*atan(slurbeta*b#);
+ define_pixels(b,indent);
+ height:=indent*d;
+ z1=(0,0);
+ z2=(b,0);
+ z3=(indent,height);
+ z4=(b-indent,height);
+ z5=z4-(0,d*slurthick);
+ z6=z3-(0,d*slurthick);
+ path boogje;
+ boogje=z1..controls z3 and z4..z2..controls z5 and z6..cycle;
+ boogje:=boogje rotated angle(dxs,dys);
+ pickup pencircle scaled sleur_pen;
+ filldraw boogje;
+ show z1;
+ show z2;
+ show z3;
+ show z4;
+ show z5;
+ show z6;
+enddef;
+
+def slurchar(expr dxs,dys,d) =