]> git.donarmstrong.com Git - lilypond.git/commitdiff
(combine_demerits): add epsilon term to
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 25 May 2003 21:44:24 +0000 (21:44 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 25 May 2003 21:44:24 +0000 (21:44 +0000)
force unique solution in zero-force case.

ChangeLog
Documentation/user/tutorial.itely
lily/gourlay-breaking.cc
lily/simple-spacer.cc

index 3810b63aabf002fec3ec0059264c5738a5b489bb..e61776292b84f2cb8d0dc6bef13c3fa3135059dc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2003-05-25  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
+       * lily/gourlay-breaking.cc (combine_demerits): add epsilon term to
+       force unique solution in zero-force case.
+
        * lily/key-performer.cc (create_audio_elements): always use major
        key
 
index 9bd2772e67be2d778a90cb8b11bf0b6f86c3b740..8bc0e301fe8261848f20d914fecb223d79782bbe 100644 (file)
@@ -788,7 +788,6 @@ for comments.
 
 
 
-
 @node Printing lyrics
 @section Printing lyrics
 @cindex lyrics
@@ -924,7 +923,7 @@ a lead sheet, for example,
   \paper @{ @}
 @}
 @end example
-@lilypond[singleline]
+@lilypond[]
 \score  {
   < 
    \context ChordNames \chords { r8 c2:sus4 f } 
@@ -935,7 +934,7 @@ a lead sheet, for example,
      \times 2/3 { f g g } \times 2/3 { g4-( a2-) } }
    \context Lyrics  \lyrics { I want to break free __ }
   >
- \paper{ }
+ \paper{ raggedright = ##t }
 }
 @end lilypond
 
@@ -956,7 +955,7 @@ example
 @example 
 \score @{
     @var{..music..}
-    \midi  @{ \tempo 4=72@}
+    \midi  @{ \tempo 4=72 @}
     \paper  @{ @}
 @}
 @end example 
@@ -981,7 +980,7 @@ example,
     tagline = "small is beautiful"
   @}
   
-  \score { @dots{} 
+  \score @{ @dots{} @}
 @end example
 
 @cindex bibliographic information
@@ -1014,12 +1013,12 @@ will be printed before each movement.
     tagline = "small is beautiful"
   @}
   
-  \score { @dots{}
+  \score @{ @dots{}
     \header @{ piece = "Adagio" @}
-  }
-  \score { @dots{}
+  @}
+  \score @{ @dots{}
     \header @{ piece = "Menuetto" @}
-  }
+  @}
 @end example
 
 More information on titling can be found in @ref{Invoking ly2dvi}.
@@ -1187,7 +1186,7 @@ included if you installed a binary distribution.  [TODO: revise for
 new site.]  These HTML pages are also available on the web: go to the
 LilyPond website, click ``Documentation: Index'' on the side bar, look
 in the ``Information for uses'' section, and click on ``Documentation
-of internals''.
+of internals.''
 
 You might want to bookmark either the HTML files on your disk, or the
 one on the web (the HTML on your hard drive will load much faster than
@@ -1346,18 +1345,6 @@ notes), there should be more space.  This space is controlled by
 @end example
 
 
-(TODO: huh? what's this: )
-
-This command resembles the one for setting slur attachments, but
-subtly differs in its details.  Grob properties can be manipulated
-with two commands: @code{\override} extends the definition of a grob
-with one setting, and @code{\revert} releases this setting.  This has
-a theoretical appeal: the operations are simple and symmetric.  For
-practical use, it can be cumbersome.  The commands act like
-parentheses: you should carefully balance the use of @code{\override}
-and @code{\revert}.  The @code{\set} command is more friendly: it
-first does a @code{\revert} followed by @code{\override}.
-
 @separate
 
 Brahms uses music notation is a slightly unorthodox way.  Ties
index 543caebacb1362e5b92f2dd15922d9eec03cd569..ae4c3073a4382e1102ec54aa23c20c5e8f11500b 100644 (file)
@@ -235,7 +235,14 @@ Gourlay_breaking::combine_demerits (Column_x_positions const &prev,
     Q: do want globally non-cramped lines, or locally equally cramped lines. 
    */
   Real demerit = abs (this_one.force_) +  abs (prev.force_ - this_one.force_)
-    + break_penalties;
+    + break_penalties
+    /*
+      This is rather ugly (not scale free), but we have to put a
+      penalty breaking two zero-force lines. Otherwise, we don't get a
+      unique solution (i.e.: line-breaks in short raggedright
+      fragments.)
+     */
+    +  1e-5;
 
   if (!this_one.satisfies_constraints_b_)
      {
index 5a658657d668b3db107232207f773791b7023bfa..dceebef282f85c7e54ba3da9585340894f58fde2 100644 (file)
@@ -144,13 +144,7 @@ Simple_spacer::active_blocking_force () const
 Real
 Simple_spacer::active_springs_stiffness () const
 {
-  Real den = 0.0;
-  for (int i=0; i < springs_.size (); i++)
-    if (springs_[i].active_b_)
-      {
-       den += 1 / springs_[i].hooke_;
-      }
-  return 1/den;
+  range_stiffness (0, springs_.size ());
 }
 
 void