* stepmake/stepmake/c-rules.make ($(outdir)/%.c): use -o for flex.
* lily/beam-quanting.cc (quanting): check french-beaming per stem.
(score_stem_lengths): do something sensible for single stem beams.
* lily/beam.cc (least_squares): add kludge for single stem beams.
* scripts/convert-ly.py (FatalConversionError.sub_alteration): add
keySignature to list of broken things.
* input/regression/keys.ly: fix.
2003-09-18 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ * lily/beam.cc (set_stem_lengths): single-stem-beam fix.
+
+ * stepmake/stepmake/c-rules.make ($(outdir)/%.c): use -o for flex.
+
+ * lily/beam-quanting.cc (quanting): check french-beaming per stem.
+ (score_stem_lengths): do something sensible for single stem beams.
+
+ * lily/beam.cc (least_squares): add kludge for single stem beams.
+
+ * scripts/convert-ly.py (FatalConversionError.sub_alteration): add
+ keySignature to list of broken things.
+
+ * input/regression/keys.ly: fix.
+
* VERSION (PACKAGE_NAME): release 1.9.7
* Documentation/topdocs/NEWS.texi (Top): add quarter tones.
-\version "1.9.4"
+\version "1.9.7"
\header{
texidoc="
Key signatures appear on key changes. They may also
\break
\key bes \major % \major
c2 \clef alto c2 \key d \major \clef treble c2
- \property Staff. keySignature = #'((2 . -1) (6 . -1) (4 . -1))
+ \property Staff. keySignature = #'((2 . -1) (6 . 3) (4 . -2))
e2
}
}
\notes \relative c'
\context PianoStaff <<
\property PianoStaff.followVoice = ##t
- \context Staff \context Voice {
+ \context Staff = one \context Voice {
c1
\translator Staff=two
b2 a
}
- \new Staff {\clef bass \skip 1*2 }
+ \context Staff = two {\clef bass \skip 1*2 }
>>\paper{
linewidth =-1.
}}
stem_y != 0.0, when we're cross staff.
*/
- bool french = to_boolean (me->get_grob_property ("french-beaming"));
for (int i= 0; i < stems.size(); i++)
{
Grob*s = stems[i];
stem_infos.push (Stem::get_stem_info (s));
dirs_found[stem_infos.top ().dir_] = true;
- bool f = french && i > 0&& (i < stems.size () -1);
+ bool f = to_boolean (s->get_grob_property ("french-beaming"))
+ && s != lvs && s != fvs;
+
base_lengths.push (calc_stem_y (me, s, common, xl, xr,
Interval (0,0), f));
stem_xposns.push (s->relative_coordinate (common[X_AXIS], X_AXIS));
Real x = stem_xs[i];
Real dx = xr-xl;
- Real beam_y = yr *(x - xl)/dx + yl * ( xr - x)/dx;
+ Real beam_y = dx ? yr *(x - xl)/dx + yl * ( xr - x)/dx : (yr + yl)/2;
Real current_y = beam_y + base_stem_ys[i];
Real length_pen = STEM_LENGTH_DEMERIT_FACTOR;
Direction d = DOWN;
do
{
- if(count[d])
- score[d] /= count[d];
+ score[d] /= (count[d] >? 1);
}
while (flip (&d) != DOWN);
int count = visible_stem_count (me);
Interval pos (0, 0);
- if (count <= 1)
+ if (count < 1)
{
me->set_grob_property ("positions", ly_interval2scm (pos));
return SCM_UNSPECIFIED;
}
Real dx = last_visible_stem (me)->relative_coordinate (commonx, X_AXIS) - x0;
+
Real y =0;
Real dydx = 0;
Real dy = 0;
pos = ideal;
}
+ /*
+ For broken beams this doesn't work well. In this case, the
+ slope esp. of the first part of a broken beam should predict
+ where the second part goes.
+ */
+
y = pos[LEFT];
dy = pos[RIGHT]- y;
dydx = dy/dx;
+
+
+
}
else
{
+ s->relative_coordinate (commony, Y_AXIS)
- my_y));
}
+
minimise_least_squares (&dydx, &y, ideals);
dy = dydx * dx;
Link_array<Grob> stems=
Pointer_group_interface__extract_grobs (me, (Grob*)0, "stems");
- if (stems.size () <= 1)
+ if (!stems.size ())
return;
Grob *common[2];
Real thick =0.0;
if (gh_number_p (me->get_grob_property ("gap"))
&&gh_scm2double (me->get_grob_property ("gap")))
- {
- gap = true;
- thick = get_thickness(me);
- }
+ {
+ gap = true;
+ thick = get_thickness(me);
+ }
// ugh -> use commonx
Grob * fvs = first_visible_stem (me);
if (Stem::invisible_b (s))
continue;
-
bool french = to_boolean (s->get_grob_property ("french-beaming"));
Real stem_y = calc_stem_y (me, s, common,
xl, xr,
- pos, french && i > 0&& (i < stems.size () -1));
+ pos, french && s != lvs && s!= fvs);
/*
Make the stems go up to the end of the beam. This doesn't matter
*/
if (gap)
stem_y += thick * 0.5 * Directional_element_interface::get(s);
-
+
Stem::set_stemend (s, 2* stem_y / staff_space);
}
}
as a substitution text.""" % (m.group (1), m.group (2)) )
raise FatalConversionError ()
- if re.search ("ly:(make-pitch|pitch-alteration)", str):
+ if re.search ("ly:(make-pitch|pitch-alteration)", str) \
+ or re.search ("keySignature", str):
sys.stderr.write (
"""The alteration field of Scheme pitches was multiplied by 2
-to support quarter tone accidentals. Please edit ly:make-pitch and
-ly:pitch-alteration calls by hand""")
+to support quarter tone accidentals. You have to edit the following constructs by hand:
+
+* calls of ly:make-pitch and ly:pitch-alteration
+* keySignature settings made with \property
+""")
raise FatalConversionError ()
return str
rm -f $(outdir)/$(*F).cc # avoid recompiling the .cc file
$(outdir)/%.cc: %.ll
- $(FLEX) -Cfe -p -p -t $< > $@
+ $(FLEX) -Cfe -p -p -o$@ $<
rm -f $(*F).tab.c # if this happens in the wrong order it triggers recompile of the .cc file
$(outdir)/%.c: %.l
- $(FLEX) -Cfe -p -p -t $< > $@
+ $(FLEX) -Cfe -p -p -o$@ $<
# could be faster:
-# $(FLEX) -8 -Cf -t $< > $@
+# $(FLEX) -8 -Cf -o$@ $<