]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.17
authorfred <fred>
Sun, 24 Mar 2002 19:58:42 +0000 (19:58 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:58:42 +0000 (19:58 +0000)
lily/tex-beam.cc
tex/taupindefs.tex

index 5bc8ebbfcce0a22f9a82cc1470c2b3a6cc5206a1..193e6d4e6f42f8089053191ecc4110e109139abf 100644 (file)
 #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);
@@ -39,7 +42,7 @@ Lookup::beam_element (int sidx, int widx, Real slope) const
 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;
@@ -49,9 +52,9 @@ slope_index (Real &s)
 
   s = i/20.0;
   if (s>0)
-    return 6*i +122;
+    return 6*i;
   else
-    return -6 * i+ 186;
+    return -6 * i;
 }
 
 Atom
@@ -73,13 +76,18 @@ Lookup::beam (Real &slope, Real width) const
   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;
   
@@ -92,16 +100,15 @@ Lookup::beam (Real &slope, Real width) const
   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);
   
index 769d2a48800e2fb29a55de08d307238f3b6da1fe..290e711cb904970eec8c78f987600c1526f8b423 100644 (file)
@@ -1,8 +1,8 @@
-
+\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
@@ -14,7 +14,7 @@
         \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}}
+