]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/font.scm (paper20-font-vector): add bold-narrow series (only
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 5 Jan 2004 01:04:25 +0000 (01:04 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 5 Jan 2004 01:04:25 +0000 (01:04 +0000)
cmb10).

* lily/lyric-extender.cc (brew_molecule): add little space before
extender line.

* lily/beam-quanting.cc (score_forbidden_quants): check if
outer stafflines fall in any beam gaps.

* scm/define-grobs.scm (all-grob-descriptions): use bold-narrow
for lyric texts.

ChangeLog
input/mutopia/F.Schubert/morgenlied.ly
lily/beam-quanting.cc
lily/beam.cc
lily/include/beam.hh
lily/lyric-extender.cc
mf/GNUmakefile
scm/define-grobs.scm
scm/font.scm

index d67763390980b5b3a8df399bbc0b5cfe78a82e38..32307b1730859ef9989c1cf3807706e8de507c64 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,21 @@
+2004-01-05  Han-Wen Nienhuys   <hanwen@cs.uu.nl>
+
+       * scm/font.scm (paper20-font-vector): add bold-narrow series (only
+       cmb10).
+
+       * lily/lyric-extender.cc (brew_molecule): add little space before
+       extender line.
+
+       * lily/beam-quanting.cc (score_forbidden_quants): check if
+       outer stafflines fall in any beam gaps.
+
+       * scm/define-grobs.scm (all-grob-descriptions): use bold-narrow
+       for lyric texts.
+
 2004-01-04  Han-Wen Nienhuys   <hanwen@cs.uu.nl>
 
+       * VERSION: 2.1.6 released.
+
        * lily/beam-quanting.cc (quanting): add inspect-quants property:
        this shows the demerits of a user-defined beam position pair.
 
index 64d5b3466b962000618c859710dcec81848a7f7a..9cebde2262929db9feb2a2676cdc9470a8b5a9f1 100644 (file)
@@ -92,7 +92,7 @@ pianoRH = \notes \relative c''' \repeat volta 2 {
     r8_\> << { s8 s8-\! }  << { fis( g)
                            } \\ { c,4 } >> >> r8 <e c g> <e c g> |
     <d c a>4. r8 \clef bass  <d b f> <d b f> |
-    e,16_" "_\markup { \italic cresc } g c g e g d gis b gis d gis |
+    e,16_" "_\markup { \bold\italic cresc } g c g e g d gis b gis d gis |
     c, e a e c e a,-\f d fis d a d |
     b d g  d b g r4\fermata \clef treble g''8 |
     as4.( g 4.) | fis4. r4 <d g>8 ( |
@@ -148,12 +148,12 @@ pianoLH = \notes \relative c'' \repeat volta 2 {
        \translator {
            \LyricsVoiceContext
            minimumVerticalExtent = #'(-1.0 . 0)
-           LyricText \set #'font-size = #1.0
        }
        \translator {
            \ScoreContext
            Beam \override #'thickness = #0.6
            SpacingSpanner \set #'spacing-increment = #1.0
+           Slur \set #'height-limit = #1.0
        }
        \translator {  \PianoStaffContext
                VerticalAlignment \override #'forced-distance = #10
index e9ce43840459e77058b2f37996be4b4b9c022f71..54b308f326704bdc038b8e33ed74c5b3ef430597 100644 (file)
@@ -31,7 +31,6 @@ const int DAMPING_DIRECTIION_PENALTY = 800;
 const int MUSICAL_DIRECTION_FACTOR = 400;
 const int IDEAL_SLOPE_FACTOR = 10;
 
-// #define DEBUG_QUANTING 1
 extern bool debug_beam_quanting_flag;
 
 static Real
@@ -277,8 +276,6 @@ Beam::quanting (SCM smob)
        }
       if (mindist > 1e5)
        programming_error ("Could not find quant.");
-      else
-       qscores[best_idx].score_card_ += to_string ("i%d", best_idx);
     }
 #endif
   
@@ -288,6 +285,8 @@ Beam::quanting (SCM smob)
 #if DEBUG_QUANTING
   if (debug_beam_quanting_flag)
     {
+      qscores[best_idx].score_card_ += to_string ("i%d", best_idx);
+      
       // debug quanting
       me->set_grob_property ("quant-score",
                             scm_makfrom0str (qscores[best_idx].score_card_.to_str0 ()));
@@ -401,17 +400,49 @@ Beam::score_forbidden_quants (Real yl, Real yr,
                              Direction ldir, Direction rdir)
 {
   Real dy = yr - yl;
-
-  Real extra_demerit = SECONDARY_BEAM_DEMERIT / beam_count;
+  Drul_array<Real> y(yl,yr);
+  Drul_array<Direction> dirs(ldir,rdir);
   
+  Real extra_demerit = SECONDARY_BEAM_DEMERIT / beam_count;
+
+  /*
+    Inside the staff, inter quants are forbidden.
+   */
   Real dem = 0.0;
-  for (int i = 0; i < 2; i++)
+  Direction d = LEFT;
+  do
     {
-      Real y = i? yl : yr;
-      if (fabs (y) <= (radius + 0.5) && fabs ( my_modf (y) - 0.5) < 1e-3)
+      if (fabs (y[d]) <= (radius + 0.5) && fabs (my_modf (y[d]) - 0.5) < 1e-3)
        dem += INTER_QUANT_PENALTY;
     }
+  while ((flip (&d))!= LEFT); 
+
 
+  for (int j = 1; j <= beam_count; j++)
+    {
+      do
+       {
+         /*
+           see if the outer staffline falls in a beam-gap
+           
+           This test is too weak; we should really check all lines.
+          */
+         Direction stem_dir = dirs[d];
+         Real gap1 =  y[d] - stem_dir * ((j-1) * beam_translation + thickness / 2 - slt/2 );
+         Real gap2 = y[d] - stem_dir * (j * beam_translation - thickness / 2 + slt/2);
+
+         Interval gap;
+         gap.add_point (gap1);
+         gap.add_point (gap2);
+
+         if (gap.elem_b (radius))
+           dem += extra_demerit;
+       }
+      while ((flip (&d))!= LEFT); 
+    }
+
+
+  
   // todo: use beam_count of outer stems.
   if (beam_count >= 2)
     {
@@ -420,69 +451,52 @@ Beam::score_forbidden_quants (Real yl, Real yr,
       Real inter = 0.5;
       Real hang = 1.0 - (thickness - slt) / 2;
 
-      if (fabs (yl - ldir * beam_translation) < radius
-         && fabs (my_modf (yl) - inter) < 1e-3)
-       dem += extra_demerit;
-      if (fabs (yr - rdir * beam_translation) < radius
-         && fabs (my_modf (yr) - inter) < 1e-3)
-       dem += extra_demerit;
-
       Real eps = 1e-3;
 
-      /*
-       Can't we simply compute the distance between the nearest
-       staffline and the secondary beam? That would get rid of the
-       silly case analysis here (which is probably not valid when we
-       have different beam-thicknesses.)
-
-       --hwn
-       */
-
-
       // hmm, without Interval/Drul_array, you get ~ 4x same code...
-      if (fabs (yl - ldir * beam_translation) < radius + inter)
+      if (fabs (y[LEFT] - dirs[LEFT] * beam_translation) < radius + inter)
        {
-         if (ldir == UP && dy <= eps
-             && fabs (my_modf (yl) - sit) < eps)
+         if (dirs[LEFT] == UP && dy <= eps
+             && fabs (my_modf (y[LEFT]) - sit) < eps)
            dem += extra_demerit;
          
-         if (ldir == DOWN && dy >= eps
-             && fabs (my_modf (yl) - hang) < eps)
+         if (dirs[LEFT] == DOWN && dy >= eps
+             && fabs (my_modf (y[LEFT]) - hang) < eps)
            dem += extra_demerit;
        }
 
-      if (fabs (yr - rdir * beam_translation) < radius + inter)
+      if (fabs (y[RIGHT] - dirs[RIGHT] * beam_translation) < radius + inter)
        {
-         if (rdir == UP && dy >= eps
-             && fabs (my_modf (yr) - sit) < eps)
+         if (dirs[RIGHT] == UP && dy >= eps
+             && fabs (my_modf (y[RIGHT]) - sit) < eps)
            dem += extra_demerit;
          
-         if (rdir == DOWN && dy <= eps
-             && fabs (my_modf (yr) - hang) < eps)
+         if (dirs[RIGHT] == DOWN && dy <= eps
+             && fabs (my_modf (y[RIGHT]) - hang) < eps)
            dem += extra_demerit;
        }
       
       if (beam_count >= 3)
        {
-         if (fabs (yl - 2 * ldir * beam_translation) < radius + inter)
+         if (fabs (y[LEFT] - 2 * dirs[LEFT] * beam_translation) < radius + inter)
            {
-             if (ldir == UP && dy <= eps
-                 && fabs (my_modf (yl) - straddle) < eps)
+             if (dirs[LEFT] == UP && dy <= eps
+                 && fabs (my_modf (y[LEFT]) - straddle) < eps)
                dem += extra_demerit;
              
-             if (ldir == DOWN && dy >= eps
-                 && fabs (my_modf (yl) - straddle) < eps)
+             if (dirs[LEFT] == DOWN && dy >= eps
+                 && fabs (my_modf (y[LEFT]) - straddle) < eps)
                dem += extra_demerit;
            }
          
-         if (fabs (yr - 2 * rdir * beam_translation) < radius + inter)
+         if (fabs (y[RIGHT] - 2 * dirs[RIGHT] * beam_translation) < radius + inter)
            {
-             if (rdir == UP && dy >= eps
-                 && fabs (my_modf (yr) - straddle) < eps)
+             if (dirs[RIGHT] == UP && dy >= eps
+                 && fabs (my_modf (y[RIGHT]) - straddle) < eps)
                dem += extra_demerit;
              
-             if (rdir == DOWN && dy <= eps
-                 && fabs (my_modf (yr) - straddle) < eps)
+             if (dirs[RIGHT] == DOWN && dy <= eps
+                 && fabs (my_modf (y[RIGHT]) - straddle) < eps)
                dem += extra_demerit;
            }
        }
index 517896e80c7965a271c06a8fb21b88b17679d272..5361db25b50bd17f2dc988eb25bb67c6c3e8e40e 100644 (file)
@@ -44,7 +44,6 @@ Notes:
 #include "warn.hh"
 
 
-#define DEBUG_QUANTING 1
 
 bool debug_beam_quanting_flag;
 
@@ -487,8 +486,11 @@ Beam::brew_molecule (SCM grob)
   the_beam.translate_axis (pos[LEFT], Y_AXIS);
 
 #if (DEBUG_QUANTING)
-  if (debug_beam_quanting_flag)
+  SCM quant_score = me->get_grob_property ("quant-score");
+  if (debug_beam_quanting_flag
+      && gh_string_p (quant_score))
     {
+      
       /*
        This code prints the demerits for each beam. Perhaps this
        should be switchable for those who want to twiddle with the
@@ -498,7 +500,7 @@ Beam::brew_molecule (SCM grob)
       SCM properties = Font_interface::font_alist_chain (me);
 
       Molecule tm = *unsmob_molecule (Text_item::interpret_markup
-       (me->get_paper ()->self_scm (), properties, me->get_grob_property ("quant-score")));
+       (me->get_paper ()->self_scm (), properties, quant_score));
       the_beam.add_at_edge (Y_AXIS, UP, tm, 5.0, 0);
     }
 #endif
index 72728d799f31fb4dd2908371c6b2be3591ce0f8e..1bfe58ae84f8e07babace6bd239b81cb9b2a69b7 100644 (file)
@@ -74,6 +74,7 @@ private:
 
 const int REGION_SIZE = 2;
 
+#define DEBUG_QUANTING 1
 
 #endif /* BEAM_HH */
 
index 9471946c10d80688583975a9f864edf496fdc3f7..adb6340357b1722e2d887b7d6eb4717d7c5410a7 100644 (file)
@@ -37,10 +37,15 @@ Lyric_extender::brew_molecule (SCM smob)
    */
   Real right_point = r->extent (common, X_AXIS)
     [(Note_head::has_interface (r)) ? RIGHT : LEFT];
-  
-  Real w = right_point - left_point;
 
   Real h = sl * gh_scm2double (me->get_grob_property ("thickness"));
+
+  right_point += h;
+
+  Real w = right_point - left_point;
+
+  if (w < 0)
+    return SCM_EOL;
   
   Molecule  mol (Lookup::round_filled_box (Box (Interval (0,w), Interval (0,h)),
                                           0.8 * h));
index 393495a7c0b8900359e01cc66beac512ae48fcd2..19583e3c72ce30d163a7e113191aaf4282cc7925 100644 (file)
@@ -51,7 +51,7 @@ INSTALLATION_OUT_DIR3=$(local_lilypond_datadir)/fonts/tfm
 INSTALLATION_OUT_FILES3=$(TFM_FILES)
 
 
-SAUTER_FONTS = cmbxti
+SAUTER_FONTS = cmbxti8
 
 ALL_FONTS = $(FETA_FONTS) $(SAUTER_FONTS)
 
index e54b224c802b6ea47b3da79a47fb43d5ce64f1d4..f8e846082f783887f38c62e7b3129beacfda49d2 100644 (file)
        (self-alignment-X . 0)
        (word-space . 0.6)
        (font-family . roman)
+       (font-series . bold-narrow)
        (font-shape . upright)
        
        (meta . ((interfaces . (rhythmic-grob-interface lyric-syllable-interface self-alignment-interface text-interface font-interface item-interface ))))
index 41784a0bc2aa9002c5fd754f4edcdbd753a4b168..0592c0110a13f1951d4785c625d31ed8bcd83a5c 100644 (file)
@@ -61,7 +61,7 @@ or
               (12.0 . "cmtt12")
               )))
     (#(bold italic roman) .
-     (10.0 . #((8.0 . "cmbxti7")
+     (10.0 . #((8.0 . "cmbxti8")
               (10.0 . "cmbxti10")
               (14.0 . "cmbxti14")
               )))
@@ -76,6 +76,9 @@ or
               (10.0 . "cmbx10")
               (12.0 . "cmbx12")
               )))
+    (#(bold-narrow upright roman) .
+     (10.0 . #((10.0 . "cmb10")
+              )))
     (#(medium caps roman) .
      (10.0 . #((10.0 . "cmcsc10"))))