]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/spacing-spanner.cc (set_springs): add support for
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 11 Jul 2002 10:48:44 +0000 (10:48 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 11 Jul 2002 10:48:44 +0000 (10:48 +0000)
common-shortest-duration field.

* lily/parser.yy (translator_spec_body): allow \set in \translator
{}  block. This is the same as \override, here.

* lily/score-engraver.cc (one_time_step): don't warn about columns
when skipTypesetting == #t.

* lily/spacing-spanner.cc (musical_column_spacing): change
ragged right function to produce natural spacing.

ChangeLog
lily/parser.yy
lily/score-engraver.cc
lily/simple-spacer.cc
lily/spacing-spanner.cc
mutopia/J.S.Bach/GNUmakefile
scm/grob-property-description.scm

index b78faea4244b98797e6d2c26ca336cafb4663c82..8e86b94f0d9814f2ae1cc445ea706b18f8dc23e1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2002-07-11  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+       * lily/spacing-spanner.cc (set_springs): add support for
+       common-shortest-duration field.
+
+       * lily/parser.yy (translator_spec_body): allow \set in \translator
+       {}  block. This is the same as \override, here.
+
+       * lily/score-engraver.cc (one_time_step): don't warn about columns
+       when skipTypesetting == #t.
+
+       * lily/spacing-spanner.cc (musical_column_spacing): change
+       ragged right function to produce natural spacing.
+
 2002-07-10  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
        * lily/paper-column.cc (before_line_breaking): update
index 3019fe3982d4e76bf037285bf66576959a5663a7..d29412b1afbd19f95fff001339c567e819f74956 100644 (file)
@@ -510,6 +510,10 @@ translator_spec_body:
                unsmob_translator_def ($$)
                        ->add_push_property (scm_string_to_symbol ($2), $4, $6);
        }
+       | translator_spec_body STRING SET embedded_scm '=' embedded_scm {
+               unsmob_translator_def ($$)
+                       ->add_push_property (scm_string_to_symbol ($2), $4, $6);
+       }
        | translator_spec_body STRING REVERT embedded_scm  {
          unsmob_translator_def ($$)->add_pop_property (
                scm_string_to_symbol ($2), $4);
index d6b1747daa9ffc550420a67a204faf188a1d3b0e..efa97d2c9afe2804bb35fc6e1e2958b7c3481bab 100644 (file)
@@ -66,11 +66,15 @@ Score_engraver::prepare (Moment w)
 {
   Global_translator::prepare (w);
 
+  /*
+    TODO: don't make columns when skipTypesetting is true.
+   */
   make_columns ();
-
+  
   command_column_l_->set_grob_property ("when", now_mom_.smobbed_copy ());
   musical_column_l_->set_grob_property ("when", now_mom_.smobbed_copy ());
 
+  
   Translator_group::start_translation_timestep();
 }
 
@@ -140,10 +144,14 @@ Score_engraver::one_time_step ()
   for (int i = announce_info_arr_.size(); i--;)
     {
       Grob *g = announce_info_arr_[i].grob_l_;
-      String msg= "Grob "
-       + g->name()
-       + " was created too late!";
-      g->programming_error (msg);
+      if (!dynamic_cast<Paper_column*> (g)) // ugh.
+       {
+      
+         String msg= "Grob "
+           + g->name()
+           + " was created too late!";
+         g->programming_error (msg);
+       }
     }
   announce_info_arr_.clear ();
 }
@@ -301,7 +309,8 @@ Score_engraver::forbid_breaks ()
   /*
     result is junked.
    */
-  command_column_l_->remove_grob_property ("breakable");
+  if (command_column_l_)
+    command_column_l_->remove_grob_property ("breakable");
 }
   
 void
index 64caa5969236643b4e7dd95fbfd8267ffeefe914..97d0c2f14d2a79ee76dd8a8400e73d5d782bc2b6 100644 (file)
@@ -365,6 +365,9 @@ Simple_spacer::solve (Column_x_positions *positions, bool ragged) const
 
   positions->satisfies_constraints_b_ =
     positions->satisfies_constraints_b_ && break_satisfy;
+
+  if (ragged && force_f_ < 0)
+    positions->satisfies_constraints_b_ = false;
 }
 
 /****************************************************************/
index bd3d87e0381b0c95a07ba2c4660bbcc4b70ec219..483f9715d23d8ae2615b70b94aba880f88366756 100644 (file)
@@ -366,7 +366,15 @@ Spacing_spanner::set_springs (SCM smob)
 
   set_explicit_neighbor_columns (all);
 
-  Rational global_shortest = find_shortest (me, all);
+  SCM preset_shortest = me->get_grob_property ("common-shortest-duration");
+  Rational global_shortest;
+  if (unsmob_moment (preset_shortest))
+    {
+      global_shortest = unsmob_moment (preset_shortest)->main_part_;
+    }
+  else
+    global_shortest = find_shortest (me, all);
+  
   prune_loose_colunms (me, &all, global_shortest);
   set_implicit_neighbor_columns (all);
 
@@ -590,9 +598,25 @@ Spacing_spanner::musical_column_spacing (Grob *me, Item * lc, Item *rc, Real inc
     Maybe it should be continuous?
   */
   max_fixed_note_space = max_fixed_note_space <?  max_note_space;
-  
+#if 0
+  /*
+    This doesn't make sense. For ragged right we want to have the same
+    spacing. Otherwise  the option should be called differently.
+
+    ragged-righted-and-weird-spacing. Whatever.
+
+  */
   Real strength = (ragged) ? 1.0 : 1 / (max_note_space - max_fixed_note_space);
   Real distance = (ragged) ? max_fixed_note_space : max_note_space;
+#else
+
+  /*
+        TODO: make sure that the space doesn't exceed the right margin.
+   */
+  Real strength = 1 / (max_note_space - max_fixed_note_space);
+  Real distance = max_note_space;
+#endif
+
   //  Spaceable_grob::add_spring (lc, rc, distance, strength, expand_only);
 
   Spaceable_grob::add_spring (lc, rc, distance, strength, false);  
@@ -751,8 +775,10 @@ Spacing_spanner::get_duration_space (Grob*me, Moment d, Rational shortest, bool
 
        */
       Rational ratio = d.main_part_ / shortest;
-      
+
+#if 0
       *expand_only = true;
+#endif
       return ((k-1) + double (ratio)) * incr;
     }
   else
@@ -840,7 +866,7 @@ gets 2 note heads width (i.e. the space following a note is 1 note
 head width) A 16th note is followed by 0.5 note head width. The
 quarter note is followed by  3 NHW, the half by 4 NHW, etc.
 ",
-  "grace-space-factor spacing-increment base-shortest-duration shortest-duration-space");
+  "grace-space-factor spacing-increment base-shortest-duration shortest-duration-space common-shortest-duration");
 
 
 
index 3f0f3bfc407ea11d3d4d9eab5985cfc286dc5f23..abe32c9c53cb5b5a76590eaaa6f975b629ee11e9 100644 (file)
@@ -2,7 +2,7 @@
 
 depth = ../..
 
-SUBDIRS = Petites-Preludes Cembalo-Partitas 
+SUBDIRS = Petites-Preludes 
 EXTRA_DIST_FILES=
 
 
index 5f7f170619f098b3b12a11f7212f50366688fdc9..3d505d67c526866a51457b3379ce56ad7921faf8 100644 (file)
@@ -335,6 +335,9 @@ TODO: revise typing.")
 (grob-property-description 'self-alignment-Y number? "like self-alignment-X but for Y axis.")
 (grob-property-description 'shorten number? "the amount of space that a stem should be shortened (DOCME!)")
 (grob-property-description 'shorten-pair number-pair? "the length on each side to shorten a text-spanner, for example a pedal bracket")
+(grob-property-description 'common-shortest-duration moment?
+                          "The most common shortest note length.
+This is used in spacing. Making this larger will make the score tighter.")
 (grob-property-description 'shortest-duration-space number? "Start
 with this much space for the shortest duration. This is explessed in @code{spacing-increment} as unit. See also
 @ref{spacing-spanner-interface}.")