\newdimen\interlinedist
\newcount\n
\newdimen\balkhoog
+ \newdimen\notewidth
+ \newdimen\notewidthhalf
+ \newdimen\notewidthdouble
\newdimen\staffrulethickness
\newdimen\interstaffrule
\font\hslurhfont=xslhz20
\font\musicfnt=musix20
\balkhoog=20pt
+ \notewidth=6pt
\staffrulethickness=0.4pt
\musixcalc
\font\musicfnt=musix16
\balkhoog=16pt
\staffrulethickness=0.4pt
-
+ \notewidth=5pt
\musixcalc
}
\advance\interstaffrule by-\staffrulethickness
\divide\interstaffrule by 4
\advance\interstaffrule by -\staffrulethickness
+ \notewidthhalf=\notewidth
+ \notewidthdouble=\notewidth
+ \divide \notewidthhalf by 2
+ \multiply \notewidthdouble by 2
}
}}
\def\toplines#1{ % why space needed here?
- \vbox to 0pt{\hbox{\kern-6pt\lines{#1}{12pt}}\vss}}
+ \vbox to 0pt{\hbox{\kern-\notewidth\lines{#1}{\notewidthdouble}}\vss}}
\def\botlines#1{ % idem ditto
- \vbox to 0pt{\vss\hbox{\kern-6pt\lines{#1}{12pt}}}}
+ \vbox to 0pt{\vss\hbox{\kern-\notewidth\lines{#1}{\notewidthdouble}}}}
%
% a staffsymbol with #1 lines, width #2
\def\csixteenthrest{\vcenter\sixteenthrest}
\def\cthirtysecondrest{\vcenter\thirtysecondrest}
-\def\lsingledot{\kern-6pt\singledot}
-\def\ldoubledot{\kern-6pt\doubledot}
-\def\ltripledot{\kern-6pt\tripledot}
+\def\lsingledot{\kern-\notewidth\singledot}
+\def\ldoubledot{\kern-\notewidth\doubledot}
+\def\ltripledot{\kern-\notewidth\tripledot}
int sidx = slope_index(slope);
if (!slope)
return rule_symbol(convert_dimen(2,"pt"), width);
-
- Real w = width;
+ if (width < convert_dimen(2,"pt"))
+ error("Beam too narrow. " );
+
Real elemwidth = convert_dimen(64,"pt");
int widx = 5;
Molecule m;
- Real dy=0;
- Real minwid =convert_dimen(2,"pt");
- assert(w > minwid);
- while (w > minwid) {
- while (elemwidth > w) {
- widx --;
- elemwidth /= 2.0;
- }
-
- Atom a(beam_element(sidx, widx, slope));
- a.translate(Offset(0, dy));
- m.add_right(a);
- dy += elemwidth*slope;
- w -= elemwidth;
+
+ while (elemwidth > width) {
+ widx --;
+ elemwidth /= 2.0;
}
-
- widx = 0;
- Atom a(beam_element(sidx, widx, slope));
- a.translate(Offset(width -minwid, (width-minwid) * slope));
+ Real overlap = elemwidth/4;
+ Real last_x = width - elemwidth;
+ Real x = overlap;
+ Atom elem(beam_element(sidx, widx, slope));
+ Atom a(elem);
+ m.add(a);
+ while (x < last_x) {
+ a=elem;
+ a.translate(Offset(x-overlap, (x-overlap)*slope));
+ m.add(a);
+ x += elemwidth - overlap;
+ }
+ a=elem;
+ a.translate(Offset(last_x, (last_x) * slope));
m.add(a);
Symbol ret;