From ac94780f53268682e00c7fd186e1f9d0520ca25c Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 15 Jun 2003 18:52:31 +0000 Subject: [PATCH] * input/regression/beam-quanting-horizontal.ly: update texidoc * scm/define-grobs.scm (all-grob-descriptions): set beamed-extreme-minimum-free-lengths to 1.25 for 32nd beams. This fixes 32nd beams for noteheads in spaces quants. --- ChangeLog | 6 +++++ Documentation/user/introduction.itely | 5 ++-- input/regression/beam-quanting-horizontal.ly | 16 +++++++++---- input/test/trills.ly | 1 - input/test/volta.ly | 1 - lily/beam-quanting.cc | 25 +++++++++++--------- lily/include/beam.hh | 12 ++++++---- lily/stem.cc | 12 ++++------ scm/define-grobs.scm | 11 ++++----- 9 files changed, 51 insertions(+), 38 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9bf7b85e58..f8c6c5a166 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2003-06-15 Han-Wen Nienhuys + * input/regression/beam-quanting-horizontal.ly: update texidoc + + * scm/define-grobs.scm (all-grob-descriptions): set + beamed-extreme-minimum-free-lengths to 1.25 for 32nd beams. + This fixes 32nd beams for noteheads in spaces quants. + * scripts/lilypond-book.py (process_lilypond_blocks): opps. 2003-06-15 Heikki Junes diff --git a/Documentation/user/introduction.itely b/Documentation/user/introduction.itely index 5239df22a0..4d5e5600fb 100644 --- a/Documentation/user/introduction.itely +++ b/Documentation/user/introduction.itely @@ -11,8 +11,9 @@ is produced without any further intervention. For example, something like this: -@c newlines in intertext choke on lilypond.org? -@lilypond[fragment,verbatim, relative 1, intertext="produces this:"] +@lilypond[fragment,verbatim, relative 1, intertext="produces this: + +"] \key c \minor r8 c16 b c8 g as c16 b c8 d | g,4 @end lilypond diff --git a/input/regression/beam-quanting-horizontal.ly b/input/regression/beam-quanting-horizontal.ly index 4959a5095d..957d56926d 100644 --- a/input/regression/beam-quanting-horizontal.ly +++ b/input/regression/beam-quanting-horizontal.ly @@ -1,7 +1,11 @@ \version "1.7.18" \header{ -texidoc = "Test beam quant positions for horizontal beams." + + texidoc = "Test beam quant positions for horizontal beams. Staff +lines should be covered in all cases. For 32nd beams, the free stem +lengths are between 2 and 1.5." + } \score{ @@ -10,11 +14,13 @@ texidoc = "Test beam quant positions for horizontal beams." a,-[ a] c-[ c] d,8-[ d] g'-[ g] g,-[ g] d'-[ d] - c,16-[ c c c] a''-[ a a a] - a,-[ a a a] c-[ c c c] + c,16-[ c] a''-[ a] + a,-[ a ] c-[ c] \break - c,32-[ c c c c c c c] a''-[ a a a a a a a] - f,-[ f f f f f f f] e'-[ e e e e e e e] + c,32-[ c] a''-[ a] + f,-[ f] e'-[ e] + c,64-[ c] a''-[ a] + f,-[ f] e'-[ e] \break } } diff --git a/input/test/trills.ly b/input/test/trills.ly index a88400fa6d..c535dee669 100644 --- a/input/test/trills.ly +++ b/input/test/trills.ly @@ -32,7 +32,6 @@ endHorizScript = { \score { < - \property Score.TimeSignature = \turnOff \context GrandStaff < \context Staff=upper \notes\relative c'' { \time 1/4 diff --git a/input/test/volta.ly b/input/test/volta.ly index 406adcce9f..7de0d01f68 100644 --- a/input/test/volta.ly +++ b/input/test/volta.ly @@ -9,7 +9,6 @@ voiceE = \notes { \clef bass \property Staff.instrument = "Bass" \property Staff.instr = "B" -% \property Staff.VoltaBracket = \turnOff \time 4/4 f,2 ( f,8-) r8 f8 e8 \repeat volta 2 diff --git a/lily/beam-quanting.cc b/lily/beam-quanting.cc index 45fb5e5c93..04ee4217ce 100644 --- a/lily/beam-quanting.cc +++ b/lily/beam-quanting.cc @@ -221,7 +221,7 @@ Beam::quanting (SCM smob) beam_count, ldir, rdir); } - ; /* silly gdb thinks best_idx is inside for loop. */ + // ; /* silly gdb thinks best_idx is inside for loop. */ for (int i = qscores.size (); i--;) if (qscores[i].demerits < reasonable_score) { @@ -233,7 +233,7 @@ Beam::quanting (SCM smob) qscores[i].yl, qscores[i].yr); } - ; /* silly gdb thinks best_idx is inside for loop. */ + // ; /* silly gdb thinks best_idx is inside for loop. */ int best_idx = best_quant_score_idx (qscores); me->set_grob_property ("positions", gh_cons (gh_double2scm (qscores[best_idx].yl), @@ -252,10 +252,10 @@ Beam::quanting (SCM smob) } Real -Beam::score_stem_lengths (Link_arraystems, - Array stem_infos, - Array base_stem_ys, - Array stem_xs, +Beam::score_stem_lengths (Link_array const &stems, + Array const &stem_infos, + Array const &base_stem_ys, + Array const &stem_xs, Real xl, Real xr, bool knee, Real yl, Real yr) @@ -294,11 +294,14 @@ Beam::score_stem_lengths (Link_arraystems, count[d] ++; } - - if(count[LEFT]) - score[LEFT] /= count[LEFT]; - if(count[RIGHT]) - score[RIGHT] /= count[RIGHT]; + + Direction d = DOWN; + do + { + if(count[d]) + score[d] /= count[d]; + } + while (flip (&d) != DOWN); return score[LEFT]+score[RIGHT]; } diff --git a/lily/include/beam.hh b/lily/include/beam.hh index c2be8243a3..a9e04426a9 100644 --- a/lily/include/beam.hh +++ b/lily/include/beam.hh @@ -46,10 +46,14 @@ public: DECLARE_SCHEME_CALLBACK (shift_region_to_valid, (SCM)); DECLARE_SCHEME_CALLBACK (quanting, (SCM)); static Real score_slopes_dy (Real, Real, Real, Real, bool); - static Real score_stem_lengths (Link_array, - Array, - Array, Array, - Real, Real, bool, Real, Real); + + static Real score_stem_lengths (Link_array const &stems, + Array const &stem_infos, + Array const &base_stem_ys, + Array const &stem_xs, + Real xl, Real xr, + bool knee, + Real yl, Real yr); static Real score_forbidden_quants (Real, Real, Real, Real, Real, Real, int, Direction, Direction); diff --git a/lily/stem.cc b/lily/stem.cc index 51c2c58530..efbdcd1b77 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -834,20 +834,18 @@ Stem::calc_stem_info (Grob *me) /* Simple standard stem length */ + SCM lengths = me->get_grob_property ("beamed-lengths"); Real ideal_length = - gh_scm2double (robust_list_ref - (beam_count - 1, - me->get_grob_property ("beamed-lengths"))) + gh_scm2double (robust_list_ref (beam_count - 1,lengths)) + * staff_space /* stem only extends to center of beam */ - 0.5 * beam_thickness; - /* Condition: sane minimum free stem length (chord to beams) */ + lengths = me->get_grob_property ("beamed-minimum-free-lengths"); Real ideal_minimum_free = - gh_scm2double (robust_list_ref - (beam_count - 1, - me->get_grob_property ("beamed-minimum-free-lengths"))) + gh_scm2double (robust_list_ref (beam_count - 1, lengths)) * staff_space; diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index c4981cb439..e2e527b4e5 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -923,8 +923,8 @@ ;; looking at Baerenreiter examples) for a number of common ;; boundary cases. Subtracting half a beam thickness fixes ;; this, but the bug may well be somewhere else. - (beamed-lengths . (3.26)) - + (beamed-lengths . (3.26 3.26 1.5)) + ;; [Wanske] lists three sets of minimum lengths. One ;; set for the nomal case, and one set for beams with `der ;; Balkenendpunkt weiter "uber bzw. unter die Systemgrenze @@ -938,13 +938,10 @@ ;; and the extreme minima as abolute minimum length. ;; The 'normal' minima - (beamed-minimum-free-lengths . (2.5 2.0 1.5)) - - ;; The 'far outside staff' minima, not used - ;(beamed-far-minimum-free-lengths . (1.83)) + (beamed-minimum-free-lengths . (2.5 2.0 1.0)) ;; The 'extreme case' minima - (beamed-extreme-minimum-free-lengths . (1.83 1.5)) + (beamed-extreme-minimum-free-lengths . (1.83 1.5 1.25)) (X-offset-callbacks . (,Stem::off_callback)) (X-extent-callback . ,Stem::dim_callback) -- 2.39.5