From 9da7ee60087c4f2e93936b061aac4fb4cbf3492d Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Wed, 21 Jul 1999 15:01:33 +0200 Subject: [PATCH] patch::: 1.1.64.lu1 pl 63.lu2 - very tight: hinterfleisch -> 0 : input/bugs/spacing-very-tight.ly - bfs: neutral beam and tie directions (daar was ik al bang voor:-) - bf: abe: may beam over skip, as long as note present too - bf: scsii-prelude: added slurs using skips --- Documentation/BLURB.in | 4 +- Documentation/tex/lilypond-regtest.doc | 4 ++ NEWS | 6 +++ TODO | 1 - VERSION | 2 +- debian/control | 4 +- input/bugs/spacing-very-tight.ly | 11 ++++ input/test/stem-direction-down.ly | 8 +++ lily/auto-beam-engraver.cc | 50 ++++++------------- lily/beam.cc | 27 ++++++---- lily/include/stem.hh | 3 +- lily/tie.cc | 4 +- .../Solo-Cello-Suites/prelude-urtext.ly | 3 +- 13 files changed, 73 insertions(+), 54 deletions(-) create mode 100644 input/bugs/spacing-very-tight.ly create mode 100644 input/test/stem-direction-down.ly diff --git a/Documentation/BLURB.in b/Documentation/BLURB.in index 0d7df0a9d9..591817db35 100644 --- a/Documentation/BLURB.in +++ b/Documentation/BLURB.in @@ -1,5 +1,5 @@ LilyPond is a music typesetter. It produces beautiful sheet music -using a high level description file as input. It is part of the GNU -project. +using a high level description file as input. LilyPond is part of +the GNU Project. diff --git a/Documentation/tex/lilypond-regtest.doc b/Documentation/tex/lilypond-regtest.doc index 74ca05df7a..b2c7282293 100644 --- a/Documentation/tex/lilypond-regtest.doc +++ b/Documentation/tex/lilypond-regtest.doc @@ -59,6 +59,10 @@ notes, and up for low notes. \mudelafile{stem-direction.sly} +Similarly, if \verb+stem_default_neutral_direction+ is set to \verb+-1+. + +\mudelafile{stem-direction-down.ly} + \section{Grace notes} Grace notes are typeset as an encapsulated piece of music. You can diff --git a/NEWS b/NEWS index 8936143ef0..6c462b6903 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,9 @@ +pl 63.lu2 + - very tight: hinterfleisch -> 0 : input/bugs/spacing-very-tight.ly + - bfs: neutral beam and tie directions (daar was ik al bang voor:-) + - bf: abe: may beam over skip, as long as note present too + - bf: scsii-prelude: added slurs using skips + pl 63.uu1 - mutopia updates courtesy Peter Chubb - Don't make Time_scaled_music for c4*2/3 entry, only do the diff --git a/TODO b/TODO index a0dde3ec79..1474b91bf6 100644 --- a/TODO +++ b/TODO @@ -14,7 +14,6 @@ Grep for TODO and ugh/ugr/urg. . * warning if feta-nummer.tfm not found . * broken examples: input/star-spangled-banner.ly: hw? -mutopia/J.S.Bach/Solo-Cello-Suites/prelude-cello.ly: hw: slurs + autobeamer ? mutopia/Coriolan/* . * spacing of accidentals . * key restorations & repeats diff --git a/VERSION b/VERSION index c87048392c..62eb6c8658 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=1 PATCH_LEVEL=64 -MY_PATCH_LEVEL= +MY_PATCH_LEVEL=lu1 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/debian/control b/debian/control index 597acece90..183e068afc 100644 --- a/debian/control +++ b/debian/control @@ -11,8 +11,8 @@ Recommends: python-base (>= 1.5.1), python-misc (>= 1.5.1), tetex-base (>= 0.9.9 Conflicts: musixtex-fonts, tetex-base (<< 0.9) Description: The GNU Project music typesetter. LilyPond is a music typesetter. It produces beautiful sheet music - using a high level description file as input. It is part of the GNU - project. + using a high level description file as input. LilyPond is part of + the GNU Project. . diff --git a/input/bugs/spacing-very-tight.ly b/input/bugs/spacing-very-tight.ly new file mode 100644 index 0000000000..c903f74af8 --- /dev/null +++ b/input/bugs/spacing-very-tight.ly @@ -0,0 +1,11 @@ +% when tightly spaced, hinterfleisch -> 0 (and not: -> note-width) +% we need a mininum of about a note-width/interline space before +% bar line + +% set rediculously tight +\score { + \notes { \time 2/2; c'2 c'2 \time 2/2; } + \paper { linewidth = 2.0 \cm; + indent = 0.0; + } +} diff --git a/input/test/stem-direction-down.ly b/input/test/stem-direction-down.ly new file mode 100644 index 0000000000..3834e272bd --- /dev/null +++ b/input/test/stem-direction-down.ly @@ -0,0 +1,8 @@ +\score{ + \notes\relative c{ + \include "stem-direction.sly"; + } + \paper{ + stem_default_neutral_direction=-1.0; + } +} diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index 672da02f63..87165d732d 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -37,18 +37,8 @@ Auto_beam_engraver::do_creation_processing () } bool -Auto_beam_engraver::do_try_music (Music* m) +Auto_beam_engraver::do_try_music (Music*) { - /* - Mag dit? Nu word-i toch maar geswallowed, en - komt er dus ook geen announce... - */ - if (Skip_req* s = dynamic_cast (m)) - { - if (stem_l_arr_p_) - end_beam (); - return true; - } return false; } @@ -248,6 +238,17 @@ Auto_beam_engraver::typeset_beam () void Auto_beam_engraver::do_post_move_processing () { + /* + don't beam over skips + */ + if (stem_l_arr_p_) + { + Moment now = now_mom (); + if (extend_mom_ < now) + { + end_beam (); + } + } } void @@ -305,30 +306,15 @@ Auto_beam_engraver::acknowledge_element (Score_element_info info) return; } -#if 0 /* - Don't (start) auto-beam over empty stems. - ugly check for rests! - --> doesn't even work: stem-dir is not set - - ../flower/include/drul-array.hh:26: Real & Drul_array::elem(enum Direction): Assertion `d==1 || d== -1' failed. -/home/fred/root/usr/scripts/src/out/Linux/li: line 8: 14641 Aborted (core dumped) lilypond $opts - - */ - if (stem_l->extent (Y_AXIS).empty_b ()) - { - if (stem_l_arr_p_) - end_beam (); - return; - } -#else + Don't (start) auto-beam over empty stems; skips or rests + */ if (!stem_l->head_l_arr_.size ()) { if (stem_l_arr_p_) end_beam (); return; } -#endif if (stem_l->beam_l_) { @@ -337,11 +323,6 @@ Auto_beam_engraver::acknowledge_element (Score_element_info info) return ; } - /* - now that we have last_add_mom_, perhaps we can (should) do away - with these individual junk_beams - */ - int durlog =rhythmic_req->duration_.durlog_i_; if (durlog <= 2) { @@ -371,7 +352,8 @@ Auto_beam_engraver::acknowledge_element (Score_element_info info) } Moment now = now_mom (); - grouping_p_->add_stem (now - beam_start_moment_ + beam_start_location_, durlog - 2); + grouping_p_->add_stem (now - beam_start_moment_ + beam_start_location_, + durlog - 2); stem_l_arr_p_->push (stem_l); last_add_mom_ = now; extend_mom_ = extend_mom_ >? now + rhythmic_req->length_mom (); diff --git a/lily/beam.cc b/lily/beam.cc index 43975b65dc..199117ac07 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -170,7 +170,6 @@ Beam::get_default_dir () const count[UP] = count[DOWN] = 0; Direction d = DOWN; - Direction beamdir; for (int i=0; i get_var ("stem_default_neutral_direction"); + Dir_algorithm a = (Dir_algorithm)rint(paper_l ()->get_var ("beam_dir_algorithm")); switch (a) { case MAJORITY: - beamdir = (count[UP] >= count[DOWN]) ? UP : DOWN; + beam_dir = (count[UP] == count[DOWN]) ? neutral_dir + : (count[UP] > count[DOWN]) ? UP : DOWN; break; case MEAN: // mean center distance - beamdir = (total[UP] >= total[DOWN]) ? UP : DOWN; + beam_dir = (total[UP] == total[DOWN]) ? neutral_dir + : (total[UP] > total[DOWN]) ? UP : DOWN; break; default: case MEDIAN: // median center distance - if (!count[DOWN]) - beamdir = UP; - if (!count[UP]) - beamdir = DOWN; + if (!count[DOWN] || !count[UP]) + { + beam_dir = (count[UP] == count[DOWN]) ? neutral_dir + : (count[UP] > count[DOWN]) ? UP : DOWN; + } else - beamdir = (total[UP] / count[UP] >= total[DOWN] / count[DOWN]) ? UP : DOWN; + { + beam_dir = (total[UP] / count[UP] == total[DOWN] / count[DOWN]) + ? neutral_dir + : (total[UP] / count[UP] > total[DOWN] / count[DOWN]) ? UP : DOWN; + } break; } - return beamdir; + return beam_dir; } void diff --git a/lily/include/stem.hh b/lily/include/stem.hh index 4a59ac6911..14fe13c22a 100644 --- a/lily/include/stem.hh +++ b/lily/include/stem.hh @@ -48,11 +48,10 @@ class Stem : public Item, public Staff_symbol_referencer { */ Drul_array yextent_drul_; -public: // urg, autobeamer needs to know if there are (only) rests here? +public: Link_array head_l_arr_; Link_array rest_l_arr_; -public: /// log of the duration. Eg. 4 -> 16th note -> 2 flags int flag_i_; diff --git a/lily/tie.cc b/lily/tie.cc index e6c1902d77..1bd0d1cdee 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -39,11 +39,13 @@ Tie::get_default_dir () const { int m = (head_l_drul_[LEFT]->position_i_ + head_l_drul_[RIGHT]->position_i_) /2; + /* If dir is not determined: inverse of stem: down (see stem::get_default_dir ()) */ - return (m <= 0)? DOWN : UP; + Direction neutral_dir = (int)paper_l ()->get_var ("stem_default_neutral_direction"); + return (m == 0) ? other_dir (neutral_dir) : (m < 0) ? DOWN : UP; } void diff --git a/mutopia/J.S.Bach/Solo-Cello-Suites/prelude-urtext.ly b/mutopia/J.S.Bach/Solo-Cello-Suites/prelude-urtext.ly index 7f9b4df710..dbc6e7b2d8 100644 --- a/mutopia/J.S.Bach/Solo-Cello-Suites/prelude-urtext.ly +++ b/mutopia/J.S.Bach/Solo-Cello-Suites/prelude-urtext.ly @@ -186,8 +186,7 @@ prelude_slurs = \notes{ prelude_a = \notes< \$prelude_notes - % Han-Wen: help: adding slurs breaks auto-beaming?? - %\$prelude_slurs + \$prelude_slurs > prelude = \context Staff \notes< -- 2.39.2