]> git.donarmstrong.com Git - lilypond.git/commitdiff
use breve rests for measure lengths
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 11 Oct 2002 09:36:19 +0000 (09:36 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 11 Oct 2002 09:36:19 +0000 (09:36 +0000)
longer than 4/4. Patch courtesy Kim Shrier <kim@tinker.com>.

ChangeLog
THANKS
VERSION
input/regression/bar-scripts.ly
lily/multi-measure-rest-engraver.cc
lily/multi-measure-rest.cc
lily/parser.yy
scm/grob-description.scm
scm/grob-property-description.scm

index 0eff07a9d7a4f53c0e92395f82a41ecaa68aa5a2..ef724a04c67aed7a9bef40d95337bce9badeeb7d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2002-10-11  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+       * lily/multi-measure-rest.cc: use breve rests for measure lengths
+       longer than 4/4. Patch courtesy Kim Shrier <kim@tinker.com>.
+
+2002-10-10  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * stepmake/stepmake/c++-rules.make: Fixes for bison 1.50.
+
+       * lily/lexer.ll (My_lily_lexer): Avoid silly flex induced gcc warnings.
+
 2002-10-11  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
        * lily/my-lily-lexer.cc (prepare_for_next_token): use previous
@@ -22,6 +33,7 @@
 
        * lily/lexer.ll (My_lily_lexer): Avoid silly flex induced gcc warnings.
 
+
 2002-10-07  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * input/regression/bar-scripts.ly: Blunt documentation build fix.
diff --git a/THANKS b/THANKS
index d9cb3c915c55a54d9902258b73117af5ec3fda18..505ed74f147dd5850ccb277b57d282466a45c8f9 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -5,6 +5,7 @@ Graham Percival
 Rune Zedeler
 Jeremie Lumbroso
 Juergen Reuter
+Kim Shrier
 
 
 BUG HUNTERS
@@ -15,4 +16,4 @@ Jeremie Lumbroso
 Karl-Johan Karlsson 
 Karl Berry
 Werner Lemberg
-
+Thomas Rijniers
diff --git a/VERSION b/VERSION
index 6acfe3a8d02c5ddfc5ed5f8832a52643827d87ed..6a809df4f5830a070a27b604c4304c61e5f0221b 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,7 +1,7 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=7
-PATCH_LEVEL=2
+PATCH_LEVEL=3
 MY_PATCH_LEVEL=
 
 # Use the above to send patches: MY_PATCH_LEVEL is always empty for a
index f6595cb40d0066b24d2bec95e802fe1ffa724dae..7d72f249727648b9f0a5d4a50d6cb256705e4f99 100644 (file)
@@ -32,14 +32,24 @@ scpaper =  \paper {\translator {\OrchestralScoreContext}}
 % stpaper =  \paper{ \translator {\BarNumberingStaffContext }}
 stpaper =  \paper{ }
 
+
 scscore =  \score { \grstaff \paper {
 \scpaper
 }}
 
+scscore =  \score { \grstaff \paper {
+\scpaper
+}}
 
 stscore =  \score { \onestaff \paper {
  \stpaper
 }}
 
+
 %\score {\stscore}
 \score {\scscore}
+
+
+\score{\notes c''}
+\score {\scscore}
+
index ae355daed5656106236771cac7b5db21bad060df..97056febf212ebf1ddfa9164b1f30d370d3f3453 100644 (file)
@@ -158,6 +158,17 @@ Multi_measure_rest_engraver::start_translation_timestep ()
       int cur = gh_scm2int (get_property ("currentBarNumber"));
       lastrest_->set_grob_property ("measure-count",
                                     gh_int2scm (cur - start_measure_));
+      SCM sml = get_property ("measureLength");
+      Rational ml = (unsmob_moment (sml)) ? unsmob_moment (sml)->main_part_ : Rational (1);
+      if (ml < Rational (2))
+       {
+         lastrest_->set_grob_property ("use-breve-rest", SCM_BOOL_F);
+       }
+      else
+       {
+         lastrest_->set_grob_property ("use-breve-rest", SCM_BOOL_T);
+       }
+
       mmrest_ = 0;
     }
 }
@@ -174,10 +185,12 @@ Multi_measure_rest_engraver::finalize ()
 
 ENTER_DESCRIPTION(Multi_measure_rest_engraver,
 /* descr */       "Engraves multi-measure rests that are produced with @code{R}.  Reads
-measurePosition and currentBarNumber to determine what number to print over the MultiMeasureRest
+measurePosition and currentBarNumber to determine what number to print over the MultiMeasureRest.
+Reads measureLength to determine if it should use a whole rest or a breve rest to represent 1 measure
+
 ",
 /* creats*/       "MultiMeasureRest",
 /* accepts */     "multi-measure-rest-event",
 /* acks  */      "",
-/* reads */       "currentBarNumber currentCommandColumn measurePosition",
+/* reads */       "currentBarNumber currentCommandColumn measurePosition measureLength",
 /* write */       "");
index 69d9ec64feee7bded5785d550a45d4450717d427..926dfc6110bc826c7a35f0bdd77e9e3e2d518263 100644 (file)
@@ -163,19 +163,32 @@ Multi_measure_rest::symbol_molecule (Grob *me, Real space)
   Font_metric *musfont
     = Font_interface::get_font (me,style_chain);
 
+  SCM sml = me->get_grob_property ("use-breve-rest");
+
   if (measures == 1)
     {
-      Molecule s = musfont->find_by_name (Rest::glyph_name (me, 0, ""));
+      if (sml == SCM_BOOL_T)
+       {
+         Molecule s = musfont->find_by_name (Rest::glyph_name (me, -1, ""));
+
+         s.translate_axis ((space - s.extent (X_AXIS).length ())/2, X_AXIS);
+      
+         return s ;
+       }
+      else
+       {
+         Molecule s = musfont->find_by_name (Rest::glyph_name (me, 0, ""));
 
-      /*
-       ugh.
-       */
-      if (Staff_symbol_referencer::get_position (me) == 0.0)
-       s.translate_axis (staff_space, Y_AXIS);
+         /*
+           ugh.
+          */
+         if (Staff_symbol_referencer::get_position (me) == 0.0)
+           s.translate_axis (staff_space, Y_AXIS);
 
-      s.translate_axis ((space - s.extent (X_AXIS).length ())/2, X_AXIS);
+         s.translate_axis ((space - s.extent (X_AXIS).length ())/2, X_AXIS);
       
-      return s ;
+         return s ;
+        }
     }
   else
     {
@@ -222,33 +235,57 @@ Multi_measure_rest::church_rest (Grob*me, Font_metric *musfont, int measures,
   int l = measures;
   int count = 0;
   Real symbols_width = 0.0;
+
+  SCM sml = me->get_grob_property ("use-breve-rest");
+
   while (l)
     {
-      int k;
-      if (l >= 4)
-       {
-         l-=4;
-         k = -2;
-       }
-      else if (l>= 2)
+      if (sml == SCM_BOOL_T)
        {
-         l -= 2;
-         k = -1;
+         int k;
+         if (l >= 2)
+           {
+             l-=2;
+             k = -2;
+           }
+         else
+           {
+             l -= 1;
+             k = -1;
+           }
+
+         Molecule r (musfont->find_by_name ("rests-" + to_string (k)));
+         symbols_width += r.extent (X_AXIS).length ();
+         mols = gh_cons (r.smobbed_copy (), mols);
        }
-      else
-       {
-         k = 0;
-         l --;
-       }
-
-      Molecule r (musfont->find_by_name ("rests-" + to_string (k)));
-      if (k == 0)
+       else
        {
-         Real staff_space = Staff_symbol_referencer::staff_space (me);
-         r.translate_axis (staff_space, Y_AXIS);
+         int k;
+         if (l >= 4)
+           {
+             l-=4;
+             k = -2;
+           }
+         else if (l>= 2)
+           {
+             l -= 2;
+             k = -1;
+           }
+         else
+           {
+             k = 0;
+             l --;
+           }
+
+         Molecule r (musfont->find_by_name ("rests-" + to_string (k)));
+         if (k == 0)
+           {
+             Real staff_space = Staff_symbol_referencer::staff_space (me);
+             r.translate_axis (staff_space, Y_AXIS);
+           }
+         symbols_width += r.extent (X_AXIS).length ();
+         mols = gh_cons (r.smobbed_copy (), mols);
        }
-      symbols_width += r.extent (X_AXIS).length ();
-      mols = gh_cons (r.smobbed_copy (), mols);
       count ++;
     }
 
@@ -333,4 +370,4 @@ numbers, fields from font-interface may be used.
 
 
 ",
-  "expand-limit measure-count number-threshold padding thickness");
+  "expand-limit measure-count number-threshold padding thickness use-breve-rest");
index 1d25c9de50c7af696e30722ff72980cfcc648cec..f65f42816242cb51305682c9563e12943628cd7c 100644 (file)
@@ -1436,10 +1436,10 @@ verbose_event:
        ;
 
 sup_quotes:
-       '\'' {
+       "'" {
                $$ = 1;
        }
-       | sup_quotes '\'' {
+       | sup_quotes "'" {
                $$ ++;
        }
        ;
index d6e3fa8536fc7ff0fabf4c0b66ac89ce1c4732f8..3a3672897106d11e200a2bf4d6b2fbfc230d4ba5 100644 (file)
        (number-threshold . 1)
        (padding . 1)
        (thickness . 6.6)
+       (use-breve-rest . #f)
        (font-family . number)
        (padding . 1)
        (meta . ((interfaces . (multi-measure-rest-interface rest-interface font-interface staff-symbol-referencer-interface spanner-interface))))
index c8608e25c8a9a9ee1914ff32fc93945bac391e01..a48c1f61f7658fe6971158b041e9f2240bb55692 100644 (file)
@@ -599,3 +599,4 @@ functions set spanner positions.")
 
 (grob-property-description 'avoid-note-head boolean? "if set, the stem of a chord does not pass through all note head, but start at the last note head. Used by tablature.")
 (grob-property-description 'up-to-staff boolean? "if set, stems' lengths are set so as stems end out of the staff. Used by tablature.")
+(grob-property-description 'use-breve-rest boolean? "boolean that tells multi-measure-rest to use a breve rest to represent the duration of 1 measure instead of w whole rest.  It defaults to false.  It is set to true when the duration of a measure is a breve or longer.")