From: Han-Wen Nienhuys Date: Wed, 22 Feb 2006 13:26:44 +0000 (+0000) Subject: * lily/slur-configuration.cc (fit_factor): oops, skip point if X-Git-Tag: release/2.7.36~3 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=6c6ae92410f087d0318a3c302eb6877cfc7fae45;p=lilypond.git * lily/slur-configuration.cc (fit_factor): oops, skip point if intersection gets smaller. This fixes slurs over extreme points. * lily/melody-engraver.cc (stop_translation_timestep): ignore stems with neutral-direction set. * lily/piano-pedal-engraver.cc (create_text_grobs): idem. * lily/open-type-font.cc (load_table): format error. * lily/change-iterator.cc (process): format fix. * flower/include/international.hh (_f): idem. * flower/include/std-string.hh: add format printf attribute. * scm/define-grobs.scm (all-grob-descriptions): height of all PedalLineSpanner is Y-extent property. Fixes pedal-ped.ly --- diff --git a/ChangeLog b/ChangeLog index 80515e5829..a3e60e6b1a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,24 @@ 2006-02-22 Han-Wen Nienhuys + * lily/slur-configuration.cc (fit_factor): oops, skip point if + intersection gets smaller. This fixes slurs over extreme points. + + * lily/melody-engraver.cc (stop_translation_timestep): ignore + stems with neutral-direction set. + + * lily/piano-pedal-engraver.cc (create_text_grobs): idem. + + * lily/open-type-font.cc (load_table): format error. + + * lily/change-iterator.cc (process): format fix. + + * flower/include/international.hh (_f): idem. + + * flower/include/std-string.hh: add format printf attribute. + + * scm/define-grobs.scm (all-grob-descriptions): height of all + PedalLineSpanner is Y-extent property. Fixes pedal-ped.ly + * lily/ambitus-engraver.cc (finalize): use grob_array. This fixes ambitus lines. diff --git a/flower/include/international.hh b/flower/include/international.hh index 1b29c45fa9..d1c71ed08b 100644 --- a/flower/include/international.hh +++ b/flower/include/international.hh @@ -28,7 +28,8 @@ string _ (char const *ch); Internationalisation: _f ("Usage: %s [FILE]", "lilypond") gets "translated" by GNU gettext */ -string _f (char const *format, ...); +string _f (char const *format, ...) + __attribute__ ((format (printf, 1, 2))); string _f (char const *format, string s, string s2 = "", string s3 = ""); #endif // INTERNATIONAL_HH diff --git a/flower/include/std-string.hh b/flower/include/std-string.hh index d9552b4820..bc2fd61ee5 100644 --- a/flower/include/std-string.hh +++ b/flower/include/std-string.hh @@ -26,7 +26,8 @@ string to_string (long); string to_string (long unsigned); string to_string (unsigned); string to_string (bool b); -string to_string (char const *format, ...); +string to_string (char const *format, ...) + __attribute__ ((format (printf, 1, 2))); string &replace_all (string &str, string find, string replace); string &replace_all (string &str, char find, char replace); diff --git a/lily/change-iterator.cc b/lily/change-iterator.cc index 43631687c8..aef7567be0 100644 --- a/lily/change-iterator.cc +++ b/lily/change-iterator.cc @@ -88,7 +88,7 @@ Change_iterator::process (Moment m) last->translator_id_string () = get_change ()->change_to_id_string (); */ - error (_f ("not changing to same context type: %s", to_type)); + error (_f ("not changing to same context type: %s", ly_symbol2string (to_type).c_str ())); } else /* FIXME: uncomprehensable message */ diff --git a/lily/context-def.cc b/lily/context-def.cc index d8349f4d97..d77b075322 100644 --- a/lily/context-def.cc +++ b/lily/context-def.cc @@ -308,7 +308,7 @@ Context_def::instantiate (SCM ops, Object_key const *key) { Translator *t = get_translator (scm_car (s)); if (!t) - warning (_f ("can't find: `%s'", s)); + warning (_f ("can't find: `%s'", ly_symbol2string (scm_car (s)).c_str ())); else { Translator *tr = t->clone (); diff --git a/lily/include/misc.hh b/lily/include/misc.hh index be9b2c4f2c..4303d3b7b5 100644 --- a/lily/include/misc.hh +++ b/lily/include/misc.hh @@ -37,5 +37,6 @@ linear_interpolate (Real x, Real x1, Real x2, Real y1, Real y2) Real directed_round (Real f, Direction d); +Real peak_around (Real epsilon, Real threshold, Real x); #endif diff --git a/lily/include/slur-configuration.hh b/lily/include/slur-configuration.hh index f9ebea2a7d..b1b9f9a6e5 100644 --- a/lily/include/slur-configuration.hh +++ b/lily/include/slur-configuration.hh @@ -15,21 +15,25 @@ class Slur_configuration { + Real score_; + string score_card_; + public: Drul_array attachment_; - Real score_; Bezier curve_; Real height_; int index_; - string score_card_; - Slur_configuration (); + Real score () const { return score_; } + string card () const { return score_card_; } + void add_score (Real, string); + void generate_curve (Slur_score_state const &state, Real r0, Real h_inf, vector const &); - void score (Slur_score_state const &); + void calculate_score (Slur_score_state const &); protected: void score_extra_encompass (Slur_score_state const &); void score_slopes (Slur_score_state const &); diff --git a/lily/include/slur-score-parameters.hh b/lily/include/slur-score-parameters.hh new file mode 100644 index 0000000000..5ae14071da --- /dev/null +++ b/lily/include/slur-score-parameters.hh @@ -0,0 +1,39 @@ +/* + slur-score-paramaters.hh -- declare Slur_score_parameters + + source file of the GNU LilyPond music typesetter + + (c) 2006 Han-Wen Nienhuys + +*/ + +#ifndef SLUR_SCORE_PARAMATERS_HH +#define SLUR_SCORE_PARAMATERS_HH + +#include "lily-proto.hh" + +struct Slur_score_parameters +{ + int region_size_; + Real head_encompass_penalty_; + Real stem_encompass_penalty_; + Real closeness_factor_; + Real edge_attraction_factor_; + Real same_slope_penalty_; + Real steeper_slope_factor_; + Real non_horizontal_penalty_; + Real max_slope_; + Real max_slope_factor_; + Real extra_object_collision_penalty_; + Real accidental_collision_; + Real free_slur_distance_; + Real free_head_distance_; + Real extra_encompass_free_distance_; + Real absolute_closeness_measure_; + Real edge_slope_exponent_; + Real head_slur_distance_max_ratio_; + Real head_slur_distance_factor_; + + void fill (Grob *him); +}; +#endif /* SLUR_SCORE_PARAMATERS_HH */ diff --git a/lily/include/slur-scoring.hh b/lily/include/slur-scoring.hh index 0164116a14..4668c58489 100644 --- a/lily/include/slur-scoring.hh +++ b/lily/include/slur-scoring.hh @@ -13,31 +13,7 @@ #include "lily-proto.hh" #include "std-vector.hh" #include "lily-guile.hh" - -struct Slur_score_parameters -{ - int region_size_; - Real head_encompass_penalty_; - Real stem_encompass_penalty_; - Real closeness_factor_; - Real edge_attraction_factor_; - Real same_slope_penalty_; - Real steeper_slope_factor_; - Real non_horizontal_penalty_; - Real max_slope_; - Real max_slope_factor_; - Real extra_object_collision_penalty_; - Real accidental_collision_; - Real free_slur_distance_; - Real free_head_distance_; - Real extra_encompass_free_distance_; - Real absolute_closeness_measure_; - Real edge_slope_exponent_; - Real head_slur_distance_max_ratio_; - Real head_slur_distance_factor_; - - void fill (Grob *him); -}; +#include "slur-score-parameters.hh" struct Extra_collision_info { diff --git a/lily/melody-engraver.cc b/lily/melody-engraver.cc index 86e637ca36..ee0e07c9b9 100644 --- a/lily/melody-engraver.cc +++ b/lily/melody-engraver.cc @@ -43,7 +43,8 @@ Melody_engraver::process_music () void Melody_engraver::stop_translation_timestep () { - if (stem_) + if (stem_ + && !is_direction (stem_->get_property_data (ly_symbol2scm ("neutral-direction")))) { extract_grob_set (stem_, "rests", rests); if (rests.size ()) diff --git a/lily/misc.cc b/lily/misc.cc index 54da3d0f55..e7c3063df2 100644 --- a/lily/misc.cc +++ b/lily/misc.cc @@ -43,3 +43,15 @@ directed_round (Real f, Direction d) return ceil (f); } + + +/* + 0 at threshold, 1 at 0, with 1/x falloff. + */ +Real +peak_around (Real epsilon, Real threshold, Real x) +{ + if (x < 0) + return 1.0; + return max (- epsilon * (x - threshold) / ((x + epsilon) * threshold), 0.0); +} diff --git a/lily/open-type-font.cc b/lily/open-type-font.cc index 73395fb9cb..8e50a1a576 100644 --- a/lily/open-type-font.cc +++ b/lily/open-type-font.cc @@ -30,7 +30,7 @@ load_table (char const *tag_str, FT_Face face, FT_ULong *length) { FT_Byte *buffer = (FT_Byte *) malloc (*length); if (buffer == NULL) - error (_f ("can't allocate %d bytes", *length)); + error (_f ("can't allocate %lu bytes", *length)); error_code = FT_Load_Sfnt_Table (face, tag, 0, buffer, length); if (error_code) diff --git a/lily/piano-pedal-engraver.cc b/lily/piano-pedal-engraver.cc index 86e0e032e9..2d380fb352 100644 --- a/lily/piano-pedal-engraver.cc +++ b/lily/piano-pedal-engraver.cc @@ -220,7 +220,7 @@ Piano_pedal_engraver::create_text_grobs (Pedal_info *p, bool mixed) Music *m = p->event_drul_[START]; if (!m) m = p->event_drul_ [STOP]; - string msg = _f ("expect 3 strings for piano pedals, found: %d", + string msg = _f ("expect 3 strings for piano pedals, found: %ld", scm_ilength (strings)); if (m) m->origin ()->warning (msg); @@ -511,16 +511,31 @@ Piano_pedal_engraver::typeset_all (Pedal_info *p) } #include "translator.icc" + ADD_ACKNOWLEDGER (Piano_pedal_engraver, note_column); + ADD_TRANSLATOR (Piano_pedal_engraver, - /* doc */ "Engrave piano pedal symbols and brackets.", - /* create */ "SostenutoPedal SustainPedal UnaCordaPedal SostenutoPedalLineSpanner SustainPedalLineSpanner UnaCordaPedalLineSpanner", - /* accept */ "pedal-event", - /* read */ "currentCommandColumn " + + /* doc */ + "Engrave piano pedal symbols and brackets.", + + /* create */ + "SostenutoPedal " + "SostenutoPedalLineSpanner " + "SustainPedal " + "SustainPedalLineSpanner " + "UnaCordaPedal " + "UnaCordaPedalLineSpanner ", + + /* accept */ + "pedal-event", + + /* read */ + "currentCommandColumn " "pedalSostenutoStrings " - "pedalSustainStrings " - "pedalUnaCordaStrings " "pedalSostenutoStyle " + "pedalSustainStrings " "pedalSustainStyle " + "pedalUnaCordaStrings " "pedalUnaCordaStyle", /* write */ ""); diff --git a/lily/slur-configuration.cc b/lily/slur-configuration.cc index 29b9844863..d846b9d615 100644 --- a/lily/slur-configuration.cc +++ b/lily/slur-configuration.cc @@ -85,7 +85,7 @@ fit_factor (Offset dz_unit, Offset dz_perp, Real eps = 0.01; Interval pext = eps * Interval (-1,1) + p[X_AXIS]; pext.intersect (curve_xext); - if (pext.is_empty () || pext.length () <= 2.1* eps) + if (pext.is_empty () || pext.length () <= 1.999 * eps) continue; Real y = curve.get_other_coordinate (X_AXIS, p[X_AXIS]); @@ -170,6 +170,17 @@ Slur_configuration::Slur_configuration () index_ = -1; }; + +void +Slur_configuration::add_score (Real s, string desc) +{ + if (s) + { + score_card_ += to_string ("%s=%.2f ", desc.c_str (), s); + score_ += s; + } +} + void Slur_configuration::score_encompass (Slur_score_state const &state) { @@ -251,9 +262,8 @@ Slur_configuration::score_encompass (Slur_score_state const &state) / state.encompass_infos_.size (); } } - - Real variance_penalty = 0.0; - + add_score (demerit, "encompass"); + if (convex_head_distances.size ()) { Real avg_distance = 0.0; @@ -281,27 +291,21 @@ Slur_configuration::score_encompass (Slur_score_state const &state) as penalty. */ avg_distance /= n; - variance_penalty = state.parameters_.head_slur_distance_max_ratio_; + Real variance_penalty = state.parameters_.head_slur_distance_max_ratio_; if (min_dist > 0.0) variance_penalty = min ((avg_distance / (min_dist + state.parameters_.absolute_closeness_measure_) - 1.0), variance_penalty); variance_penalty = max (variance_penalty, 0.0); variance_penalty *= state.parameters_.head_slur_distance_factor_; - } - -#if DEBUG_SLUR_SCORING - score_card_ += to_string ("C%.2f", demerit); - score_card_ += to_string ("D%.2f", variance_penalty); -#endif - score_ += demerit + variance_penalty; + add_score (variance_penalty, "variance"); + } } void Slur_configuration::score_extra_encompass (Slur_score_state const &state) { - Real demerit = 0.0; for (vsize j = 0; j < state.extra_encompass_infos_.size (); j++) { Drul_array attachment = attachment_; @@ -363,20 +367,14 @@ Slur_configuration::score_extra_encompass (Slur_score_state const &state) else programming_error ("unknown avoidance type"); - Real epsilon = 0.1; - Real factor - = (1.0 / (max (dist, 0.0) + epsilon * state.parameters_.extra_encompass_free_distance_)); - Real threshold - = 1.0 / ((1 + epsilon) * state.parameters_.extra_encompass_free_distance_); + dist = max (dist, 0.0); - demerit - += max (info.penalty_ * (factor - threshold), 0.0); + Real penalty = info.penalty_ * peak_around (0.1 * state.parameters_.extra_encompass_free_distance_, + state.parameters_.extra_encompass_free_distance_, + dist); + + add_score (penalty, "extra"); } -#if DEBUG_SLUR_SCORING - score_card_ += to_string ("X%.2f", demerit); -#endif - - score_ += demerit; } void @@ -401,10 +399,7 @@ Slur_configuration::score_edges (Slur_score_state const &state) demerit *= exp (state.dir_ * d * slope * state.parameters_.edge_slope_exponent_); - score_ += demerit; -#if DEBUG_SLUR_SCORING - score_card_ += to_string ("E%.2f", demerit); -#endif + add_score (demerit, "edge"); } while (flip (&d) != LEFT); } @@ -447,14 +442,11 @@ Slur_configuration ::score_slopes (Slur_score_state const &state) ? state.parameters_.same_slope_penalty_ / 10 : state.parameters_.same_slope_penalty_; -#if DEBUG_SLUR_SCORING - score_card_ += to_string ("S%.2f", demerit); -#endif - score_ += demerit; + add_score (demerit, "slope"); } void -Slur_configuration::score (Slur_score_state const &state) +Slur_configuration::calculate_score (Slur_score_state const &state) { score_extra_encompass (state); score_slopes (state); diff --git a/lily/slur-score-parameters.cc b/lily/slur-score-parameters.cc new file mode 100644 index 0000000000..84a3d1ce7a --- /dev/null +++ b/lily/slur-score-parameters.cc @@ -0,0 +1,68 @@ +/* + slur-score-paramaters.cc -- implement Slur_score_parameters + + source file of the GNU LilyPond music typesetter + + (c) 2006 Han-Wen Nienhuys + +*/ + + +#include "slur-score-parameters.hh" +#include "grob.hh" + + +Real +get_detail (SCM alist, SCM sym) +{ + SCM entry = scm_assq (sym, alist); + return robust_scm2double (scm_is_pair (entry) + ? scm_cdr (entry) + : SCM_EOL, + 0.0); +} + +void +Slur_score_parameters::fill (Grob *me) +{ + SCM details = me->get_property ("details"); + + region_size_ + = (int) get_detail (details, ly_symbol2scm ("region-size")); + head_encompass_penalty_ + = get_detail (details, ly_symbol2scm ("head-encompass-penalty")); + stem_encompass_penalty_ + = get_detail (details, ly_symbol2scm ("stem-encompass-penalty")); + closeness_factor_ + = get_detail (details, ly_symbol2scm ("closeness-factor")); + edge_attraction_factor_ + = get_detail (details, ly_symbol2scm ("edge-attraction-factor")); + same_slope_penalty_ + = get_detail (details, ly_symbol2scm ("same-slope-penalty")); + steeper_slope_factor_ + = get_detail (details, ly_symbol2scm ("steeper-slope-factor")); + non_horizontal_penalty_ + = get_detail (details, ly_symbol2scm ("non-horizontal-penalty")); + max_slope_ + = get_detail (details, ly_symbol2scm ("max-slope")); + max_slope_factor_ + = get_detail (details, ly_symbol2scm ("max-slope-factor")); + free_head_distance_ + = get_detail (details, ly_symbol2scm ("free-head-distance")); + absolute_closeness_measure_ + = get_detail (details, ly_symbol2scm ("absolute-closeness-measure")); + extra_object_collision_penalty_ + = get_detail (details, ly_symbol2scm ("extra-object-collision-penalty")); + accidental_collision_ + = get_detail (details, ly_symbol2scm ("accidental-collision")); + extra_encompass_free_distance_ + = get_detail (details, ly_symbol2scm ("extra-encompass-free-distance")); + head_slur_distance_factor_ + = get_detail (details, ly_symbol2scm ("head-slur-distance-factor")); + head_slur_distance_max_ratio_ + = get_detail (details, ly_symbol2scm ("head-slur-distance-max-ratio")); + free_slur_distance_ + = get_detail (details, ly_symbol2scm ("free-slur-distance")); + edge_slope_exponent_ + = get_detail (details, ly_symbol2scm ("edge-slope-exponent")); +} diff --git a/lily/slur-scoring.cc b/lily/slur-scoring.cc index 2e3510f86a..77a5a22c0f 100644 --- a/lily/slur-scoring.cc +++ b/lily/slur-scoring.cc @@ -9,22 +9,24 @@ #include "slur-scoring.hh" -#include "libc-extension.hh" -#include "slur-configuration.hh" + +#include "accidental-interface.hh" #include "beam.hh" #include "directional-element-interface.hh" -#include "pointer-group-interface.hh" -#include "slur.hh" +#include "libc-extension.hh" +#include "main.hh" #include "note-column.hh" #include "output-def.hh" +#include "paper-column.hh" #include "pitch.hh" +#include "pointer-group-interface.hh" +#include "slur-configuration.hh" +#include "slur.hh" #include "spanner.hh" #include "staff-symbol-referencer.hh" #include "staff-symbol.hh" #include "stem.hh" #include "warn.hh" -#include "paper-column.hh" -#include "accidental-interface.hh" /* TODO: @@ -64,61 +66,6 @@ Slur_score_state::~Slur_score_state () junk_pointers (configurations_); } -Real -get_detail (SCM alist, SCM sym) -{ - SCM entry = scm_assq (sym, alist); - return robust_scm2double (scm_is_pair (entry) - ? scm_cdr (entry) - : SCM_EOL, - 0.0); -} - -void -Slur_score_parameters::fill (Grob *me) -{ - SCM details = me->get_property ("details"); - - region_size_ - = (int) get_detail (details, ly_symbol2scm ("region-size")); - head_encompass_penalty_ - = get_detail (details, ly_symbol2scm ("head-encompass-penalty")); - stem_encompass_penalty_ - = get_detail (details, ly_symbol2scm ("stem-encompass-penalty")); - closeness_factor_ - = get_detail (details, ly_symbol2scm ("closeness-factor")); - edge_attraction_factor_ - = get_detail (details, ly_symbol2scm ("edge-attraction-factor")); - same_slope_penalty_ - = get_detail (details, ly_symbol2scm ("same-slope-penalty")); - steeper_slope_factor_ - = get_detail (details, ly_symbol2scm ("steeper-slope-factor")); - non_horizontal_penalty_ - = get_detail (details, ly_symbol2scm ("non-horizontal-penalty")); - max_slope_ - = get_detail (details, ly_symbol2scm ("max-slope")); - max_slope_factor_ - = get_detail (details, ly_symbol2scm ("max-slope-factor")); - free_head_distance_ - = get_detail (details, ly_symbol2scm ("free-head-distance")); - absolute_closeness_measure_ - = get_detail (details, ly_symbol2scm ("absolute-closeness-measure")); - extra_object_collision_penalty_ - = get_detail (details, ly_symbol2scm ("extra-object-collision-penalty")); - accidental_collision_ - = get_detail (details, ly_symbol2scm ("accidental-collision")); - extra_encompass_free_distance_ - = get_detail (details, ly_symbol2scm ("extra-encompass-free-distance")); - head_slur_distance_factor_ - = get_detail (details, ly_symbol2scm ("head-slur-distance-factor")); - head_slur_distance_max_ratio_ - = get_detail (details, ly_symbol2scm ("head-slur-distance-max-ratio")); - free_slur_distance_ - = get_detail (details, ly_symbol2scm ("free-slur-distance")); - edge_slope_exponent_ - = get_detail (details, ly_symbol2scm ("edge-slope-exponent")); -} - Real broken_trend_y (Slur_score_state const &state, Direction hdir) { @@ -404,46 +351,49 @@ Slur_score_state::get_best_curve () Real opt = 1e6; #if DEBUG_SLUR_SCORING + bool debug_slurs = to_boolean (slur_->layout () + ->lookup_variable (ly_symbol2scm ("debug-slur-scoring"))); SCM inspect_quants = slur_->get_property ("inspect-quants"); - if (to_boolean (slur_->layout () - ->lookup_variable (ly_symbol2scm ("debug-slur-scoring"))) + if (debug_slurs && scm_is_pair (inspect_quants)) { opt_idx = get_closest_index (inspect_quants); - configurations_[opt_idx]->score (*this); - opt = configurations_[opt_idx]->score_; + configurations_[opt_idx]->calculate_score (*this); + opt = configurations_[opt_idx]->score (); } else #endif { for (vsize i = 0; i < configurations_.size (); i++) - configurations_[i]->score (*this); + configurations_[i]->calculate_score (*this); for (vsize i = 0; i < configurations_.size (); i++) { - if (configurations_[i]->score_ < opt) + if (configurations_[i]->score () < opt) { - opt = configurations_[i]->score_; + opt = configurations_[i]->score (); opt_idx = i; } } } #if DEBUG_SLUR_SCORING - if (opt_idx >= 0) - { - configurations_[opt_idx]->score_card_ += to_string ("=%.2f", opt); - configurations_[opt_idx]->score_card_ += to_string ("i%d", opt_idx); - } - else + if (debug_slurs) { - programming_error ("No optimal slur found. Guessing 0."); - opt_idx = 0; - } + string total; + if (opt_idx >= 0) + { + total = configurations_[opt_idx]->card (); + total += to_string ("TOTAL=%.2f idx=%d", configurations_[opt_idx]->score (), opt_idx); + } + else + { + programming_error ("No optimal slur found. Guessing 0."); + total = "no sol?"; + } - // debug quanting - slur_->set_property ("quant-score", - scm_makfrom0str (configurations_[opt_idx]->score_card_.c_str ())); - + slur_->set_property ("quant-score", + scm_makfrom0str (total.c_str ())); + } #endif return configurations_[opt_idx]->curve_; @@ -796,7 +746,7 @@ Slur_score_state::get_extra_encompass_infos () const for (int k = 0; k < 3; k++) { - Direction hdir = Direction (k / 2 - 1); + Direction hdir = Direction (k - 1); /* Only take bound into account if small slur starts @@ -815,7 +765,7 @@ Slur_score_state::get_extra_encompass_infos () const Interval xext (-1, 1); xext = xext * (thickness_ * 2) + z[X_AXIS]; Extra_collision_info info (small_slur, - k - 1.0, + hdir, xext, yext, parameters_.extra_object_collision_penalty_); diff --git a/lily/slur.cc b/lily/slur.cc index 2a5518c2c6..905c158697 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -115,6 +115,8 @@ Slur::print (SCM smob) string str; SCM properties = Font_interface::text_font_alist_chain (me); + properties = scm_cons (scm_acons (ly_symbol2scm ("font-size"), scm_from_int (-6), SCM_EOL), + properties); Stencil tm = *unsmob_stencil (Text_interface::interpret_markup (me->layout ()->self_scm (), properties, quant_score)); diff --git a/lily/tie-formatting-problem.cc b/lily/tie-formatting-problem.cc index 4fe618c92e..7926652284 100644 --- a/lily/tie-formatting-problem.cc +++ b/lily/tie-formatting-problem.cc @@ -13,6 +13,7 @@ #include "directional-element-interface.hh" #include "item.hh" #include "libc-extension.hh" +#include "misc.hh" #include "note-head.hh" #include "rhythmic-head.hh" #include "spanner.hh" @@ -22,15 +23,6 @@ #include "tie.hh" #include "warn.hh" -/* - 0 at threshold, 1 at 0, with 1/x falloff. - */ -Real peak_around (Real epsilon, Real threshold, Real x) -{ - if (x < 0) - return 1.0; - return max (- epsilon * (x - threshold) / ((x + epsilon) * threshold), 0.0); -} void Tie_formatting_problem::print_ties_configuration (Ties_configuration const *ties) diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index c99b2eedec..077e06982e 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -1282,6 +1282,7 @@ (minimum-length . 1.5) (height-limit . 2.0) (ratio . 0.25) + (avoid-slur . inside) (meta . ((class . Spanner) (interfaces . (slur-interface)))))) @@ -1381,9 +1382,10 @@ (SostenutoPedalLineSpanner . ( (axes . (1)) - (X-extent . ,ly:axis-group-interface::height) + (Y-extent . ,ly:axis-group-interface::height) (Y-offset . ,ly:side-position-interface::y-aligned-side) (side-axis . ,Y) + (staff-padding . 1.0) (padding . 1.2) (minimum-space . 1.0) (direction . ,DOWN) @@ -1442,10 +1444,6 @@ )) - - ;; default stem direction for note on middle line - (neutral-direction . ,DOWN) - ;; We use the normal minima as minimum for the ideal lengths, ;; and the extreme minima as abolute minimum length. @@ -1484,7 +1482,7 @@ (SustainPedalLineSpanner . ( (axes . (1)) - (X-extent . ,ly:axis-group-interface::height) + (Y-extent . ,ly:axis-group-interface::height) (Y-offset . ,ly:side-position-interface::y-aligned-side) (side-axis . ,Y) (padding . 1.2) @@ -1776,7 +1774,7 @@ (UnaCordaPedalLineSpanner . ( (axes . (1)) - (X-extent . ,ly:axis-group-interface::height) + (Y-extent . ,ly:axis-group-interface::height) (Y-offset . ,ly:side-position-interface::y-aligned-side) (side-axis . ,Y) (padding . 1.2) diff --git a/scm/layout-slur.scm b/scm/layout-slur.scm index 64dc4496fe..95f717d566 100644 --- a/scm/layout-slur.scm +++ b/scm/layout-slur.scm @@ -20,7 +20,7 @@ (free-slur-distance . 0.8) (extra-object-collision-penalty . 50) (accidental-collision . 3) - (extra-encompass-free-distance . 0.3) + (extra-encompass-free-distance . 0.8) (head-slur-distance-max-ratio . 3) (head-slur-distance-factor . 10) (absolute-closeness-measure . 0.3)