]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/tie.cc: change 'heads to 'head-pair.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 6 Jan 2004 00:52:26 +0000 (00:52 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 6 Jan 2004 00:52:26 +0000 (00:52 +0000)
* lily/lyric-phrasing-engraver.cc (process_acknowledged_grobs):
fill in 'heads field.

* lily/lyric-extender.cc (brew_molecule): use heads for width, use
minimum-length for short ones, and shorten so collisions with the
next syllable are avoided.

* lily/beam-quanting.cc (score_slopes_dy): add extra points for
near-zero slopes.
Only do DAMPING_DIRECTION_PENALTY for non-horizontal dy

* lily/dots.cc: remove quantized_position callback. All Y
positioning is done by dot-column.cc

* lily/dot-column.cc (do_shifts): rewrite shifting routine: do
exhaustive test of all dot positions. This fixes disappearing dots
in dotted chords.

input/mutopia/F.Schubert/morgenlied.ly
lily/beam-quanting.cc
lily/lyric-extender.cc

index f220dbed2c11102cd931c56560f2e8d56e0d8ba6..012c8c3cc9cff88a63046de6813dc9b0d1d24ff1 100644 (file)
@@ -60,7 +60,7 @@ melody = \notes   \relative c'' \repeat volta 2 \context Voice = singer {
   g4.~ g8-\fermata g8 g |
   as4 as8 g4 g8 |
   fis4 fis8 r8 g g  |
-  a4 a8 g4 g8 |
+  a!4 a8 g4 g8 |
   fis4 fis8 d'16[ c b a] g[ f] |
   e4 g8 d4 g8 e4 r8 b'16[ c d b] g[ f] |
   e4 g8 d4 a'16[ g] |
@@ -111,7 +111,7 @@ pianoRH = \notes \relative c''' \repeat volta 2 {
 }
 
 pianoLH = \notes \relative c'' \repeat volta 2 {
-    
+    \modernAccidentals
     g16( fis a g fis g f e d c b a) | 
     \clef bass g4.( c,8) r r
     \clef treble r4 <bes' c>8([ <a c>)] r <f c'> |
@@ -148,7 +148,7 @@ pianoLH = \notes \relative c'' \repeat volta 2 {
      \new PianoStaff << 
         \property PianoStaff.instrument = \markup {
             \bold
-            \bigger\bigger \huge "2.  " }
+            \bigger\bigger\bigger\bigger \huge "2.  " }
         \new Staff \pianoRH
         \new Staff \pianoLH
        >> 
index 5dee786850bdd46990abc675c89b3282cb7b66fd..550a0a877c92197c8ce71967618b9e793513584b 100644 (file)
@@ -31,6 +31,7 @@ const int DAMPING_DIRECTION_PENALTY = 800;
 const int MUSICAL_DIRECTION_FACTOR = 400;
 const int IDEAL_SLOPE_FACTOR = 10;
 
+const Real ROUND_TO_ZERO_SLOPE = 0.05;
 const int ROUND_TO_ZERO_POINTS = 4;
 
 extern bool debug_beam_quanting_flag;
@@ -361,14 +362,16 @@ Beam::score_slopes_dy (Real yl, Real yr,
                       bool xstaff)
 {
   Real dy = yr - yl;
-
   Real dem = 0.0;
 
   /*
     DAMPING_DIRECTION_PENALTY is a very harsh measure, while for
     complex beaming patterns, horizontal is often a good choice.
+
+    TODO: find a way to incorporate the complexity of the beam in this
+    penalty.
    */
-  if (sign (dy)
+  if (fabs (dy/dx) > ROUND_TO_ZERO_SLOPE
       && sign (dy_damp) != sign (dy))
     {
       dem += DAMPING_DIRECTION_PENALTY;
@@ -392,7 +395,7 @@ Beam::score_slopes_dy (Real yl, Real yr,
      almost zero slopes look like errors in horizontal beams. 
     */
    if (fabs (dy) > 1e-3
-       && (dy / dx < 0.05))
+       && fabs (dy / dx) < ROUND_TO_ZERO_SLOPE)
      dem += ROUND_TO_ZERO_POINTS;
    
    return dem;
index 52ef6cedcf7ae5569926bbd1cda52485e3c5ef09..4a6a54d5c559009912587e4a4f83f0b494f28b90 100644 (file)
@@ -33,11 +33,13 @@ Lyric_extender::brew_molecule (SCM smob)
   Link_array<Grob> heads (Pointer_group_interface__extract_grobs (me, (Grob*)0,
                                                                  "heads"));
 
+  if (!heads.size ())
+    return SCM_EOL;
+
   common = common_refpoint_of_array (heads, common, X_AXIS);
   
   Real left_point = 0.0;
-  if (!heads.size()
-      || l->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface")))
+  if (l->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface")))
     left_point = l->extent (common, X_AXIS)[RIGHT];
   else
     left_point = heads[0]->extent (common, X_AXIS)[LEFT];
@@ -57,18 +59,17 @@ Lyric_extender::brew_molecule (SCM smob)
   Real right_point
     = left_point + (gh_number_p (minlen) ? gh_scm2double (minlen) : 0.0);
 
-  if (heads.size ())
-    right_point = right_point >? heads.top ()->extent (common, X_AXIS)[RIGHT];
+  right_point = right_point >? heads.top ()->extent (common, X_AXIS)[RIGHT];
 
   Real h = sl * gh_scm2double (me->get_grob_property ("thickness"));
-
-  right_point = right_point <? (r->extent (common, X_AXIS)[LEFT] - h);
+  Real pad = 2* h;
+  right_point = right_point <? (r->extent (common, X_AXIS)[LEFT] - pad);
 
   if (isinf (right_point))
     return SCM_EOL;
   
 
-  right_point += h;
+  right_point += pad;
 
   Real w = right_point - left_point;