From 9d939b2812de9226b8669c94c1712c9923dc05d3 Mon Sep 17 00:00:00 2001 From: hanwen Date: Fri, 3 May 2002 23:09:08 +0000 Subject: [PATCH] ChangeLog --- ChangeLog | 7 +++++++ input/regression/beam-concave.ly | 26 ++++++++++++++++++------ lily/beam.cc | 34 +++++++++++++++++++++++++------- mf/feta-nummer-code.mf | 5 +++-- scm/grob-description.scm | 9 ++++++--- 5 files changed, 63 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index c779f30082..3ee20538c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-05-04 Han-Wen + + * lily/beam.cc (check_concave): allow undefined gap and + threshold. Change the meaning of threshold/gap == 0.0. + (check_concave): skip Stolba concaveness check if we have a knee + on outer stems. + 2002-05-03 Han-Wen * mf/feta-klef.mf: more twiddling with G clef. Almost straight diff --git a/input/regression/beam-concave.ly b/input/regression/beam-concave.ly index ac8b48e492..098a9ddf92 100644 --- a/input/regression/beam-concave.ly +++ b/input/regression/beam-concave.ly @@ -1,18 +1,27 @@ \header{ - texidoc = "Concave beams should be horizontal. However, what exactly + +texidoc = "Concave beams should be horizontal. informally spoken, + concave refers to the shape of the notes that are opposite a + beam. If an up-beam has high notes on its center stems, then we call + it concave. In this example, only the beams that are marked `horiz' + are considered concave by lily. They should be printed horizontally. + " +} + + +%{ + However, what exactly it is that makes a beam concave is still unclear. Beams 1 and 3 should be sloped, 2 and 4 should be horizontal. Two sane attempts of calculating concaveness of a beam fail to distinguish beams this way." +%} -} \score{ \notes\relative c'{ - \property Voice.Beam \set #'concaveness-threshold = #0.08 - \property Voice.Beam \set #'concaveness-bt2 = #2.0 - + %% This case seems easy: second beam should be horizontal. %% SCS-I Menuet I, m15 @@ -57,8 +66,13 @@ beams this way." % [g, e' cis] -%%% `Han-Wen': this should be concave +%%% Han-Wen: this should be concave [a,16^"horiz." a' a a] + + \clef treble + +%%%% This should not be concave (hwn) + [\stemUp bes8 \stemDown d'8 bes8] } \paper{ linewidth = -1.0 diff --git a/lily/beam.cc b/lily/beam.cc index 57ff7ff3f8..7224333bca 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -796,16 +796,28 @@ Beam::check_concave (SCM smob) if (stems.size () < 3) return SCM_UNSPECIFIED; - Direction dir = Directional_element_interface::get (me); + /* Concaveness #1: If distance of an inner notehead to line between two outer noteheads is bigger than CONCAVENESS-GAP (2.0ss), - beam is concave (Heinz Stolba). */ + beam is concave (Heinz Stolba). + + In the case of knees, the line connecting outer heads is often + not related to the beam slope (it may even go in the other + direction). Skip the check when the outer stems point in + different directions. --hwn + + */ bool concaveness1 = false; - Real r1 = gh_scm2double (me->get_grob_property ("concaveness-gap")); - if (r1 > 0) + SCM gap = me->get_grob_property ("concaveness-gap"); + if (gh_number_p (gap) + && Stem::get_direction(stems.top ()) + == Stem::get_direction(stems[0])) { + Real r1 = gh_scm2double (gap); Real dy = Stem::chord_start_f (stems.top ()) - Stem::chord_start_f (stems[0]); + + Real slope = dy / (stems.size () - 1); Real y0 = Stem::chord_start_f (stems[0]); @@ -824,9 +836,14 @@ Beam::check_concave (SCM smob) /* Concaveness #2: Sum distances of inner noteheads that fall outside the interval of the two outer noteheads */ Real concaveness2 = 0; - Real r2 = gh_scm2double (me->get_grob_property ("concaveness-threshold")); - if (!concaveness1 && r2 > 0) + SCM thresh = me->get_grob_property ("concaveness-threshold"); + Real r2 = infinity_f; + if (!concaveness1 && gh_number_p (thresh)) { + r2 = gh_scm2double (thresh); + + Direction dir = Directional_element_interface::get (me); + Real concave = 0; Interval iv (Stem::chord_start_f (stems[0]), Stem::chord_start_f (stems.top ())); @@ -843,7 +860,10 @@ Beam::check_concave (SCM smob) else if ((c = f - iv[MIN]) < 0) concave += c; } - + /* + Ugh. This will mess up with knees. Direction should be + determined per stem. + */ concave *= dir; concaveness2 = concave / (stems.size () - 2); diff --git a/mf/feta-nummer-code.mf b/mf/feta-nummer-code.mf index 3d7eb8d26e..28bd3b7a0d 100644 --- a/mf/feta-nummer-code.mf +++ b/mf/feta-nummer-code.mf @@ -324,12 +324,13 @@ fet_beginchar("Numeral 3", "3", "three") penpos1(hair,-90); % flare_start = 0.25 ; - x1l = 35/80 w; + x1l = 36/80 w; y1l = h; % z1l=(17/16thick,h); penpos2(7/8thick,180); - z2l=(w-thick/8,3/4h+thick/16); + x2l= w-thick/8; + y2l = 3/4h + thick* 3/32; penpos3(thin,90); z3=(w/2,h/2+1/8thick); penpos4(thin,90); diff --git a/scm/grob-description.scm b/scm/grob-description.scm index afb13ffded..da2ec6f557 100644 --- a/scm/grob-description.scm +++ b/scm/grob-description.scm @@ -35,8 +35,8 @@ (AccidentalPlacement . ( (X-extent-callback . ,Accidental_placement::extent_callback) - (left-padding . 0.2) - (right-padding . 0.5) + (left-padding . 0.3) + (right-padding . 0.3) (meta . ((interfaces . (accidental-placement-interface)))) )) @@ -630,7 +630,10 @@ . ( ;; don't set direction here: it breaks staccato. (molecule-callback . ,Script::brew_molecule) - (padding . 0.29) + + ;; This value is sensitive: if too large, staccato dots will move a + ;; space a away. + (padding . 0.25) (X-offset-callbacks . (,Self_alignment_interface::centered_on_parent)) (before-line-breaking-callback . ,Script::before_line_breaking) (font-family . music) -- 2.39.5