+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:
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.
--- /dev/null
+%{
+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
+ }
+ >
+}
+
<
\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
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
}
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 ();
}
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]));
alternative_music_arr_.del (i);
alternative_start_mom_arr_.del (i);
alternative_stop_mom_arr_.del (i);
+ alternative_str_arr_.del (i);
}
}
}
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;
*/
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
/*
-- 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?
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);
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