+2004-01-03 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ * lily/beam.cc (brew_molecule): rewrite debug output: split up scores.
+
+ * scm/define-grobs.scm (all-grob-descriptions): use semi-fixed
+ space after barline.
+
+ * mf/feta-eindelijk.mf (tracingvariables): make top of 8th rest fatter.
+
+ * lily/spacing-spanner.cc (breakable_column_spacing): take average
+ of spacing wishes, not maximum. Only do this for delta-t == 0. In
+ the other case, take standard column-breakable spacing. Do not
+ warn about "no spacing wishes".
+
+ This fixes wide spaces after barlines in very loose lines.
+
+ * lily/multi-measure-rest.cc (big_rest): bugfix for blots.
+
2004-01-02 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ * lily/stanza-number-engraver.cc (acknowledge_grob): bugfix:
+ acknowledge_grob lyric-syllable, not lyric-text.
+
+ * lily/hyphen-spanner.cc (brew_molecule): rewrite. Make multiple
+ dashes of length #'length separated by #'dash-period.
+
+ * lily/lyric-extender.cc (brew_molecule): idem
+
+ * lily/multi-measure-rest.cc (big_rest): idem
+
+ * lily/system-start-delimiter.cc (simple_bar): idem
+
+ * lily/bar-line.cc (simple_barline): use rounded box
+
+ * VERSION: release 2.1.5
+
* Documentation/user/lilypond-book.itely (Integrating LaTeX and
music): move note about dvips to more visible place.
@item -v,--version
Show version information.
@item -V,--verbose
-Be verbose.
+Be verbose. This prints out commands as they are executed, and more
+information about the formatting process is printed.
@item --debug
Print even more information. This is useful when generating bugreports.
@item -w,--warranty
MAJOR_VERSION=2
MINOR_VERSION=1
PATCH_LEVEL=5
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=hwn1
melody = \notes \relative c'' \repeat volta 2 \context Voice = singer {
\time 6/8
\autoBeamOff
- s1*0^\markup { \bold \bigger\bigger { \hspace #-3.0 Lieblich, etwas geschwind } }
+ s1*0^\markup { \bold \large\bigger\bigger { \hspace #-3.0 Lieblich, etwas geschwind } }
R2.
r4 r8 c4 g8 |
e4 c8 << { f8. g16 } \\ { f8.[ g16] } >> a8 |
e4 g8 d4 g8 e4 r8 b'16[ c d b] g[ f] |
e4 g8 d4 a'16[ g] |
c,4 r8 r4 r8 |
- R2.\fermata
+
+ % TODO : make \fermata work.
+ R2.^\fermataMarkup
}
\paper {
\translator {
\LyricsVoiceContext
- minimumVerticalExtent = ##f
+ minimumVerticalExtent = #'(-1.0 . 0)
LyricText \set #'font-size = #1.0
}
\translator {
\include "deutsch.ly"
-\include "paper19.ly"
+\include "paper16.ly"
\version "2.1.1"
\header {
Real dy = heads.length() + sp;
Real x = 0.7;
- Molecule mol (Lookup::bracket (Y_AXIS, Interval (0, dy), lt, x));
+ Molecule mol (Lookup::bracket (Y_AXIS, Interval (0, dy), lt, x, lt));
mol.translate_axis (heads[LEFT] - sp/2.0, Y_AXIS);
return mol.smobbed_copy();
}
}
Molecule
-Bar_line::simple_barline (Grob*,Real w, Real h)
+Bar_line::simple_barline (Grob *me,Real w, Real h)
{
- return Lookup::filledbox (Box (Interval (0,w), Interval (-h/2, h/2)));
+ Real blot = me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter"));
+ return Lookup::round_filled_box (Box (Interval (0,w), Interval (-h/2, h/2)), blot);
}
MAKE_SCHEME_CALLBACK (Bar_line,before_line_breaking ,1);
const int MUSICAL_DIRECTION_FACTOR = 400;
const int IDEAL_SLOPE_FACTOR = 10;
+#define DEBUG_QUANTING 1
+
static Real
shrink_extra_weight (Real x, Real fac)
Real yl;
Real yr;
Real demerits;
+
+#if DEBUG_QUANTING
+ String score_card_;
+#endif
};
parameters outside of the loop, we can save a lot of time. */
for (int i = qscores.size (); i--;)
{
- qscores[i].demerits
- += score_slopes_dy (qscores[i].yl, qscores[i].yr,
- dy_mus, yr- yl, xstaff);
+ Real d = score_slopes_dy (qscores[i].yl, qscores[i].yr,
+ dy_mus, yr- yl, xstaff);
+ qscores[i].demerits += d;
+
+#if DEBUG_QUANTING
+ qscores[i].score_card_ += to_string ("S%.2f",d);
+#endif
}
Real rad = Staff_symbol_referencer::staff_radius (me);
for (int i = qscores.size (); i--;)
if (qscores[i].demerits < reasonable_score)
{
- qscores[i].demerits
- += score_forbidden_quants (qscores[i].yl, qscores[i].yr,
+ Real d = score_forbidden_quants (qscores[i].yl, qscores[i].yr,
rad, slt, thickness, beam_translation,
beam_count, ldir, rdir);
+ qscores[i].demerits += d;
+
+#if DEBUG_QUANTING
+ qscores[i].score_card_ += to_string (" F %.2f", d);
+#endif
}
for (int i = qscores.size (); i--;)
if (qscores[i].demerits < reasonable_score)
{
- qscores[i].demerits
- += score_stem_lengths (stems, stem_infos,
+ Real d=score_stem_lengths (stems, stem_infos,
base_lengths, stem_xposns,
xl, xr,
knee_b,
qscores[i].yl, qscores[i].yr);
+ qscores[i].demerits += d;
+
+#if DEBUG_QUANTING
+ qscores[i].score_card_ += to_string (" L %.2f", d);
+#endif
}
int best_idx = best_quant_score_idx (qscores);
+
+
me->set_grob_property ("positions",
gh_cons (gh_double2scm (qscores[best_idx].yl),
gh_double2scm (qscores[best_idx].yr))
);
#if DEBUG_QUANTING
-
// debug quanting
me->set_grob_property ("quant-score",
- gh_double2scm (qscores[best_idx].demerits));
+ scm_makfrom0str (qscores[best_idx].score_card_.to_str0 ()));
me->set_grob_property ("best-idx", scm_int2num (best_idx));
#endif
#include "warn.hh"
-#define DEBUG_QUANTING 0
+#define DEBUG_QUANTING 1
#if DEBUG_QUANTING
parameters.
*/
String str;
- if (1)
- {
- str += to_string (gh_scm2int (me->get_grob_property ("best-idx")));
- str += ":";
- }
- str += to_string (gh_scm2double (me->get_grob_property ("quant-score")),
- "%.2f");
-
SCM properties = Font_interface::font_alist_chain (me);
- Molecule tm = Text_item::interpret_new_markup
- (me->self_scm(), properties, scm_makfrom0str (str.to_str0 ()));
+ Molecule tm = *unsmob_molecule (Text_item::interpret_markup
+ (me->get_paper ()->self_scm (), properties, me->get_grob_property ("quant-score")));
the_beam.add_at_edge (Y_AXIS, UP, tm, 5.0, 0);
}
#endif
ext.unite (gs[0]->extent (cx, X_AXIS));
Direction d = get_grob_direction (me);
- Real t = me->get_paper()->get_realvar (ly_symbol2scm ("linethickness"));
+ Real lt =me->get_paper()->get_realvar (ly_symbol2scm ("linethickness"));
+ Real t = lt;
SCM lthick = me->get_grob_property ("thickness");
if (gh_number_p (lthick))
t *= gh_scm2double (lthick);
- Molecule b = Lookup::bracket (X_AXIS, ext, t, - d* 1.0);
+ Molecule b = Lookup::bracket (X_AXIS, ext, t, - d* 1.0, lt);
b.translate_axis ( - sp->get_bound (LEFT)->relative_coordinate (cx, X_AXIS), X_AXIS);
{
current_lyric_ = i.grob_;
if (hyphen_
- && !hyphen_->get_bound (RIGHT)
- )
+ && !hyphen_->get_bound (RIGHT))
{
- Hyphen_spanner (hyphen_).set_textitem (RIGHT, i.grob_);
+ hyphen_->set_bound (RIGHT, i.grob_);
}
}
}
hyphen_ = new Spanner (get_property ("LyricHyphen"));
- Hyphen_spanner (hyphen_).set_textitem (LEFT, last_lyric_);
+ hyphen_->set_bound (LEFT, last_lyric_);
announce_grob(hyphen_, req_->self_scm());
}
}
#include "item.hh"
-MAKE_SCHEME_CALLBACK (Hyphen_spanner,set_spacing_rods,1);
-SCM
-Hyphen_spanner::set_spacing_rods (SCM smob)
-{
- Grob*me = unsmob_grob (smob);
-
- Rod rod;
- Spanner*sp = dynamic_cast<Spanner*> (me);
- Item * l = sp->get_bound (LEFT);
- Item * r = sp->get_bound (RIGHT);
- rod.item_l_drul_[LEFT] = l;
- rod.item_l_drul_[RIGHT] =r;
- rod.distance_ =
- gh_scm2double (me->get_grob_property ("minimum-length"))
- + l->extent (l, X_AXIS)[RIGHT]
- - r->extent (r, X_AXIS)[LEFT];
-
- rod.add_to_cols ();
- return SCM_UNSPECIFIED;
-}
-
MAKE_SCHEME_CALLBACK (Hyphen_spanner,brew_molecule,1)
SCM
Hyphen_spanner::brew_molecule (SCM smob)
{
Spanner * sp = unsmob_spanner (smob);
+ Drul_array<Item*> bounds (sp->get_bound (LEFT),
+ sp->get_bound (RIGHT));
+
+ Grob * common = bounds[LEFT]->common_refpoint (bounds[RIGHT], X_AXIS);
- Grob * common = sp;
+ Interval span_points;
Direction d = LEFT;
do
{
- common = common->common_refpoint (sp->get_bound (d), X_AXIS);
- }
- while (flip (&d) != LEFT);
- Interval bounds;
-
- do
- {
- Interval iv = sp->get_bound (d)->extent (common, X_AXIS);
+ Interval iv = bounds[d]->extent (common, X_AXIS);
- bounds[d] = iv.is_empty ()
- ? sp->get_bound (d)->relative_coordinate (common, X_AXIS)
+ span_points[d] = iv.is_empty ()
+ ? bounds[d]->relative_coordinate (common, X_AXIS)
: iv[-d];
}
while (flip (&d) != LEFT);
Real h = gh_scm2double (sp->get_grob_property ("height"));
// interval?
- Real x = gh_scm2double (sp->get_grob_property ("maximum-length"));
- SCM space = sp->get_bound (LEFT)->get_grob_property ("word-space");
+
+ Real dp = gh_scm2double (sp->get_grob_property ("dash-period"));
+ Real dl = gh_scm2double (sp->get_grob_property ("length"));
- Real word_space = 1.0;
- if (gh_number_p (space))
- {
- word_space = gh_scm2double (space);
- }
+ if (dp < dl)
+ dp = 1.5 * dl;
+
+ Real l = span_points.length ();
+ int n = int (ceil (l/dp - 0.5));
+ if (n <= 0)
+ n = 1;
+
+ Real space_left = l - dl - (n-1)* dp;
/*
- We remove word space from the distance so it doesn't look like an extender.
-
+ If there is not enough space, the hyphen should disappear.
*/
- Real l = (gh_scm2double (sp->get_grob_property ("minimum-length"))
- - word_space ) >? word_space;
-
-
- /*
- we should probably do something more intelligent when bounds is
- empty, but at least this doesn't crash.
- */
- Real w = bounds.is_empty () ? 0 : bounds.length ();
+ if (space_left < 0)
+ return SCM_EOL;
- /* for length, use a geometric mean of the available space and some minimum
- */
- if (l < w)
- {
- l = sqrt (l*w);
- if (l > x)
- l = x;
- }
- else
+ Box b (Interval (0, dl), Interval (h,h+th));
+ Molecule dash_mol (Lookup::round_filled_box (b, 0.8 * lt));
+
+ Molecule total;
+ for (int i = 0; i < n; i++)
{
- /* OK, we have a problem. Usually this means that we're on the
- first column, and we have a long lyric which extends to near
- the offset for stuff */
- /* This test for being on the first column has been shamelessly
- ripped from spanner.cc */
- Paper_column *sc = dynamic_cast<Paper_column*> (sp->get_bound (LEFT)->get_column ());
- if (sc != NULL &&
- sc->break_status_dir () == RIGHT)
- {
- /* We are on the first column, so it's probably harmless to
- get the minimum length back by extending leftwards into
- the space under the clef/key sig/time sig */
- bounds[LEFT] = bounds[RIGHT] - l;
- }
- else
- {
- /* We can't get the length desired. Maybe we should warn. */
- l = w;
- }
+ Molecule m (dash_mol);
+ m.translate_axis (span_points[LEFT] + i * dp + space_left / 2, X_AXIS);
+ total.add_molecule (m);
}
- Box b (Interval (-l/2,l/2), Interval (h,h+th));
- Molecule mol (Lookup::filledbox (b));
- Real ct = bounds.is_empty () ? 0 : bounds.center () ;
- mol.translate_axis (ct -sp->relative_coordinate (common, X_AXIS), X_AXIS);
- return mol.smobbed_copy ();
-}
-
-void
-Hyphen_spanner::set_textitem (Direction d, Grob* b)
-{
- elt_->set_bound (d, b);
- elt_->add_dependency (b);
-}
-Hyphen_spanner::Hyphen_spanner (Spanner*s)
-{
- elt_ = s;
+ total.translate_axis ( -sp->relative_coordinate (common, X_AXIS), X_AXIS);
+ return total.smobbed_copy ();
}
ADD_INTERFACE (Hyphen_spanner, "lyric-hyphen-interface",
"A centred hyphen is a simple line between lyrics used to divide syllables",
- "thickness height minimum-length maximum-length word-space");
+ "thickness height dash-period length");
};
const int REGION_SIZE = 2;
-#define DEBUG_QUANTING 0
#endif /* BEAM_HH */
struct Hyphen_spanner
{
public:
- Spanner* elt_;
-
DECLARE_SCHEME_CALLBACK(set_spacing_rods, (SCM));
- Hyphen_spanner (Spanner*);
void set_textitem (Direction, Grob*);
bool has_interface (Grob*);
DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM ));
struct Lookup
{
static Molecule dot (Offset p, Real radius);
- static Molecule bracket (Axis a, Interval iv, Real thick, Real protude);
+ static Molecule bracket (Axis a, Interval iv, Real thick, Real protude, Real blot);
static Molecule accordion (SCM arg, Real interline_f, Font_metric*fm);
static Molecule round_filled_polygon (Array<Offset> points, Real blotdiameter);
- static Molecule frame (Box b, Real thick);
+ static Molecule frame (Box b, Real thick, Real blot);
static Molecule slur (Bezier controls, Real cthick, Real thick);
static Molecule bezier_sandwich (Bezier top_curve, Bezier bottom_curve);
static Molecule horizontal_slope (Real width, Real slope, Real height);
static Molecule beam (Real slope, Real width, Real thick);
static Molecule dashed_slur (Bezier, Real thick, Real dash);
static Molecule blank (Box b);
- static Molecule filledbox (Box b);
+ static Molecule filled_box (Box b);
static Molecule round_filled_box (Box b, Real blotdiameter);
static Molecule repeat_slash (Real w, Real slope, Real th);
static Molecule line (Real th, Offset from, Offset to);
JUNKME
*/
Real get_realvar (SCM symbol) const;
- Real get_var (String id) const;
void reinit ();
Paper_def ();
Paper_def (Paper_def const&);
#define SINGLE_MALT_GROUPING_ITEM_HH
#include "lily-proto.hh"
+#include "direction.hh"
struct Separation_item
{
static bool has_interface (Grob*);
static Interval conditional_width (Grob*,Grob*) ;
static Interval width (Grob*) ;
-
+ static Grob*extremal_break_aligned_grob (Grob*,Direction, Interval*);
static void add_item (Grob*,Item*);
static void add_conditional_item (Grob*,Grob*);
};
static void get_spacing_params (Grob*,Real*,Real*);
static Interval bar_y_positions (Grob*);
- static Grob* extremal_break_aligned_grob (Grob*,Direction, Interval*);
};
#endif /* STAFF_SPACING_HH */
}
Molecule
-Lookup::filledbox (Box b)
+Lookup::filled_box (Box b)
{
SCM at = (scm_list_n (ly_symbol2scm ("filledbox"),
gh_double2scm (-b[X_AXIS][LEFT]),
return polygon;
}
+
+/*
+ TODO: deprecate?
+
+ should use rounded corners.
+ */
Molecule
-Lookup::frame (Box b, Real thick)
+Lookup::frame (Box b, Real thick, Real blot)
{
Molecule m;
Direction d = LEFT;
edges[o][DOWN] = b[o][DOWN] - thick/2;
edges[o][UP] = b[o][UP] + thick/2;
- m.add_molecule (filledbox (edges));
+ m.add_molecule (round_filled_box (edges, blot));
}
while (flip (&d) != LEFT);
}
return m;
-
}
/*
return Molecule (b, slashnodot); // http://slashnodot.org
}
+
Molecule
-Lookup::bracket (Axis a, Interval iv, Real thick, Real protude)
+Lookup::bracket (Axis a, Interval iv, Real thick, Real protude, Real blot)
{
Box b;
Axis other = Axis((a+1)%2);
b[a] = iv;
b[other] = Interval(-1, 1) * thick * 0.5;
- Molecule m = filledbox (b);
+ Molecule m = round_filled_box (b, blot);
b[a] = Interval (iv[UP] - thick, iv[UP]);
Interval oi = Interval (-thick/2, thick/2 + fabs (protude)) ;
oi *= sign (protude);
b[other] = oi;
- m.add_molecule (filledbox (b));
+ m.add_molecule (round_filled_box (b, blot));
b[a] = Interval (iv[DOWN], iv[DOWN] +thick);
- m.add_molecule (filledbox(b));
+ m.add_molecule (round_filled_box (b,blot));
return m;
}
return Lookup::bracket ((Axis)gh_scm2int (a), ly_scm2interval (iv),
gh_scm2double (t),
- gh_scm2double (p)).smobbed_copy ();
+ gh_scm2double (p),
+ gh_scm2double (t)).smobbed_copy ();
}
Real h = sl * gh_scm2double (me->get_grob_property ("thickness"));
- Molecule mol (Lookup::filledbox (Box (Interval (0,w), Interval (0,h))));
+ Molecule mol (Lookup::round_filled_box (Box (Interval (0,w), Interval (0,h)),
+ 0.8 * h));
mol.translate_axis (left_point - me->relative_coordinate (common, X_AXIS), X_AXIS);
return mol.smobbed_copy ();
}
Molecule m;
if (which == ly_symbol2scm ("bracket"))
{
- m = Lookup::bracket (X_AXIS, iv, t,-gh_scm2double (height));
+ m = Lookup::bracket (X_AXIS, iv, t,-gh_scm2double (height), t);
}
else if (which == ly_symbol2scm ("triangle"))
{
-0.5*height - cauda_box_y.length();
Box cauda_box (cauda_box_x, cauda_box_y);
- Molecule cauda = Lookup::filledbox (cauda_box);
+ Molecule cauda = Lookup::filled_box (cauda_box);
cauda.translate_axis (y_correction, Y_AXIS);
molecule.add_molecule (cauda);
}
}
-
+/*
+ WIDTH can also be 0 to determine the minimum size of the object.
+ */
Molecule
Multi_measure_rest::big_rest (Grob *me, Real width)
{
- Real tthick = gh_scm2double (me->get_grob_property ("thick-thickness"));
+ Real thick_thick = gh_scm2double (me->get_grob_property ("thick-thickness"));
Real hair_thick = gh_scm2double (me->get_grob_property ("hair-thickness"));
Real ss = Staff_symbol_referencer::staff_space (me);
-
Real slt = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
- Real y = slt * tthick/2 * ss;
+ Real y = slt * thick_thick/2 * ss;
Real ythick = hair_thick * slt * ss;
- Box b(Interval (0, width - 2 * ythick), Interval (-y, y));
+ Box b(Interval (0, 0 >? (width - 2 * ythick)), Interval (-y, y));
+
+ Real blot = width ? (.8 * (y <? ythick)) : 0.0;
- Molecule m = Lookup::filledbox (b);
- Molecule yb = Lookup::filledbox (Box (Interval (-0.5, 0.5)* ythick, Interval (-ss, ss)));
+ Molecule m = Lookup::round_filled_box (b, blot);
+ Molecule yb = Lookup::round_filled_box (Box (Interval (-0.5, 0.5)* ythick, Interval (-ss, ss)), blot);
m.add_at_edge (X_AXIS, RIGHT, yb, 0, 0);
m.add_at_edge (X_AXIS, LEFT, yb, 0, 0);
it = it->find_prebroken_piece (rcolumn->break_status_dir ());
}
- Grob *last = Staff_spacing::extremal_break_aligned_grob (it, LEFT, &bar_xextent);
+ Grob *last = Separation_item::extremal_break_aligned_grob (it, LEFT, &bar_xextent);
if (last)
bar_yextent = Staff_spacing::bar_y_positions (last);
t.align_to (X_AXIS, CENTER);
t.align_to (Y_AXIS, DOWN);
- Molecule l = Lookup::filledbox (Box (Interval (-0.01, 0.01),
+ Molecule l = Lookup::filled_box (Box (Interval (-0.01, 0.01),
Interval (-2, -1)));
t.add_molecule (l);
}
+/*
+ Try to find the break-aligned symbol in SEPARATION_ITEM that is
+ sticking out at direction D. The x size is put in LAST_EXT
+*/
+Grob*
+Separation_item::extremal_break_aligned_grob (Grob *separation_item, Direction d,
+ Interval * last_ext)
+{
+ Grob *col = dynamic_cast<Item*> (separation_item)->get_column ();
+ last_ext->set_empty ();
+ Grob *last_grob = 0;
+ for (SCM s = separation_item->get_grob_property ("elements");
+ gh_pair_p (s); s = gh_cdr (s))
+ {
+ Grob * break_item = unsmob_grob (gh_car (s));
+
+ if (!gh_symbol_p (break_item->get_grob_property ("break-align-symbol")))
+ continue;
+
+ Interval ext = break_item->extent (col, X_AXIS);
+
+ if (ext.is_empty ())
+ continue;
+ if (!last_grob
+ || (last_grob && d * (ext[d]- (*last_ext)[d]) > 0) )
+ {
+ *last_ext = ext;
+ last_grob = break_item;
+ }
+ }
+
+ return last_grob;
+}
+
+
#include "break-align-interface.hh"
#include "spacing-interface.hh"
+
+/*
+ TODO: this file/class is too complex. Should figure out how to chop
+ this up even more.
+
+ */
+
class Spacing_spanner
{
public:
Real * fixed, Real * space,
Moment shortest)
{
-
*fixed = 0.0;
Direction d = LEFT;
Drul_array<Item*> cols(l,r);
what happens if we do this for non musical columns only.
*/
Interval lext = cols[d]->extent (cols [d], X_AXIS);
- *fixed += -d * lext[-d];
+ if (!lext.is_empty ())
+ *fixed += -d * lext[-d];
}
}
while (flip (&d) != LEFT);
+
if (l->breakable_b (l) && r->breakable_b(r))
{
else
{
Moment dt = Paper_column::when_mom (r) - Paper_column::when_mom (l);
- bool dummy;
- *space = *fixed + get_duration_space (me, dt, shortest.main_part_, &dummy);
+ if (dt == Moment (0,0))
+ {
+ /*
+ In this case, Staff_spacing should handle the job,
+ using dt when it is 0 is silly.
+ */
+ *space = *fixed + 0.5;
+ }
+ else
+ {
+ bool dummy;
+ *space = *fixed + get_duration_space (me, dt, shortest.main_part_, &dummy);
+ }
}
}
/*
Read hints from L and generate springs.
- */
+*/
void
Spacing_spanner::breakable_column_spacing (Grob*me, Item* l, Item *r,Moment shortest)
{
- Real max_fixed = -infinity_f;
- Real max_space = -infinity_f;
-
- standard_breakable_column_spacing (me, l, r, &max_fixed, &max_space ,
- shortest);
-
- for (SCM s = l->get_grob_property ("spacing-wishes");
- gh_pair_p (s); s = gh_cdr (s))
- {
- Item * spacing_grob = dynamic_cast<Item*> (unsmob_grob (gh_car (s)));
-
- if (!spacing_grob || !Staff_spacing::has_interface (spacing_grob))
- continue;
+ Real compound_fixed = 0.0;
+ Real compound_space = 0.0;
+ int wish_count = 0;
- Real space;
- Real fixed_space;
+ Moment dt = Paper_column::when_mom (r) - Paper_column::when_mom (l);
- /*
- column for the left one settings should be ok due automatic
- pointer munging.
+ if (dt == Moment (0,0))
+ {
+ for (SCM s = l->get_grob_property ("spacing-wishes");
+ gh_pair_p (s); s = gh_cdr (s))
+ {
+ Item * spacing_grob = dynamic_cast<Item*> (unsmob_grob (gh_car (s)));
- */
- assert (spacing_grob-> get_column () == l);
+ if (!spacing_grob || !Staff_spacing::has_interface (spacing_grob))
+ continue;
- Staff_spacing::get_spacing_params (spacing_grob,
- &space, &fixed_space);
+ Real space;
+ Real fixed_space;
- if (Paper_column::when_mom (r).grace_part_)
- {
/*
- Correct for grace notes.
+ column for the left one settings should be ok due automatic
+ pointer munging.
- Ugh. The 0.8 is arbitrary.
- */
- space *= 0.8;
- }
- if (space > max_space)
- {
- max_space = space;
- max_fixed = fixed_space;
- }
- }
+ */
+ assert (spacing_grob-> get_column () == l);
-
-
-
- if (isinf (max_space))
- {
- /*
- One situation where this can happen is when there is a column
- that only serves as a spanning point for a short staff-symbol.
+ Staff_spacing::get_spacing_params (spacing_grob,
+ &space, &fixed_space);
- ===============X===
+ if (Paper_column::when_mom (r).grace_part_)
+ {
+ /*
+ Correct for grace notes.
- |=======Y
+ Ugh. The 0.8 is arbitrary.
+ */
+ space *= 0.8;
+ }
- (here no StaffSpacing from Y to X is found.)
- */
- warning ("No spacing wishes found. Does your score have a staff?");
- max_space = 2.0;
- max_fixed = 1.0;
+ compound_space += space;
+ compound_fixed += fixed_space;
+ wish_count ++ ;
+ }
}
-
- if (l->break_status_dir() == RIGHT
- && Paper_column::when_mom (l) == Paper_column::when_mom (r))
+ if (compound_space <= 0.0 || !wish_count)
{
- /* Start of line: this space is not stretchable */
- max_fixed = max_space;
+ standard_breakable_column_spacing (me, l, r, &compound_fixed, &compound_space ,
+ shortest);
+ wish_count = 1;
+ }
+ else
+ {
+ compound_space /= wish_count;
+ compound_fixed /= wish_count;
}
+ assert (!isinf (compound_space));
+
+
+
/*
Hmm. we do 1/0 in the next thing. Perhaps we should check if this
works on all architectures.
Do it more cleanly, or rename the property.
*/
- Real strength = 1 / (max_space - max_fixed);
- Real distance = max_space;
+ Real strength = 1 / (compound_space - compound_fixed);
+ Real distance = compound_space;
Spaceable_grob::add_spring (l, r, distance, strength, false);
}
return max_corr;
}
-/*
- Try to find the break-aligned symbol in SEPARATION_ITEM that is
- sticking out at direction D. The x size is put in LAST_EXT
-*/
-Grob*
-Staff_spacing::extremal_break_aligned_grob (Grob *separation_item, Direction d,
- Interval * last_ext)
-{
- Grob *col = dynamic_cast<Item*> (separation_item)->get_column ();
- last_ext->set_empty ();
- Grob *last_grob = 0;
- for (SCM s = separation_item->get_grob_property ("elements");
- gh_pair_p (s); s = gh_cdr (s))
- {
- Grob * break_item = unsmob_grob (gh_car (s));
-
- if (!gh_symbol_p (break_item->get_grob_property ("break-align-symbol")))
- continue;
-
- Interval ext = break_item->extent (col, X_AXIS);
-
- if (ext.is_empty ())
- continue;
- if (!last_grob
- || (last_grob && d * (ext[d]- (*last_ext)[d]) > 0) )
- {
- *last_ext = ext;
- last_grob = break_item;
- }
- }
-
- return last_grob;
-}
-
void
Staff_spacing::get_spacing_params (Grob *me, Real * space, Real * fixed)
{
}
Interval last_ext;
- Grob *last_grob = extremal_break_aligned_grob (separation_item, RIGHT,
+ Grob *last_grob = Separation_item::extremal_break_aligned_grob (separation_item, RIGHT,
&last_ext);
if (!last_grob)
{
if (me_item->break_status_dir () == CENTER)
{
SCM nndef = scm_sloppy_assq (ly_symbol2scm ("next-note"), alist);
- if (gh_pair_p (nndef ))
+ if (gh_pair_p (nndef))
space_def = nndef;
}
SCM type = gh_car (space_def) ;
*fixed = last_ext[RIGHT];
- if (type == ly_symbol2scm ("extra-space"))
- *space = *fixed + distance;
+ if (type == ly_symbol2scm ("fixed-space"))
+ {
+ *fixed += distance;
+ *space = *fixed;
+ }
+ else if (type == ly_symbol2scm ("extra-space"))
+ {
+ *space = *fixed + distance;
+ }
+ else if (type == ly_symbol2scm ("semi-fixed-space"))
+ {
+ *fixed += distance / 2;
+ *space = *fixed + distance/2;
+ }
else if (type == ly_symbol2scm("minimum-space"))
- *space = last_ext[LEFT] + (last_ext.length () >? distance);
-
+ {
+ *space = last_ext[LEFT] + (last_ext.length () >? distance);
+ }
+ else if (type == ly_symbol2scm("minimum-fixed-space"))
+ {
+ *space = last_ext[LEFT] + (last_ext.length () >? distance);
+ *fixed = *space;
+ }
+
*space += next_notes_correction (me, last_grob);
}
Stanza_number_engraver::acknowledge_grob (Grob_info inf)
{
if (text_
- && inf.grob_->internal_has_interface (ly_symbol2scm ("lyric-text-interface")))
+ && inf.grob_->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface")))
{
Side_position_interface::add_support (text_, inf.grob_);
}
/* stem only extends to center of beam */
- 0.5 * beam_thickness;
- Real minimum_y = note_start + minimum_length;
+ Real minimum_y = note_start + minimum_length;
ideal_y *= my_dir;
Molecule
System_start_delimiter::simple_bar (Grob*me,Real h)
{
- Real w = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")) *
- gh_scm2double (me->get_grob_property ("thickness"));
- return Lookup::filledbox (Box (Interval (0,w), Interval (-h/2, h/2)));
+ Real lt =me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")) ;
+ Real w = lt * gh_scm2double (me->get_grob_property ("thickness"));
+ return Lookup::round_filled_box (Box (Interval (0,w), Interval (-h/2, h/2)),
+ lt);
}
MAKE_SCHEME_CALLBACK (System_start_delimiter,after_line_breaking,1);
*/
Box left_edge_box (Interval (0, line_thickness),
Interval (-0.5*left_height, +0.5*left_height));
- Molecule left_edge = Lookup::filledbox (left_edge_box);
+ Molecule left_edge = Lookup::filled_box (left_edge_box);
molecule.add_molecule(left_edge);
Box right_edge_box (Interval (-line_thickness, 0),
Interval (-0.5*right_height, +0.5*right_height));
- Molecule right_edge = Lookup::filledbox (right_edge_box);
+ Molecule right_edge = Lookup::filled_box (right_edge_box);
right_edge.translate_axis (width, X_AXIS);
right_edge.translate_axis (corrected_interval / 2.0, Y_AXIS);
molecule.add_molecule(right_edge);
save bulb_diam, thin, thick;
bulb_diam# := 0.64 staff_space#;
-thin# := 1.2 stafflinethickness#;
+thin# := 1.4 stafflinethickness# - 0.02 staff_space#;
thick# := 2.2 stafflinethickness#;
crook_thin := 0.5 stafflinethickness + 0.08 staff_space;
define_pixels ( bulb_diam, thin, thick);
+%
+% PAT is a compact way to pass the brush shape to the routine.
+%
+
def draw_rest_bulb(expr ycenter, ycut, pat, stretch) =
begingroup;
save x,y,pt;
fill pat;
- draw_rest_bulb(0.5 staff_space , y2r , pat , 1.0);
+ draw_rest_bulb (0.5 staff_space , y2r , pat , 1.0);
penlabels (1, 2);
labels(9);
%input feta-bolletjes;
%input feta-banier;
%input feta-slag;
-%input feta-eindelijk;
+input feta-eindelijk;
%input feta-klef;
% input feta-toevallig;
% input feta-schrift;
% input feta-haak;
% input feta-timesig;
% input feta-pendaal;
- input feta-accordion;
+% input feta-accordion;
% input feta-solfa;
work: @code{\override} is processed after the StaffSymbol is created,
and will have no effect.
")
-(grob-property-description 'maximum-length ly:dimension? "don't make Grob longer than this")
(grob-property-description 'maximum-rest-count integer? "kill off rests so we don't more than this number left.")
(grob-property-description 'measure-length ly:moment? "Length of a
measure. Used in some spacing situations.")
(key-signature . (extra-space . 0.0))
(staff-bar . (extra-space . 0.0))
(time-signature . (extra-space . 0.0))
- (first-note . (extra-space . 0.0))
+ (first-note . (fixed-space . 0.0))
))
(meta . ((interfaces . (ambitus-interface staff-symbol-referencer-interface break-aligned-interface item-interface font-interface))))
))
(custos . (minimum-space . 2.0))
(clef . (minimum-space . 1.0))
(key-signature . (extra-space . 1.0))
- (first-note . (extra-space . 1.3))
+ (first-note . (fixed-space . 1.3))
+ (next-note . (semi-fixed-space . 1.3))
(right-edge . (extra-space . 0.0))
))
(auto-knee-gap . 5.5)
;; only for debugging.
-; (font-name . "cmr10")
+ (font-name . "cmr10")
(space-function . ,Beam::space_function)
(meta . ((interfaces . (staff-symbol-referencer-interface beam-interface spanner-interface))))
(key-signature . (minimum-space . 1.5))
(staff-bar . (minimum-space . 1.5))
(clef . (minimum-space . 2.0))
- (first-note . (minimum-space . 1.0))
+ (first-note . (fixed-space . 1.0)) ;huh?
(right-edge . (extra-space . 0.1))
))
(molecule-callback . ,Text_item::brew_molecule)
(staff-bar . (extra-space . 0.7))
(key-signature . (minimum-space . 4.0))
(time-signature . (minimum-space . 4.2))
- (first-note . (minimum-space . 5.0))
+ (first-note . (minimum-fixed-space . 5.0))
(next-note . (extra-space . 0.5))
(right-edge . (extra-space . 0.5))
))
(adjust-if-on-staffline . #t)
(Y-offset-callbacks . (,Staff_symbol_referencer::callback))
(space-alist . (
- (first-note . (minimum-space . 0.0))
+ (first-note . (minimum-fixed-space . 0.0))
(right-edge . (extra-space . 0.1))
))
(meta . ((interfaces
(staff-bar . (extra-space . 0.0))
(breathing-sign . (minimum-space . 0.0))
(clef . (extra-space . 0.85))
- (first-note . (extra-space . 1.0))
+ (first-note . (fixed-space . 1.0))
(right-edge . (extra-space . 0.0))
(key-signature . (extra-space . 0.0))
))
(time-signature . (extra-space . 1.25))
(staff-bar . (extra-space . 1.1))
(right-edge . (extra-space . 0.5))
- (first-note . (extra-space . 2.5))
+ (first-note . (fixed-space . 2.5))
))
(Y-offset-callbacks . (,Staff_symbol_referencer::callback))
(break-align-symbol . key-signature)
(LyricHyphen
. (
(thickness . 1.0)
- (height . 0.4)
+ (height . 0.42)
+ (dash-period . 10.0)
+ (length . 0.66)
(minimum-length . 0.5)
(maximum-length . 100)
- (spacing-procedure . ,Hyphen_spanner::set_spacing_rods)
(molecule-callback . ,Hyphen_spanner::brew_molecule)
(Y-extent-callback . ,Grob::point_dimension_callback)
(meta . ((interfaces . (lyric-hyphen-interface spanner-interface))))
. ((molecule-callback . ,Text_item::brew_molecule)
(font-family . roman)
(font-series . bold)
- (padding . 1.5)
+ (padding . 1.0)
(X-offset-callbacks . (,Side_position_interface::aligned_side))
(direction . ,LEFT)
(meta . ((interfaces . (side-position-interface text-interface font-interface item-interface ))))
;; default stem direction for note on middle line
(neutral-direction . -1)
-
- ;; [Wanske]: standard length (but no shorter than minimum).
- ;; (beamed-lengths . (3.5))
-
+
+
+
;; FIXME. 3.5 yields too long beams (according to Ross and
;; 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.
+
+ ;; FIXME this should come from 'lengths
+
(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
- ;; hinaus (bei Gruppen mit grossem Tonumfang)" and the extreme
- ;; case.
-
- ;; Note that Wanske lists numbers lengths starting from top of
- ;; head, so we must add half a staff space.
+; (beamed-lengths . (3.5 3.5 3.5 4.5 5.0))
;; We use the normal minima as minimum for the ideal lengths,
;; and the extreme minima as abolute minimum length.
(break-align-symbol . time-signature)
(break-visibility . ,all-visible)
(space-alist . (
- (first-note . (extra-space . 2.0))
+ (first-note . (fixed-space . 2.0))
(right-edge . (extra-space . 0.5))
(staff-bar . (minimum-space . 2.0))
))
(define-public huge-markup
- (font-markup 'font-relative-size 2))
+ (font-markup 'font-size 2))
(define-public large-markup
- (font-markup 'font-relative-size 1))
+ (font-markup 'font-size 1))
(define-public small-markup
- (font-markup 'font-relative-size -1))
+ (font-markup 'font-size -1))
(define-public tiny-markup
- (font-markup 'font-relative-size -2))
+ (font-markup 'font-size -2))
(define-public teeny-markup
- (font-markup 'font-relative-size -3))
+ (font-markup 'font-size -3))
(define-public dynamic-markup
(font-markup 'font-family 'dynamic))
(define-public italic-markup