+2002-05-04 Han-Wen <hanwen@cs.uu.nl>
+
+ * 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 <hanwen@cs.uu.nl>
* mf/feta-klef.mf: more twiddling with G clef. Almost straight
\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
% [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
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]);
/* 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 ()));
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);
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);
(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))))
))
. (
;; 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)