From 78cd530be79faefafa59725e855e8372b0c82c0a Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sat, 9 Jan 1999 21:42:58 +0100 Subject: [PATCH] patch::: 1.1.19.jcn4: jcn4 pl 19.jcn4 - new stem/beam parameters - bf: forced stem shorten --- Generated by janneke@gnu.org using package-diff 0.62, >From = lilypond-1.1.19.jcn3, To = lilypond-1.1.19.jcn4 usage cd lilypond-source-dir; patch -E -p1 < lilypond-1.1.19.jcn4.diff Patches do not contain automatically generated files or (urg) empty directories, i.e., you should rerun autoconf, configure and possibly make outdirs. --state 1.1.19.jcn3 1.1.19.jcn4 ++state --- NEWS | 11 +++++- VERSION | 2 +- init/params.ly | 43 ++++++++++------------ lily/beam.cc | 16 ++++----- lily/stem-info.cc | 91 ++++++++++++++--------------------------------- lily/stem.cc | 31 ++++++---------- 6 files changed, 74 insertions(+), 120 deletions(-) diff --git a/NEWS b/NEWS index 41e92f7bb3..c394b259e7 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,13 @@ ---- ../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 diff --git a/VERSION b/VERSION index 04747dc655..198de8d0d5 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond 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. diff --git a/init/params.ly b/init/params.ly index 3f04da0af6..650f51783b 100644 --- a/init/params.ly +++ b/init/params.ly @@ -16,20 +16,31 @@ beam_thickness = 0.52 * (\interline - \staffline); 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 @@ -46,24 +57,6 @@ MEDIAN = 4.0; % [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; diff --git a/lily/beam.cc b/lily/beam.cc index 4cdc6e7afe..6e2e3b4641 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -269,14 +269,12 @@ Beam::set_steminfo () 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_ total_count_i / 2) - info.idealy_f_ -= shorten_f / 2 / internote_f; + info.idealy_f_ -= shorten_f / 2; } sinfo_.push (info); } diff --git a/lily/stem-info.cc b/lily/stem-info.cc index e4504b783e..370efcfadc 100644 --- a/lily/stem-info.cc +++ b/lily/stem-info.cc @@ -28,27 +28,11 @@ Stem_info::Stem_info (Stem*s) 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" @@ -56,47 +40,34 @@ Stem_info::Stem_info (Stem*s) << "\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_ get_var (String ("stem_length") + + to_str (mult_i_ 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 @@ -109,19 +80,11 @@ Stem_info::Stem_info (Stem*s) 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; diff --git a/lily/stem.cc b/lily/stem.cc index 90a12ae555..740cb41666 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -164,41 +164,32 @@ Stem::set_default_dir () 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 () -- 2.39.5