---- ../lilypond-1.1.19.jcn2/NEWS Fri Jan 8 18:01:10 1999
+--- ../lilypond-1.1.19.jcn3/NEWS Sat Jan 9 16:03:22 1999
+++ b/NEWS Sat Jan 9 21:11:06 1999
+@@ -1,3 +1,7 @@
+pl 19.jcn4
+ - new stem/beam parameters
+ - bf: forced stem shorten
+
+ pl 19.jcn3
+ - dehairification of beam code; cleanup and bugfixes
+ * stemlength--- ../lilypond-1.1.19.jcn2/NEWS Fri Jan 8 18:01:10 1999
++ b/NEWS Sat Jan 9 16:03:22 1999
@@ -1,4 +1,12 @@
-pl 19.jcn1
MAJOR_VERSION=1
MINOR_VERSION=1
PATCH_LEVEL=19
-MY_PATCH_LEVEL=jcn3
+MY_PATCH_LEVEL=jcn4
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
interbeam = (2.0 * \interline - \beam_thickness) / 2.0;
interbeam4 = (3.0 * \interline - \beam_thickness) / 3.0;
-
% stems and beams
%
-% not used for beams
-stem_length = 3.5*\interline;
-
+% poor man's array size
+stem_max = 3.0;
%
+stem_length0 = 3.5*\interline;
+stem_length1 = 2.5 * \interline;
+stem_length2 = 2.0 * \interline;
+stem_length3 = 1.5 * \interline;
+
+% only used for beams
+minimum_stem_length0 = 0.0; % not used
+minimum_stem_length1 = 1.5 * \interline;
+minimum_stem_length2 = 1.25 * \interline;
+minimum_stem_length3 = 1.0 * \interline;
+
% stems in unnatural (forced) direction should be shortened,
% according to [Roush & Gourlay]. Their suggestion to knock off
-% a whole staffspace seems a bit drastical though?
+% a whole staffspace seems a bit drastical: we'll do half.
%
-forced_stem_shorten = 1.0 * \interline;
+forced_stem_shorten0 = 0.5 * \interline;
+forced_stem_shorten1 = \forced_stem_shorten0;
+forced_stem_shorten2 = \forced_stem_shorten1;
+forced_stem_shorten3 = \forced_stem_shorten2;
-%
% there are several ways to calculate the direction of a beam
%
% * MAJORITY : number count of up or down notes
% [Ross]: majority
beam_dir_algorithm = \MAJORITY;
-%
-%
-% some beam-stemlength settings...
-%
-% poor man's array
-% beam_*1 : multiplicity < beam_multiple_break
-% beam_*2 : multiplicity >= beam_multiple_break
-%
-beam_multiple_break = 3.0;
-beam_minimum_stem1 = 0.75 * \interline;
-beam_ideal_stem1 = 1.75 * \interline;
-beam_minimum_stem2 = 0.75 * \interline;
-beam_ideal_stem2 = 1.25 * \interline;
-% same here
-beam_forced_multiple_break = 2.0;
-beam_forced_stem_shorten1 = 0.65 * \interline;
-beam_forced_stem_shorten2 = 0.50 * \interline;
-
% catch suspect beam slopes, set slope to zero if
% outer stem is lengthened more than
beam_lengthened = 0.2 * \interline;
total_count_i++;
}
- Real break_i = (int)rint (paper ()->get_var ("beam_forced_multiple_break"));
- Real shorten_f;
- if (multiple_i_ < break_i)
- shorten_f = paper ()->get_var ("beam_forced_stem_shorten1");
- else
- shorten_f = paper ()->get_var ("beam_forced_stem_shorten2");
-
Real internote_f = paper ()->internote_f ();
+ int stem_max = (int)rint(paper ()->get_var ("stem_max"));
+ Real shorten_f = paper ()->get_var (String ("forced_stem_shorten"
+ + to_str (multiple_i_ <? stem_max)))
+ / internote_f;
+
Real leftx = 0;
for (int i=0; i < stems_.size (); i++)
{
if (info.dir_ == dir_)
{
if (forced_count_i == total_count_i)
- info.idealy_f_ -= shorten_f / internote_f;
+ info.idealy_f_ -= shorten_f;
else if (forced_count_i > total_count_i / 2)
- info.idealy_f_ -= shorten_f / 2 / internote_f;
+ info.idealy_f_ -= shorten_f / 2;
}
sinfo_.push (info);
}
beam_dir_ = stem_l_->beam_dir_;
mult_i_ = stem_l_->mult_i_;
- /*
- [TODO]
- make this runtime
-
- Breitkopf + H\"artel:
- miny_f_ = interline + #beams * interbeam
- ideal8 = 2 * interline + interbeam
- ideal16,32,64,128 = 1.5 * interline + #beams * interbeam
-
- * B\"arenreiter:
- miny_f_ = interline + #beams * interbeam
- ideal8,16 = 2 interline + #beams * interbeam
- ideal32,64,128 = 1.5 interline + #beams * interbeam
-
- */
-
- Real internote_f = stem_l_->paper ()->internote_f ();
- Real interbeam_f = stem_l_->paper ()->interbeam_f (mult_i_);
- Real beam_f = stem_l_->paper ()->beam_thickness_f ();
+ Paper_def* paper_l = stem_l_->paper ();
+ Real internote_f = paper_l->internote_f ();
+ Real interbeam_f = paper_l->interbeam_f (mult_i_);
+ Real beam_f = paper_l->beam_thickness_f ();
-
{
static int i = 1;
DOUT << "******" << i++ << "******\n"
<< "\nchord_f/i: " << stem_l_->chord_start_f () * dir_ / internote_f << '\n';
}
- /*
- For simplicity, we'll assume dir = UP and correct if
- dir = DOWN afterwards.
- */
- idealy_f_ = stem_l_->chord_start_f () * beam_dir_ / internote_f;
+ // strangely enough, dim(chord_start_f) == pt (and not internote!)
+ idealy_f_ = stem_l_->chord_start_f () / internote_f;
+
+ // calculate using dim(y) == pt
idealy_f_ *= internote_f;
- Real break_i = (int)rint (stem_l_->paper ()->get_var ("beam_multiple_break"));
- Real min_stem1_f = stem_l_->paper ()->get_var ("beam_minimum_stem1");
- Real min_stem2_f = stem_l_->paper ()->get_var ("beam_minimum_stem2");
- Real ideal_stem1_f = stem_l_->paper ()->get_var ("beam_ideal_stem1");
- Real ideal_stem2_f = stem_l_->paper ()->get_var ("beam_ideal_stem2");
- Real shorten_f = stem_l_->paper ()->get_var ("forced_stem_shorten");
+ // for simplicity, we calculate as if dir == UP
+ idealy_f_ *= beam_dir_;
+
+ int stem_max = (int)rint(paper_l->get_var ("stem_max"));
+ Real min_stem_f = paper_l->get_var (String ("minimum_stem_length")
+ + to_str (mult_i_ <? stem_max));
+ Real stem_f = paper_l->get_var (String ("stem_length")
+ + to_str (mult_i_ <? stem_max));
if (!beam_dir_ || (beam_dir_ == dir_))
- /* normal (beamed) stem */
+ /* normal beamed stem */
{
- idealy_f_ += interbeam_f * mult_i_;
+ if (mult_i_)
+ {
+ idealy_f_ += beam_f;
+ idealy_f_ += (mult_i_ - 1) * interbeam_f;
+ }
miny_f_ = idealy_f_;
maxy_f_ = INT_MAX;
- if (mult_i_ < break_i)
- {
- idealy_f_ += ideal_stem1_f;
- miny_f_ += min_stem1_f;
- }
- else
- {
- idealy_f_ += ideal_stem2_f;
- miny_f_ += min_stem2_f;
- }
-
- /*
- stems in unnatural (forced) direction are shortened but
- - central line is never 'forced'
- - beamed stems are shortened only by beam itself
- */
- if (!mult_i_ && ((int)stem_l_->chord_start_f ()) && (stem_l_->dir_ != stem_l_->get_default_dir ()))
- {
- idealy_f_ -= shorten_f;
- }
+ idealy_f_ += stem_f;
+ miny_f_ += min_stem_f;
// lowest beam of (UP) beam must never be lower than second staffline
miny_f_ = miny_f_ >? (- 2 * internote_f - beam_f
maxy_f_ = idealy_f_;
miny_f_ = -INT_MAX;
- if (mult_i_ < break_i)
- {
- idealy_f_ -= ideal_stem1_f;
- maxy_f_ -= min_stem1_f;
- }
- else
- {
- idealy_f_ -= ideal_stem2_f;
- maxy_f_ -= min_stem2_f;
- }
+ idealy_f_ -= stem_f;
+ maxy_f_ -= min_stem_f;
}
-
+ // set dim(y) == internote
idealy_f_ /= internote_f;
miny_f_ /= internote_f;
maxy_f_ /= internote_f;
void
Stem::set_default_stemlen ()
{
- /*
- TODO
- urg; this should be handled by Stem_info
- */
-
- Real length_f = paper ()->get_var ("stem_length");
- Real shorten_f = paper ()->get_var ("forced_stem_shorten");
-
Real internote_f = paper ()->internote_f ();
- length_f /= internote_f;
- shorten_f /= internote_f;
+ Real length_f = paper ()->get_var ("stem_length0") / internote_f;
+ Real shorten_f = paper ()->get_var ("forced_stem_shorten0") / internote_f;
- Real len = length_f;
if (!dir_)
set_default_dir ();
/*
stems in unnatural (forced) direction should be shortened,
accoding to [Roush & Gourlay]
*/
- else if (dir_ != get_default_dir ())
- len -= shorten_f / internote_f;
+ if (((int)chord_start_f ())
+ && (dir_ != get_default_dir ()))
+ length_f -= shorten_f;
if (flag_i_ >= 5)
- len += 2.0;
+ length_f += 2.0;
if (flag_i_ >= 6)
- len += 1.0;
+ length_f += 1.0;
- set_stemend ((dir_ > 0) ? head_positions()[BIGGER] + len :
- head_positions()[SMALLER] - len);
+ set_stemend ((dir_ > 0) ? head_positions()[BIGGER] + length_f:
+ head_positions()[SMALLER] - length_f);
if (dir_ * stem_end_f () < 0)
- {
- set_stemend (0);
- }
+ set_stemend (0);
}
+
//xxx
void
Stem::set_default_extents ()