]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.1.27.jcn4: jcn4
authorJan Nieuwenhuizen <janneke@gnu.org>
Sun, 7 Feb 1999 21:32:56 +0000 (22:32 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sun, 7 Feb 1999 21:32:56 +0000 (22:32 +0100)
pl 27.jcn4
- measure-end hinterfleish patch
- input/test/coda-kludge.ly
- bf: volta-number placement
- volta: support for "1.-2."  "3"

NEWS
VERSION
input/test/coda-kludge.ly [new file with mode: 0644]
input/test/rep.ly
lily/include/repeat-engraver.hh
lily/repeat-engraver.cc
lily/repeated-music.cc
lily/spring-spacer.cc
lily/volta-spanner.cc
ly/property.ly

diff --git a/NEWS b/NEWS
index 8faa209c890dfcf57e25c3f0b7987d8ceed6e642..33f8cece3ec1cddc658d29ed2fc71587ba4d8770 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,9 @@
+pl 27.jcn4
+       - measure-end hinterfleish patch
+       - input/test/coda-kludge.ly
+       - bf: volta-number placement
+       - volta: support for "1.-2."  "3"
+
 pl 27.jcn3
        - bf's: zero-length repeats
        - Auto beamer:
diff --git a/VERSION b/VERSION
index 473f3f5b37934f6c518b36bf8968409880ad39c2..0c0b456e0d0762eb40a7f362fedd00bd5b617586 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=1
 PATCH_LEVEL=27
-MY_PATCH_LEVEL=jcn3
+MY_PATCH_LEVEL=jcn4
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
diff --git a/input/test/coda-kludge.ly b/input/test/coda-kludge.ly
new file mode 100644 (file)
index 0000000..982a815
--- /dev/null
@@ -0,0 +1,52 @@
+%{
+Hi,
+       I want to write some music that has the structure:
+
+       Intro
+       \repeat 4 { Chorus [first-ending] verse }
+       fifth-ending final
+
+       The obvious:
+
+       \repeat 4 { Chorus \alternative{{first-ending}{}} verse}
+       \alternative{{}{fifth-ending}}
+       final
+
+       doesn't work.
+
+       And the (logically correct but ugly)
+
+       \repeat 4 {Chorus}
+       \alternative {{first-ending verse}{fifth ending}}
+       final
+
+       is very ugly, because the volta bracket keeps going for so
+       long.
+
+       Peter C
+%}
+
+\score{
+       <
+               \type Staff \notes\relative c''{
+                       c c c c
+                       % coda-klugde: let volta span only one bar
+                       \property Staff.voltaSpannerDuration = "1"
+                       \repeat 5 { d d d d }
+                               \alternative { { e e e e f f f f }
+                       { g g g g } }
+               }
+               \type Lyrics \lyrics{
+                       intro1
+                       \repeat 5 {}
+                       \alternative <
+                               { chorus1 one verse1 }
+                               { chorus1 two verse1 }
+                               { chorus1 three verse }
+                               { chorus1 four verse }
+                       >
+                       five1
+               }
+       >
+}
+
index 2b79795ecc904435fa3c643a2ffe7ffb6f70549e..1275606bb0800bf9f5782465f13c4c1a3fae5889 100644 (file)
@@ -2,7 +2,7 @@
        <
                  \type Staff \notes\relative c'{ 
                          c4 d e f
-                         \repeat 2 { g a b c }
+                         \repeat 3 { g a b c }
 %                        \alternative { { c b a g } { f e d c } } c c c c
                          \alternative { { c b a g } { f e d c } { c d e f } }
                          g g g g
index cef330a7187953b1a8b1acdf70d295bb6500123b..ba5ac43066c75a9dc8a63faaad8734669567ec9c 100644 (file)
@@ -37,6 +37,7 @@ private:
   Array<Moment> stop_mom_arr_;
   Array<Moment> alternative_start_mom_arr_;
   Array<Moment> alternative_stop_mom_arr_;
+  Array<String> alternative_str_arr_;
 };
 
 #endif // REPEAT_ENGRAVER_HH
index feb62472678c46e9d692e053f83d37f78c239179..59f2176b46133a05a8a4caf711dffdcb060c6097 100644 (file)
@@ -49,26 +49,38 @@ Repeat_engraver::do_try_music (Music* m)
            }
          repeated_music_arr_.push (r);
          stop_mom_arr_.push (stop_mom);
-         /*
-           TODO: 
-           figure out what we don't want.
-           
-           we don't want to print more than one set of
-           |: :| and volta brackets on one staff.
-           
-           counting nested repeats, it seems safest to forbid
-           two pieces of alternative music to start at the same time.
-         */
        }
+
+      /* 
+        Counting nested repeats, it seems safest to forbid
+        two pieces of alternative music to start at the same time.
+      */
       for (int i = 0; i < alternative_start_mom_arr_.size (); i++)
         if (alternative_start_mom_arr_[i] == alt_mom)
          return false;
-      // moved stop_mom_arr_.push (stop_mom);
+
+      /*
+       Coda kludge: see input/test/coda-kludge.ly
+       */
+      Moment span_mom;
+      Scalar prop = get_property ("voltaSpannerDuration", 0);
+      if (prop.length_i ())
+       span_mom = prop.to_rat ();
+      int alt_i = r->repeats_i_ + 1 - alt->music_p_list_p_->size () >? 1;
       for (PCursor<Music*> i (alt->music_p_list_p_->top ()); i.ok (); i++)
         {
          alternative_music_arr_.push (i.ptr ());
          alternative_start_mom_arr_.push (alt_mom);
-         alternative_stop_mom_arr_.push (alt_mom + i->length_mom ());
+         if (span_mom)
+           alternative_stop_mom_arr_.push (alt_mom + span_mom);
+         else
+           alternative_stop_mom_arr_.push (alt_mom + i->length_mom ());
+         String str;
+         if ((alt_i != 1) && (alt_i != r->repeats_i_) && (i == alt->music_p_list_p_->top ()))
+           str = "1.-";
+         str += to_str (alt_i) + ".";
+         alt_i++;
+         alternative_str_arr_.push (str);
          if (!dynamic_cast<Simultaneous_music *> (alt))
            alt_mom += i->length_mom ();
        }
@@ -123,16 +135,16 @@ Repeat_engraver::do_process_requests ()
            bar_engraver_l->request_bar (":|");
        }
     }
-  int bees = volta_p_arr_.size ();
   for (int i = volta_p_arr_.size (); i < alternative_music_arr_.size (); i++)
     {
       Volta_spanner* v = new Volta_spanner;
       Scalar prop = get_property ("voltaVisibility", 0);
       v->visible_b_ = prop.to_bool ();
-      if (i == alternative_music_arr_.size () - 1)
+      prop = get_property ("voltaSpannerDuration", 0);
+      if ((i == alternative_music_arr_.size () - 1) || prop.length_i ())
         v->last_b_ = true;
       Text_def* t = new Text_def;
-      t->text_str_ = to_str (i - bees + 1) + ".";
+      t->text_str_ = alternative_str_arr_[i];
       v->number_p_.set_p (t);
       volta_p_arr_.push (v);
       announce_element (Score_element_info (v, alternative_music_arr_[i]));
@@ -166,6 +178,7 @@ Repeat_engraver::do_pre_move_processing ()
          alternative_music_arr_.del (i);
          alternative_start_mom_arr_.del (i);
          alternative_stop_mom_arr_.del (i);
+         alternative_str_arr_.del (i);
        }
     }
 }
index e34a5c8da64606079c1aaa11d0cc74bb02f670e4..ee103dbdc60b4c3284ec5a23e4298b9f29ebb0e2 100644 (file)
@@ -27,6 +27,7 @@ Repeated_music::~Repeated_music ()
 Repeated_music::Repeated_music (Repeated_music const& s)
   : Music (s)
 {
+  repeats_i_ = s.repeats_i_;
   repeat_p_ = (s.repeat_p_) ? s.repeat_p_->clone () : 0;
   // urg?
   alternative_p_ = (s.alternative_p_) ? dynamic_cast <Music_sequence*> (s.alternative_p_->clone ()) : 0;
index 3ca32eba6c73f0d1cf3cb7ea2463229d2ce482a1..098201fa1a243fb0767e9a634febd8ef0fc0b140 100644 (file)
@@ -682,8 +682,8 @@ Spring_spacer::calc_idealspacing()
          */
          if (i + 1 < cols_.size () && scol_l(i+1)->breakable_b_)
            {
-             // one interline minimum seems ok for last column too?
-             dist = dist >? interline_f;
+             // two interline minimum ok for last column?
+             dist = dist >? 2 * interline_f;
 
              // set minimum rod 
              /*
@@ -703,7 +703,7 @@ Spring_spacer::calc_idealspacing()
                -- jcn
               */
 
-             cols_[i].width_[RIGHT] = cols_[i].width_[RIGHT] >? interline_f;
+             cols_[i].width_[RIGHT] = cols_[i].width_[RIGHT] >? 2 * interline_f;
            }
 
          // ugh, do we need this?
index 4ce91373f29f9ad32ea91fd1dd52b5f18054a218..5197b235847b2c19a7080fd682b2fedde1fb7b95 100644 (file)
@@ -59,7 +59,11 @@ Volta_spanner::do_brew_molecule_p () const
     dy = dy >? note_column_arr_[i]->extent (Y_AXIS).max ();
   dy -= h;
 
-  Real gap = num.dim_.x ().length () / 2;
+  Text_def two_text;
+  two_text.text_str_ = "2";
+  two_text.style_str_ = number_p_->style_str_;
+  Atom two (two_text.get_atom(paper (), LEFT));
+  Real gap = two.dim_.x ().length () / 2;
   Offset off (num.dim_.x ().length () + gap, 
              h / internote_f - gap);
   num.translate (off);
index 0ee196761bc6a739777b2137e7bbb809e2bfe2b1..fbd082d12ff79ed6d650069b66038254db7e1dd6 100644 (file)
@@ -73,6 +73,8 @@ timeSignatureStyle    oldn/m  Set symbol explicitly,
                                n/m=2/2,3/2,3/4,4/4,6/4 or 9/4.
 [Staff]
 voltaVisibility         0/1     on/off
+voltaSpannerDuration    Rat.    Coda kludge: set length of volta-spanner,
+                                typically set to one measure: "1"
 
 [Staff?]
 instrument             ascii   midi instrument table lookup