From: Jan Nieuwenhuizen Date: Mon, 19 Jul 2004 15:29:31 +0000 (+0000) Subject: * lily/slur-quanting.cc (score_extra_encompass): Bigger penalty X-Git-Tag: release/2.3.8~20 X-Git-Url: https://git.donarmstrong.com/lilypond.git?a=commitdiff_plain;h=3c3dea55e0c1ec68ad502b3972ac4b2e53f2c0e3;p=lilypond.git * lily/slur-quanting.cc (score_extra_encompass): Bigger penalty for and bigger y-padding for extra_encompass. Fixes slur-script.ly. * po/nl.po: Update. * lily/main.cc: Fix ly:option-usage help. --- diff --git a/ChangeLog b/ChangeLog index d137c680b9..bff61f1757 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2004-07-19 Jan Nieuwenhuizen + * lily/slur-quanting.cc (score_extra_encompass): Bigger penalty + for and bigger y-padding for extra_encompass. Fixes slur-script.ly. + + * po/nl.po: Update. + + * lily/main.cc: Fix ly:option-usage help. + * input/regression/slur-script.ly: More collision tests. * GNUmakefile.in (EXTRA_DIST_FILES): Add SConstruct. diff --git a/lily/accidental.cc b/lily/accidental.cc index cde835bd53..3cdcc5f507 100644 --- a/lily/accidental.cc +++ b/lily/accidental.cc @@ -60,7 +60,6 @@ Accidental_interface::accurate_boxes (Grob *a,Grob**common) { SCM cstyle = a->get_property ("cautionary-style"); parens = ly_c_equal_p (cstyle, ly_symbol2scm ("parentheses")); - } SCM accs = a->get_property ("accidentals"); diff --git a/lily/main.cc b/lily/main.cc index e171dfff82..8b5478828b 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -119,7 +119,7 @@ static Getopt_long *option_parser = 0; static Long_option_init options_static[] = { {_i ("EXPR"), "evaluate", 'e', - _i ("set options, use -e '(ly-option-usage)' for help")}, + _i ("set options, use -e '(ly:option-usage)' for help")}, /* Bug in option parser: --output=foe is taken as an abbreviation for --output-format. */ {_i ("EXT"), "format", 'f', _i ("use output format EXT")}, diff --git a/lily/scm-option.cc b/lily/scm-option.cc index d16d3df326..1a26a9d505 100644 --- a/lily/scm-option.cc +++ b/lily/scm-option.cc @@ -61,7 +61,7 @@ LY_DEFINE (ly_option_usage, "ly:option-usage", 0, 0, 0, (SCM), puts (""); printf (_(" The function ly:set-option allows for access to some internal variables.").to_str0 ()); puts ("\n"); - printf (_ ("Usage: lilypond-bin -e \"(ly-set-option SYMBOL VAL)\"").to_str0 ()); + printf (_ ("Usage: lilypond-bin -e \"(ly:set-option SYMBOL VAL)\"").to_str0 ()); puts ("\n"); printf (_ ("Use help as SYMBOL to get online help.").to_str0 ()); @@ -100,13 +100,13 @@ LY_DEFINE (ly_set_option, "ly:set-option", 1, 1, 0, (SCM var, SCM val), "@end table\n" "\n" "This function is useful to call from the command line: @code{lilypond -e\n" -"\"(ly-set-option 'midi-debug #t)\"}.\n") +"\"(ly:set-option 'midi-debug #t)\"}.\n") { if (val == SCM_UNDEFINED) val = SCM_BOOL_T; if (var == ly_symbol2scm ("help")) - /* lilypond -e "(ly-set-option 'help #t)" */ + /* lilypond -e "(ly:set-option 'help #t)" */ ly_option_usage (SCM_EOL); else if (var == ly_symbol2scm ("midi-debug")) midi_debug_global_b = to_boolean (val); diff --git a/lily/slur-quanting.cc b/lily/slur-quanting.cc index 74b18ce611..4fde6b36d1 100644 --- a/lily/slur-quanting.cc +++ b/lily/slur-quanting.cc @@ -7,24 +7,23 @@ Jan Nieuwenhuizen */ - #include -#include "pitch.hh" #include "accidental-interface.hh" +#include "beam.hh" #include "directional-element-interface.hh" #include "group-interface.hh" #include "lily-guile.hh" +#include "new-slur.hh" #include "note-column.hh" #include "output-def.hh" +#include "pitch.hh" #include "slur-bezier-bow.hh" -#include "new-slur.hh" #include "spanner.hh" #include "staff-symbol-referencer.hh" #include "staff-symbol.hh" #include "stem.hh" #include "warn.hh" -#include "beam.hh" struct Slur_score { @@ -74,7 +73,7 @@ struct Slur_score_parameters - short-cut: try a smaller region first. - collisions with accidentals - collisions with articulations (staccato, portato, sforzato, ...) - - + - */ struct Encompass_info { @@ -101,7 +100,7 @@ struct Bound_info Interval slur_head_extent_; Real neighbor_y_; Real staff_space_; - + Bound_info () { stem_ = 0; @@ -181,7 +180,7 @@ init_score_param (Slur_score_parameters *score_param) score_param->MAX_SLOPE = 1.1; score_param->MAX_SLOPE_FACTOR = 10; score_param->FREE_HEAD_DISTANCE = 0.3; - score_param->EXTRA_OBJECT_COLLISION = 8; + score_param->EXTRA_OBJECT_COLLISION = 50; score_param->ACCIDENTAL_COLLISION = 3; } @@ -247,16 +246,13 @@ broken_trend_y (Grob *me, Grob **common, Direction hdir) return by; } - Encompass_info get_encompass_info (Grob *me, Grob *col, Grob **common) { - Grob* stem = unsmob_grob (col->get_property ("stem")); - + Grob *stem = unsmob_grob (col->get_property ("stem")); Encompass_info ei; - Direction dir = get_grob_direction (me); if (!stem) @@ -274,7 +270,7 @@ get_encompass_info (Grob *me, else ei.x_ = col->extent (common[X_AXIS], X_AXIS).center (); - Grob * h = Stem::extremal_heads (stem)[Direction (dir)]; + Grob *h = Stem::extremal_heads (stem)[Direction (dir)]; if (!h) { ei.head_ = ei.stem_ = col->extent (common[Y_AXIS], Y_AXIS)[dir]; @@ -287,9 +283,9 @@ get_encompass_info (Grob *me, && !stem->extent (stem, Y_AXIS).is_empty ()) { ei.stem_ = stem->extent (common[Y_AXIS], Y_AXIS)[dir]; - if (Grob * b = Stem::get_beam (stem)) + if (Grob *b = Stem::get_beam (stem)) ei.stem_ += stem_dir * 0.5 * Beam::get_thickness (b); - ei.x_ = stem->extent (common[X_AXIS], X_AXIS).center (); + ei.x_ = stem->extent (common[X_AXIS], X_AXIS).center (); } else ei.stem_ = ei.head_; @@ -335,11 +331,8 @@ New_slur::after_line_breaking (SCM smob) return SCM_UNSPECIFIED; } - Bezier -get_bezier (Grob *me, Drul_array extremes, - Real r_0, - Real h_inf) +get_bezier (Grob *me, Drul_array extremes, Real r_0, Real h_inf) { Array encompasses; encompasses.push (extremes[LEFT]); @@ -351,36 +344,38 @@ get_bezier (Grob *me, Drul_array extremes, return bb.get_bezier (); } - Drul_array -get_bound_info (Spanner* me, - Grob **common) +get_bound_info (Spanner* me, Grob **common) { Drul_array extremes; Direction d = LEFT; Direction dir = get_grob_direction (me); - do { - extremes[d].bound_ = me->get_bound (d); - - if (Note_column::has_interface (extremes[d].bound_)) - { - extremes[d].note_column_ = extremes[d].bound_; - extremes[d].stem_ = Note_column::get_stem (extremes[d].note_column_); - extremes[d].stem_dir_ = get_grob_direction (extremes[d].stem_); - extremes[d].stem_extent_[X_AXIS] = extremes[d].stem_->extent (common[X_AXIS], X_AXIS); - extremes[d].stem_extent_[Y_AXIS] = extremes[d].stem_->extent (common[Y_AXIS], Y_AXIS); - extremes[d].slur_head_ = Stem::extremal_heads (extremes[d].stem_)[dir]; - extremes[d].slur_head_extent_ = extremes[d].slur_head_->extent (common[X_AXIS], X_AXIS); - extremes[d].staff_ = Staff_symbol_referencer::get_staff_symbol (extremes[d].slur_head_); - extremes[d].staff_space_ = Staff_symbol_referencer::staff_space (extremes[d].slur_head_); - } - else - { + do + { + extremes[d].bound_ = me->get_bound (d); + if (Note_column::has_interface (extremes[d].bound_)) + { + extremes[d].note_column_ = extremes[d].bound_; + extremes[d].stem_ = Note_column::get_stem (extremes[d].note_column_); + extremes[d].stem_dir_ = get_grob_direction (extremes[d].stem_); + extremes[d].stem_extent_[X_AXIS] + = extremes[d].stem_->extent (common[X_AXIS], X_AXIS); + extremes[d].stem_extent_[Y_AXIS] + = extremes[d].stem_->extent (common[Y_AXIS], Y_AXIS); + extremes[d].slur_head_ + = Stem::extremal_heads (extremes[d].stem_)[dir]; + extremes[d].slur_head_extent_ + = extremes[d].slur_head_->extent (common[X_AXIS], X_AXIS); + extremes[d].staff_ = Staff_symbol_referencer + ::get_staff_symbol (extremes[d].slur_head_); + extremes[d].staff_space_ = Staff_symbol_referencer + ::staff_space (extremes[d].slur_head_); + } + else extremes[d].neighbor_y_ = broken_trend_y (me, common, d); - } - } while (flip (&d) != LEFT); - + } + while (flip (&d) != LEFT); return extremes; } @@ -397,23 +392,22 @@ set_end_points (Grob *me) } SCM eltlist = me->get_property ("note-columns"); - - SCM extra_list = me->get_property ("encompass-objects"); Spanner *sp = dynamic_cast (me); - Grob *common[] = {0,0}; + Grob *common[] = {0, 0}; for (int i = X_AXIS; i < NO_AXES; i++) { Axis a = (Axis)i; common[a] = common_refpoint_of_list (eltlist, me, a); common[a] = common_refpoint_of_list (extra_list, common[a], a); } - - common[X_AXIS] = common[X_AXIS]->common_refpoint (sp->get_bound (RIGHT),X_AXIS); + + common[X_AXIS] = common[X_AXIS]->common_refpoint (sp->get_bound (RIGHT), + X_AXIS); common[X_AXIS] = common[X_AXIS]->common_refpoint (sp->get_bound (LEFT), X_AXIS); - + Drul_array extremes = get_bound_info (sp, common); Drul_array base_attachment = get_base_attachments (sp, common, extremes); @@ -427,14 +421,15 @@ set_end_points (Grob *me) score_edges (me, common, ¶ms,extremes, base_attachment, &scores); score_slopes (me, common, ¶ms,extremes, base_attachment, &scores); score_encompass (me, common, ¶ms,extremes, base_attachment, &scores); - score_extra_encompass (me, common, ¶ms,extremes, base_attachment, &scores); - + score_extra_encompass (me, common, ¶ms,extremes, base_attachment, + &scores); + Real opt = 1e6; int opt_idx = 0; // why backwards? for (int i = scores.size (); i--;) { - if (scores[i].score_ < opt) + if (scores[i].score_ < opt) { opt = scores[i].score_; opt_idx = i; @@ -470,7 +465,6 @@ set_end_points (Grob *me) me->set_property ("quant-score", scm_makfrom0str (scores[opt_idx].score_card_.to_str0 ())); #endif - Bezier b = scores[opt_idx].curve_; SCM controls = SCM_EOL; @@ -522,7 +516,7 @@ get_base_attachments (Spanner *me, = Pointer_group_interface__extract_grobs (me, (Grob *)0, "note-columns"); Drul_array base_attachment; Slur_score_parameters params; - Real staff_space = Staff_symbol_referencer::staff_space ((Grob*)me); + Real staff_space = Staff_symbol_referencer::staff_space ((Grob *) me); Direction dir = get_grob_direction (me); Direction d = LEFT; do @@ -575,7 +569,7 @@ get_base_attachments (Spanner *me, && Staff_symbol_referencer::on_staffline (head, (int) rint (pos)) && Staff_symbol_referencer::line_count (head) - 1 >= rint (pos) ) - // TODO: calc from slur thick & line thick, parameter. + // TODO: calc from slur thick & line thick, parameter. y += 1.5 * staff_space * dir / 10; Grob * fh = Note_column::first_head (extremes[d].note_column_); @@ -615,8 +609,8 @@ avoid_staff_line (Grob *me, Grob **common, Bezier bez) { Offset horiz (1,0); - Array ts = bez.solve_derivative (horiz); - Real lt = me->get_paper ()->get_dimension (ly_symbol2scm ("linethickness")); + Array ts = bez.solve_derivative (horiz); + Real lt = me->get_paper ()->get_dimension (ly_symbol2scm ("linethickness")); Real thick = robust_scm2double (me->get_property ("thickness"), 1.0) * lt; /* TODO: handle case of broken slur. */ @@ -639,20 +633,20 @@ avoid_staff_line (Grob *me, Grob **common, && (int (fabs (round (p))) % 2 != Staff_symbol_referencer::line_count (staff) % 2)) { - Direction resolution_dir = + Direction resolution_dir = (distance ? get_grob_direction (me) : Direction (sign (p - round(p)))); // TODO: parameter Real newp = round (p) + resolution_dir * 5 * thick; - + Real dy = (newp - p) * staff_space / 2.0; #if 0 bez.translate (Offset (0, dy)); #else - bez.control_[1][Y_AXIS] += dy; - bez.control_[2][Y_AXIS] += dy; - + bez.control_[1][Y_AXIS] += dy; + bez.control_[2][Y_AXIS] += dy; + #endif } } @@ -660,17 +654,18 @@ avoid_staff_line (Grob *me, Grob **common, } Array -enumerate_attachments (Grob *me, Grob **, +enumerate_attachments (Grob *me, Grob *common[], Slur_score_parameters *score_param, Drul_array extremes, Drul_array base_attachment, Drul_array end_ys) { + (void) common; /*ugh. */ Array scores; Direction dir = get_grob_direction (me); - Real staff_space = Staff_symbol_referencer::staff_space ((Grob *)me); + Real staff_space = Staff_symbol_referencer::staff_space ((Grob *) me); Drul_array os; os[LEFT] = base_attachment[LEFT]; @@ -685,27 +680,28 @@ enumerate_attachments (Grob *me, Grob **, Slur_score s; Direction d = LEFT; Drul_array attach_to_stem (false, false); - do { - os[d][X_AXIS] = base_attachment[d][X_AXIS]; - if (extremes[d].stem_ - && !Stem::is_invisible (extremes[d].stem_) - && extremes[d].stem_dir_ == dir - && dir == -d) - { - if (extremes[d].stem_extent_[Y_AXIS].contains (os[d][Y_AXIS])) - { - os[d][X_AXIS] = extremes[d].slur_head_extent_[-d] - - d * 0.3; - attach_to_stem[d] = true; - } - else if (dir *extremes[d].stem_extent_[Y_AXIS][dir] < dir * os[d][Y_AXIS]) - { + do + { + os[d][X_AXIS] = base_attachment[d][X_AXIS]; + if (extremes[d].stem_ + && !Stem::is_invisible (extremes[d].stem_) + && extremes[d].stem_dir_ == dir + && dir == -d) + { + if (extremes[d].stem_extent_[Y_AXIS].contains (os[d][Y_AXIS])) + { + os[d][X_AXIS] = extremes[d].slur_head_extent_[-d] + - d * 0.3; + attach_to_stem[d] = true; + } + else if (dir *extremes[d].stem_extent_[Y_AXIS][dir] + < dir * os[d][Y_AXIS]) os[d][X_AXIS] = extremes[d].stem_extent_[X_AXIS].center(); - } - } - } while (flip (&d) != LEFT); + } + } + while (flip (&d) != LEFT); - Offset dz; + Offset dz; dz = os[RIGHT] - os[LEFT]; if (dz[X_AXIS] < minimum_length || fabs (dz[Y_AXIS] / dz[X_AXIS]) > score_param->MAX_SLOPE @@ -723,40 +719,43 @@ enumerate_attachments (Grob *me, Grob **, } dz = os[RIGHT] - os[LEFT]; - do { - if (extremes[d].slur_head_ - && !attach_to_stem[d]) - { - /* - horizontally move tilted slurs a little. Move more - for bigger tilts. - - TODO: parameter - */ - os[d][X_AXIS] -= - dir * extremes[d].slur_head_extent_.length () * sin (dz.arg ()) / 3; - } - } while (flip (&d) != LEFT); + do + { + if (extremes[d].slur_head_ + && !attach_to_stem[d]) + { + /* Horizontally move tilted slurs a little. Move + more for bigger tilts. + + TODO: parameter */ + os[d][X_AXIS] + -= dir * extremes[d].slur_head_extent_.length () + * sin (dz.arg ()) / 3; + } + } + while (flip (&d) != LEFT); s.attachment_ = os; scores.push (s); - + os[RIGHT][Y_AXIS] += dir * staff_space / 2; } - + os[LEFT][Y_AXIS] += dir * staff_space / 2; } - return scores; } void score_encompass (Grob *me, Grob *common[], Slur_score_parameters *score_param, - Drul_array , - Drul_array , - Array * scores) + Drul_array extremes, + Drul_array base_attach, + Array *scores) { + (void) extremes; + (void) base_attach; + Link_array encompasses = Pointer_group_interface__extract_grobs (me, (Grob *)0, "note-columns"); Direction dir = get_grob_direction (me); @@ -777,7 +776,7 @@ score_encompass (Grob *me, Grob *common[], bool l_edge = j==0; bool r_edge = j==infos.size()-1; bool edge = l_edge || r_edge; - + if (!(x < scores->elem (i).attachment_[RIGHT][X_AXIS] && x > scores->elem (i).attachment_[LEFT][X_AXIS])) continue; @@ -797,16 +796,14 @@ score_encompass (Grob *me, Grob *common[], demerit += hd; } - } + } if (dir * (y - infos[j].stem_) < 0) { - Real stem_dem =score_param->STEM_ENCOMPASS_PENALTY ; + Real stem_dem =score_param->STEM_ENCOMPASS_PENALTY ; if ((l_edge && dir == UP) || (r_edge && dir == DOWN)) - { - stem_dem /= 5; - } + stem_dem /= 5; demerit += stem_dem; } @@ -816,8 +813,12 @@ score_encompass (Grob *me, Grob *common[], ext.add_point (infos[j].stem_); ext.add_point (infos[j].head_); - demerit += - score_param->CLOSENESS_FACTOR * (dir * (y - (ext[dir] + dir * score_param->FREE_HEAD_DISTANCE)) CLOSENESS_FACTOR + * (dir + * (y - (ext[dir] + dir * score_param->FREE_HEAD_DISTANCE)) + , - Drul_array , - Array * scores) + Slur_score_parameters *score_param, + Drul_array extremes, + Drul_array base_attach, + Array *scores) { + (void) base_attach; + (void) extremes; + Link_array encompasses - = Pointer_group_interface__extract_grobs (me, (Grob *)0, "encompass-objects"); + = Pointer_group_interface__extract_grobs (me, (Grob *)0, + "encompass-objects"); Direction dir = get_grob_direction (me); - Real lt = me->get_paper ()->get_dimension (ly_symbol2scm ("linethickness")); - Real thick = robust_scm2double (me->get_property ("thickness"), 1.0) * lt; + Real staff_space = Staff_symbol_referencer::staff_space ((Grob *) me); + Real lt = me->get_paper ()->get_dimension (ly_symbol2scm ("linethickness")); + Real thick = robust_scm2double (me->get_property ("thickness"), 1.0) * lt; + + /* FIXME: use actual height of script? + ugh: see slur-script.ly + must be <= 0.75 for b-.( b-. BUT + must be >= 0.9 for b-- ( b-) + + both settings break the other. */ + Real y_padding = 0.9 * staff_space; Array xs; Array yexts; - for (int i = 0; i < encompasses.size(); i++) + for (int i = 0; i < encompasses.size (); i++) { Grob *g = encompasses [i]; Interval xe = g->extent (common[X_AXIS], X_AXIS); Interval ye = g->extent (common[Y_AXIS], Y_AXIS); Real xp = 0.0; - + if (Accidental_interface::has_interface (g)) { - /* - C&P accidental.cc - */ + /* Begin copy accidental.cc */ bool parens = false; if (to_boolean (g->get_property ("cautionary"))) { SCM cstyle = g->get_property ("cautionary-style"); parens = ly_c_equal_p (cstyle, ly_symbol2scm ("parentheses")); - } - + SCM accs = g->get_property ("accidentals"); SCM scm_style = g->get_property ("style"); if (!ly_c_symbol_p (scm_style) && !parens && scm_ilength (accs) == 1) { - switch (ly_scm2int (ly_car (accs))) { - case FLAT: - case DOUBLE_FLAT: - xp = LEFT; - case SHARP: - xp = 0.5* dir; - case NATURAL: - xp = -dir; - } + /* End copy accidental.cc */ + switch (ly_scm2int (ly_car (accs))) + { + case FLAT: + case DOUBLE_FLAT: + xp = LEFT; + /* fallthrough */ + case SHARP: + xp = 0.5 * dir; + /* fallthrough */ + case NATURAL: + xp = -dir; + } } - } + xs.push (xe.linear_combination (xp)); - ye.widen (.5 * thick); + ye.widen (thick * 0.5); + ye[dir] += dir * y_padding; yexts.push (ye); } - + for (int i = 0; i < scores->size (); i++) { Bezier const &bez (scores->elem (i).curve_); @@ -898,21 +912,19 @@ score_extra_encompass (Grob *me, Grob *common[], for (int j = 0; j < xs.size(); j++) { Real x = xs[j]; - if (!(x < scores->elem (i).attachment_[RIGHT][X_AXIS] - && x > scores->elem (i).attachment_[LEFT][X_AXIS])) - continue; - - Real y = bez.get_other_coordinate (X_AXIS, x); - - if (yexts[j].contains (y)) - { - if (Accidental_interface::has_interface (encompasses[j])) - demerit += score_param->ACCIDENTAL_COLLISION; - else - demerit += score_param->EXTRA_OBJECT_COLLISION; + if ((x < scores->elem (i).attachment_[RIGHT][X_AXIS] + && x > scores->elem (i).attachment_[LEFT][X_AXIS])) + { + Real y = bez.get_other_coordinate (X_AXIS, x); + if (yexts[j].contains (y)) + { + if (Accidental_interface::has_interface (encompasses[j])) + demerit += score_param->ACCIDENTAL_COLLISION; + else + demerit += score_param->EXTRA_OBJECT_COLLISION; + } } } - #if DEBUG_SLUR_QUANTING (*scores)[i].score_card_ += to_string ("X%.2f", demerit); #endif @@ -920,89 +932,93 @@ score_extra_encompass (Grob *me, Grob *common[], } } - void -score_edges (Grob *me, Grob **, +score_edges (Grob *me, Grob *common[], Slur_score_parameters * score_param, Drul_array extremes, Drul_array base_attach, Array *scores) { + (void) common; Direction dir = get_grob_direction (me); for (int i = 0; i < scores->size (); i++) { - Direction d = LEFT; - do { - Real y = scores->elem (i).attachment_[d][Y_AXIS]; - Real dy = fabs (y - base_attach[d][Y_AXIS]); + do + { + Real y = scores->elem (i).attachment_[d][Y_AXIS]; + Real dy = fabs (y - base_attach[d][Y_AXIS]); - Real factor = score_param->EDGE_ATTRACTION_FACTOR; - Real demerit = factor * dy; - if (extremes[d].stem_ - && extremes[d].stem_dir_ == dir - && !Stem::get_beaming (extremes[d].stem_, -d) - ) - demerit /= 5; + Real factor = score_param->EDGE_ATTRACTION_FACTOR; + Real demerit = factor * dy; + if (extremes[d].stem_ + && extremes[d].stem_dir_ == dir + && !Stem::get_beaming (extremes[d].stem_, -d) + ) + demerit /= 5; - (*scores)[i].score_ += demerit; + (*scores)[i].score_ += demerit; #if DEBUG_SLUR_QUANTING - (*scores)[i].score_card_ += to_string ("E%.2f", demerit); + (*scores)[i].score_card_ += to_string ("E%.2f", demerit); #endif - } while (flip (&d) != LEFT); + } + while (flip (&d) != LEFT); } } void score_slopes (Grob *me, Grob *common[], - Slur_score_parameters*score_param, + Slur_score_parameters *score_param, Drul_array extremes, - Drul_array , + Drul_array base_attach, Array * scores) { - Drul_array ys; + (void) me; + (void) base_attach; + Drul_array ys; Direction d = LEFT; - do { - if (extremes[d].slur_head_) - ys[d] = extremes[d].slur_head_ ->relative_coordinate (common[Y_AXIS], - Y_AXIS); - else - ys[d] = extremes[d].neighbor_y_; - } while (flip (&d) != LEFT); + do + { + if (extremes[d].slur_head_) + ys[d] = extremes[d].slur_head_->relative_coordinate (common[Y_AXIS], + Y_AXIS); + else + ys[d] = extremes[d].neighbor_y_; + } + while (flip (&d) != LEFT); bool has_beams = (extremes[LEFT].stem_ && Stem::get_beam (extremes[LEFT].stem_)) || (extremes[RIGHT].stem_ && Stem::get_beam (extremes[RIGHT].stem_)); - Direction dir = get_grob_direction (me); Real dy = ys[RIGHT] - ys[LEFT]; for (int i = 0; i < scores->size (); i++) { Offset slur_dz = (*scores)[i].attachment_[RIGHT] - - (*scores)[i].attachment_[LEFT]; - Real slur_dy = slur_dz[Y_AXIS]; + - (*scores)[i].attachment_[LEFT]; + Real slur_dy = slur_dz[Y_AXIS]; Real demerit = 0.0; - demerit += ((fabs (slur_dy/slur_dz[X_AXIS]) + demerit += ((fabs (slur_dy / slur_dz[X_AXIS]) - score_param->MAX_SLOPE) >? 0) * score_param->MAX_SLOPE_FACTOR; - /* - 0.2: account for staffline offset. - */ + /* 0.2: account for staffline offset. */ Real max_dy = (fabs (dy) + 0.2); if (has_beams) - max_dy += 1.0; - - demerit += score_param->STEEPER_SLOPE_FACTOR * ((fabs (slur_dy) -max_dy) >? 0); + max_dy += 1.0; - - demerit += ((fabs (slur_dy/slur_dz[X_AXIS]) - score_param->MAX_SLOPE)>?0) * score_param->MAX_SLOPE_FACTOR; - - if (sign (dy) == 0 && - sign (slur_dy) != 0) + demerit += score_param->STEEPER_SLOPE_FACTOR + * ((fabs (slur_dy) -max_dy) >? 0); + + demerit += ((fabs (slur_dy/slur_dz[X_AXIS]) + - score_param->MAX_SLOPE) >? 0) + * score_param->MAX_SLOPE_FACTOR; + + if (sign (dy) == 0 + && sign (slur_dy) != 0) demerit += score_param->NON_HORIZONTAL_PENALTY; if (sign (dy) @@ -1013,7 +1029,7 @@ score_slopes (Grob *me, Grob *common[], : score_param->SAME_SLOPE_PENALTY; #if DEBUG_SLUR_QUANTING - (*scores)[i].score_card_ += to_string ("S%.2f",d); + (*scores)[i].score_card_ += to_string ("S%.2f", d); #endif (*scores)[i].score_ += demerit; } diff --git a/po/lilypond.pot b/po/lilypond.pot index 73a00db5c5..a2bf4c9537 100644 --- a/po/lilypond.pot +++ b/po/lilypond.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2004-07-18 16:01+0200\n" +"POT-Creation-Date: 2004-07-19 01:17+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -153,6 +153,12 @@ msgstr "" #. for --output-format. #. Bug in option parser: --output=foe is taken as an abbreviation #. for --output-format. +#. Bug in option parser: --output=foe is taken as an abbreviation +#. for --output-format. +#. Bug in option parser: --output=foe is taken as an abbreviation +#. for --output-format. +#. Bug in option parser: --output=foe is taken as an abbreviation +#. for --output-format. #: lilypond-book.py:82 old-lilypond-book.py:123 main.cc:138 lily/main.cc:125 msgid "EXT" msgstr "" @@ -487,6 +493,7 @@ msgstr "" #: lilypond.py:979 includable-lexer.cc:57 input-file-results.cc:217 #: input-file-results.cc:224 lily-guile.cc:86 lily/includable-lexer.cc:57 #: lily/kpath.cc:134 lily/lily-guile.cc:85 lily/my-lily-parser.cc:282 +#: lily/my-lily-parser.cc:286 #, c-format, python-format msgid "can't find file: `%s'" msgstr "" @@ -722,16 +729,19 @@ msgid "accidental `%s' not found" msgstr "" #: accidental-engraver.cc:167 lily/accidental-engraver.cc:194 +#: lily/accidental-engraver.cc:195 #, c-format msgid "Accidental typesetting list must begin with context-name: %s" msgstr "" #: accidental-engraver.cc:194 lily/accidental-engraver.cc:222 +#: lily/accidental-engraver.cc:223 #, c-format msgid "ignoring unknown accidental: %s" msgstr "" #: accidental-engraver.cc:211 lily/accidental-engraver.cc:239 +#: lily/accidental-engraver.cc:240 #, c-format msgid "Accidental rule must be pair or context-name; Found %s" msgstr "" @@ -753,6 +763,9 @@ msgstr "" #. FIXME: broken sentence #. FIXME: broken sentence #. FIXME: broken sentence +#. FIXME: broken sentence +#. FIXME: broken sentence +#. FIXME: broken sentence #: all-font-metrics.cc:100 lily/all-font-metrics.cc:95 #, c-format msgid "checksum mismatch for font file: `%s'" @@ -791,7 +804,7 @@ msgstr "" #: all-font-metrics.cc:209 includable-lexer.cc:59 input-file-results.cc:218 #: lily/all-font-metrics.cc:201 lily/includable-lexer.cc:59 -#: lily/my-lily-parser.cc:275 +#: lily/my-lily-parser.cc:275 lily/my-lily-parser.cc:279 #, c-format msgid "(search path: `%s')" msgstr "" @@ -931,6 +944,24 @@ msgstr "" #. #. last->translator_id_string () = get_change ()->change_to_id_string (); #. +#. +#. We could change the current translator's id, but that would make +#. errors hard to catch +#. +#. last->translator_id_string () = get_change ()->change_to_id_string (); +#. +#. +#. We could change the current translator's id, but that would make +#. errors hard to catch +#. +#. last->translator_id_string () = get_change ()->change_to_id_string (); +#. +#. +#. We could change the current translator's id, but that would make +#. errors hard to catch +#. +#. last->translator_id_string () = get_change ()->change_to_id_string (); +#. #: change-iterator.cc:93 lily/change-iterator.cc:93 msgid "I'm one myself" msgstr "" @@ -1128,6 +1159,7 @@ msgid "can't open file: `%s'" msgstr "" #: input-file-results.cc:142 lily/my-lily-parser.cc:291 +#: lily/my-lily-parser.cc:295 #, c-format msgid "Now processing `%s'" msgstr "" @@ -1285,6 +1317,9 @@ msgstr "" #. No version number or newline here. It confuses help2man. #. No version number or newline here. It confuses help2man. #. No version number or newline here. It confuses help2man. +#. No version number or newline here. It confuses help2man. +#. No version number or newline here. It confuses help2man. +#. No version number or newline here. It confuses help2man. #: main.cc:196 lily/main.cc:181 #, c-format msgid "Usage: %s [OPTIONS]... FILE..." @@ -1421,6 +1456,15 @@ msgstr "" #. #. music for the softenon children? #. +#. +#. music for the softenon children? +#. +#. +#. music for the softenon children? +#. +#. +#. music for the softenon children? +#. #: new-fingering-engraver.cc:155 lily/new-fingering-engraver.cc:153 msgid "music for the martians." msgstr "" @@ -1609,7 +1653,7 @@ msgstr "" msgid "Don't know how to interpret articulation:" msgstr "" -#: script-engraver.cc:97 lily/script-engraver.cc:97 +#: script-engraver.cc:97 lily/script-engraver.cc:97 lily/script-engraver.cc:95 msgid "Scheme encoding: " msgstr "" @@ -1626,6 +1670,9 @@ msgstr "" #. this shouldn't happen, but let's continue anyway. #. this shouldn't happen, but let's continue anyway. #. this shouldn't happen, but let's continue anyway. +#. this shouldn't happen, but let's continue anyway. +#. this shouldn't happen, but let's continue anyway. +#. this shouldn't happen, but let's continue anyway. #: separation-item.cc:53 separation-item.cc:97 lily/separation-item.cc:53 #: lily/separation-item.cc:97 msgid "Separation_item: I've been drinking too much" @@ -1636,7 +1683,7 @@ msgstr "" msgid "No spring between column %d and next one" msgstr "" -#: slur-engraver.cc:121 lily/slur-engraver.cc:121 +#: slur-engraver.cc:121 lily/slur-engraver.cc:121 lily/slur-engraver.cc:128 msgid "unterminated slur" msgstr "" @@ -1666,7 +1713,13 @@ msgstr "" #. eaten start event? #. How to shut up this warning, when Voice_devnull_engraver has #. eaten start event? -#: slur-engraver.cc:139 lily/slur-engraver.cc:139 +#. How to shut up this warning, when Voice_devnull_engraver has +#. eaten start event? +#. How to shut up this warning, when Voice_devnull_engraver has +#. eaten start event? +#. How to shut up this warning, when Voice_devnull_engraver has +#. eaten start event? +#: slur-engraver.cc:139 lily/slur-engraver.cc:139 lily/slur-engraver.cc:146 msgid "can't find start of slur" msgstr "" @@ -1699,16 +1752,19 @@ msgstr "" msgid "flag stroke `%s' not found" msgstr "" -#: stem-engraver.cc:97 lily/stem-engraver.cc:100 +#: stem-engraver.cc:97 lily/stem-engraver.cc:100 lily/stem-engraver.cc:84 msgid "tremolo duration is too long" msgstr "" -#: stem-engraver.cc:128 lily/stem-engraver.cc:126 +#. FIXME: +#. FIXME: +#. FIXME: +#: stem-engraver.cc:128 lily/stem-engraver.cc:126 lily/stem-engraver.cc:117 #, c-format msgid "Adding note head to incompatible stem (type = %d)" msgstr "" -#: stem-engraver.cc:129 lily/stem-engraver.cc:127 +#: stem-engraver.cc:129 lily/stem-engraver.cc:127 lily/stem-engraver.cc:119 msgid "Don't you want polyphonic voices instead?" msgstr "" @@ -1769,6 +1825,12 @@ msgstr "" #. more of a programming error. #. Not using ngettext's plural feature here, as this message is #. more of a programming error. +#. Not using ngettext's plural feature here, as this message is +#. more of a programming error. +#. Not using ngettext's plural feature here, as this message is +#. more of a programming error. +#. Not using ngettext's plural feature here, as this message is +#. more of a programming error. #: tfm-reader.cc:108 lily/tfm-reader.cc:108 #, c-format msgid "TFM header of `%s' has only %u word (s)" @@ -1813,6 +1875,12 @@ msgstr "" #. (Here really with a warning!) #. If there is no such symbol, we default to the numbered style. #. (Here really with a warning!) +#. If there is no such symbol, we default to the numbered style. +#. (Here really with a warning!) +#. If there is no such symbol, we default to the numbered style. +#. (Here really with a warning!) +#. If there is no such symbol, we default to the numbered style. +#. (Here really with a warning!) #: time-signature.cc:95 lily/time-signature.cc:95 #, c-format msgid "time signature symbol `%s' not found; reverting to numbered style" @@ -1883,6 +1951,21 @@ msgstr "" #. #. OTOH, Tristan Keuris writes 8/20 in his Intermezzi. #. +#. +#. Todo: should make typecheck? +#. +#. OTOH, Tristan Keuris writes 8/20 in his Intermezzi. +#. +#. +#. Todo: should make typecheck? +#. +#. OTOH, Tristan Keuris writes 8/20 in his Intermezzi. +#. +#. +#. Todo: should make typecheck? +#. +#. OTOH, Tristan Keuris writes 8/20 in his Intermezzi. +#. #: time-signature-engraver.cc:57 lily/time-signature-engraver.cc:57 #, c-format msgid "Found strange time signature %d/%d." @@ -2057,7 +2140,7 @@ msgstr "" msgid "kpathsea can not find file: `%s'" msgstr "" -#: lily/my-lily-parser.cc:274 +#: lily/my-lily-parser.cc:274 lily/my-lily-parser.cc:278 #, c-format msgid "can't find init file: `%s'" msgstr "" @@ -2087,3 +2170,19 @@ msgstr "" #, c-format msgid "No such internal option: %s" msgstr "" + +#. FIXME: +#. FIXME: +#. FIXME: +#: lily/script-engraver.cc:94 +msgid "Do not know how to interpret articulation: " +msgstr "" + +#: lily/main.cc:122 +msgid "set options, use -e '(ly:option-usage)' for help" +msgstr "" + +#: lily/scm-option.cc:64 +#, c-format +msgid "Usage: lilypond-bin -e \"(ly:set-option SYMBOL VAL)\"" +msgstr "" diff --git a/po/nl.po b/po/nl.po index 30f42c63b1..c5f480b983 100644 --- a/po/nl.po +++ b/po/nl.po @@ -1135,8 +1135,8 @@ msgid "EXPR" msgstr "EXPR" #: main.cc:136 -msgid "set options, use -e '(ly-option-usage)' for help" -msgstr "zet opties, gebruik -e '(ly-option-usage)' voor hulp" +msgid "set options, use -e '(ly:option-usage)' for help" +msgstr "zet opties, gebruik -e '(ly:option-usage)' voor hulp" #: main.cc:139 msgid "use output format EXT" @@ -1414,13 +1414,13 @@ msgstr " Verscheidene -e opties mogen worden gegeven, deze zullen sequentieel w #: scm-option.cc:58 #, c-format -msgid " The function ly-set-option allows for access to some internal variables." -msgstr " De functie ly-set-option verschaft toegang tot bepaalde interne variabelen." +msgid " The function ly:set-option allows for access to some internal variables." +msgstr " De functie ly:set-option verschaft toegang tot bepaalde interne variabelen." #: scm-option.cc:60 #, c-format -msgid "Usage: lilypond-bin -e \"(ly-set-option SYMBOL VAL)\"" -msgstr "Gebruik: lilypond-bin -e \"(ly-set-option SYMBOOL WAARDE)\"" +msgid "Usage: lilypond-bin -e \"(ly:set-option SYMBOL VAL)\"" +msgstr "Gebruik: lilypond-bin -e \"(ly:set-option SYMBOOL WAARDE)\"" #: scm-option.cc:62 #, c-format