#include "dimen.hh"
#include "debug.hh"
#include "lookup.hh"
+#include "misc.hh"
Atom
Lookup::beam_element (int sidx, int widx, Real slope) const
{
- Atom bs=(*symtables_)("beamslopes")->lookup ("slope");
+ char dir_char = slope >0 ? 'u' : 'd';
+ String name = dir_char + String("slope");
+ Atom bs=(*symtables_)("beamslopes")->lookup (name);
Array<String> args;
args.push (sidx);
static int
slope_index (Real &s)
{
- if (abs (s) > 0.5)
+ if (abs (s) > 0.5)
{
WARN << "beam steeper than 0.5 (" << s << ")\n";
s = sign (s) * 0.5;
s = i/20.0;
if (s>0)
- return 6*i +122;
+ return 6*i;
else
- return -6 * i+ 186;
+ return -6 * i;
}
Atom
int sidx = slope_index (slope);
if (!slope)
return rule_symbol (2 PT, width);
- if (width < 2 PT)
+
+ Interval xdims = (*symtables_)("beamslopes")->lookup ("uslope").dim_[X_AXIS];
+ Real min_wid = xdims[LEFT];
+ Real max_wid = xdims[RIGHT];
+
+ if (width < min_wid)
{
WARN<<"Beam too narrow. (" << print_dimen (width) <<")\n";
- width = 2 PT;
+ width = min_wid;
}
- Real elemwidth = 64 PT;
- int widx = 5;
+ Real elemwidth = max_wid;
+ int widx = intlog2 (int (max_wid/min_wid));
Molecule m;
Real last_x = width - elemwidth;
Real x = overlap;
Atom elem (beam_element (sidx, widx, slope));
- Atom a (elem);
- m.add (a);
+ m.add (elem);
while (x < last_x)
{
- a=elem;
+ Atom a(elem);
a.translate (Offset (x-overlap, (x-overlap)*slope));
m.add (a);
x += elemwidth - overlap;
}
- a=elem;
+ Atom a(elem);
a.translate (Offset (last_x, (last_x) * slope));
m.add (a);
-
+\input fetdefs
\def\musixtwentyfonts{
\font\normaltextfont=cmr10 %\textfont is a primitive
\font\smalltextfont=cmr8
- \font\meterfont=cmbx12
+ \font\meterfont=cmbx15
\font\slurufont=xslu20
\font\slurdfont=xsld20
\font\slurhfont=xslz20
\font\italicfont=cmti10
\font\dynfont=dyn10 scaled \magstep2
\font\musicmathfont=cmsy10
- \font\fontentja=font-en-tja20
+ \fettwentydefs
}
\font\dynfont=dyn10 scaled \magstep1
\font\musicdraw=musixsps
\font\musicmathfont=cmsy8
- \font\fontentja=font-en-tja16
+ \fetsixteendefs
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% provide interface to musixtex fonts
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% \def\fetdef#1#2{\def#1{\fetchar{#2}}}
-% ugh, linewidth, ugh, tablexx.ly balldims not used!
-\def\fetdef#1#2{\def#1{\lower.5\staffrulethickness\hbox{\fetchar{#2}}}}
-\def\fetchar#1{\fontentja\char#1}
-% \musicdef\quartball{'007}
-% \musicdef\halfball{'010}
-% \musicdef\wholeball{'011}
-\fetdef\quartball{'002}
-\fetdef\halfball{'001}
-\fetdef\wholeball{'000}
\musicdef\breveball{'040}
\musicdef\longaball{'047}
\musicdef\halfrest{'074}
\musicdef\downbow{22}
\def\tr{{\it tr}}
+
+\def\beamuslope#1#2{{\count0=#2\advance\count0 by#1
+ \advance\count0 by 122
+ \musicfnt\char\count0}}
+\def\beamdslope#1#2{{\count0=#2\advance\count0 by#1
+ \advance\count0 by 186
+ \musicfnt\char\count0}}
+