From 44d3318feb59f81439c0edc5116ae61fe407c226 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 7 Feb 1999 22:32:56 +0100 Subject: [PATCH] patch::: 1.1.27.jcn4: jcn4 pl 27.jcn4 - measure-end hinterfleish patch - input/test/coda-kludge.ly - bf: volta-number placement - volta: support for "1.-2." "3" --- NEWS | 6 ++++ VERSION | 2 +- input/test/coda-kludge.ly | 52 +++++++++++++++++++++++++++++++++ input/test/rep.ly | 2 +- lily/include/repeat-engraver.hh | 1 + lily/repeat-engraver.cc | 43 +++++++++++++++++---------- lily/repeated-music.cc | 1 + lily/spring-spacer.cc | 6 ++-- lily/volta-spanner.cc | 6 +++- ly/property.ly | 2 ++ 10 files changed, 100 insertions(+), 21 deletions(-) create mode 100644 input/test/coda-kludge.ly diff --git a/NEWS b/NEWS index 8faa209c89..33f8cece3e 100644 --- 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 473f3f5b37..0c0b456e0d 100644 --- 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 index 0000000000..982a815aa8 --- /dev/null +++ b/input/test/coda-kludge.ly @@ -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 + } + > +} + diff --git a/input/test/rep.ly b/input/test/rep.ly index 2b79795ecc..1275606bb0 100644 --- a/input/test/rep.ly +++ b/input/test/rep.ly @@ -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 diff --git a/lily/include/repeat-engraver.hh b/lily/include/repeat-engraver.hh index cef330a718..ba5ac43066 100644 --- a/lily/include/repeat-engraver.hh +++ b/lily/include/repeat-engraver.hh @@ -37,6 +37,7 @@ private: Array stop_mom_arr_; Array alternative_start_mom_arr_; Array alternative_stop_mom_arr_; + Array alternative_str_arr_; }; #endif // REPEAT_ENGRAVER_HH diff --git a/lily/repeat-engraver.cc b/lily/repeat-engraver.cc index feb6247267..59f2176b46 100644 --- a/lily/repeat-engraver.cc +++ b/lily/repeat-engraver.cc @@ -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 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 (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); } } } diff --git a/lily/repeated-music.cc b/lily/repeated-music.cc index e34a5c8da6..ee103dbdc6 100644 --- a/lily/repeated-music.cc +++ b/lily/repeated-music.cc @@ -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 (s.alternative_p_->clone ()) : 0; diff --git a/lily/spring-spacer.cc b/lily/spring-spacer.cc index 3ca32eba6c..098201fa1a 100644 --- a/lily/spring-spacer.cc +++ b/lily/spring-spacer.cc @@ -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? diff --git a/lily/volta-spanner.cc b/lily/volta-spanner.cc index 4ce91373f2..5197b23584 100644 --- a/lily/volta-spanner.cc +++ b/lily/volta-spanner.cc @@ -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); diff --git a/ly/property.ly b/ly/property.ly index 0ee196761b..fbd082d12f 100644 --- a/ly/property.ly +++ b/ly/property.ly @@ -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 -- 2.39.5