Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3021)

Issue 15400049: Make sure slurs actually avoid stafflines.

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 6 months ago by janek
Modified:
10 years, 5 months ago
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Make sure slurs actually avoid stafflines. Until now, slurs were pretending that they were avoiding stafflines, but the function was broken: it only moved slurs in one direction (sometimes making the collision signifincantly worse). This commit makes sure that the correction is applied in appropriate direction and that slur thickness is taken into account. Additionally, the amount of correction is now user-settable.

Patch Set 1 #

Total comments: 27

Patch Set 2 : fix the problems - sort of.. #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+99 lines, -18 lines) Patch
M lily/include/slur-score-parameters.hh View 1 chunk +2 lines, -0 lines 0 comments Download
M lily/slur.cc View 1 1 chunk +4 lines, -0 lines 1 comment Download
M lily/slur-configuration.cc View 1 2 chunks +87 lines, -18 lines 5 comments Download
M lily/slur-score-parameters.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M scm/layout-slur.scm View 1 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 15
lemzwerg
LGTM! Thanks for working on this
10 years, 6 months ago (2013-10-22 19:44:48 UTC) #1
Trevor Daniels
LGTM, at least by inspection (I can't make at present) Understanding this complex area is ...
10 years, 6 months ago (2013-10-22 21:29:15 UTC) #2
Keith
https://codereview.appspot.com/15400049/diff/1/lily/slur-configuration.cc File lily/slur-configuration.cc (left): https://codereview.appspot.com/15400049/diff/1/lily/slur-configuration.cc#oldcode62 lily/slur-configuration.cc:62: > but the function was broken: it only moved ...
10 years, 6 months ago (2013-10-23 04:22:22 UTC) #3
hanwenn
https://codereview.appspot.com/15400049/diff/1/lily/slur-configuration.cc File lily/slur-configuration.cc (right): https://codereview.appspot.com/15400049/diff/1/lily/slur-configuration.cc#newcode121 lily/slur-configuration.cc:121: Real mid_pts_cor = 0.6 * correction / (3 * ...
10 years, 6 months ago (2013-10-23 06:38:59 UTC) #4
Keith
https://codereview.appspot.com/15400049/diff/1/lily/slur-configuration.cc File lily/slur-configuration.cc (right): https://codereview.appspot.com/15400049/diff/1/lily/slur-configuration.cc#newcode121 lily/slur-configuration.cc:121: Real mid_pts_cor = 0.6 * correction / (3 * ...
10 years, 6 months ago (2013-10-23 07:16:36 UTC) #5
dak
On 2013/10/23 07:16:36, Keith wrote: > https://codereview.appspot.com/15400049/diff/1/lily/slur-configuration.cc > File lily/slur-configuration.cc (right): > > https://codereview.appspot.com/15400049/diff/1/lily/slur-configuration.cc#newcode121 > ...
10 years, 6 months ago (2013-10-23 08:41:42 UTC) #6
janek
On 2013/10/23 04:22:22, Keith wrote: > https://codereview.appspot.com/15400049/diff/1/lily/slur-configuration.cc > File lily/slur-configuration.cc (left): > > https://codereview.appspot.com/15400049/diff/1/lily/slur-configuration.cc#oldcode62 > ...
10 years, 6 months ago (2013-10-23 21:07:23 UTC) #7
janek
Thanks for the review. I'll post a new patch tomorrow. Janek https://codereview.appspot.com/15400049/diff/1/lily/slur-configuration.cc File lily/slur-configuration.cc (right): ...
10 years, 6 months ago (2013-10-23 21:41:23 UTC) #8
janek
Hi Keith, 2013/10/23 <janek.lilypond@gmail.com>: > > On 2013/10/23 04:22:22, Keith wrote: >> The commit message ...
10 years, 6 months ago (2013-10-23 22:20:32 UTC) #9
Keith
https://codereview.appspot.com/15400049/diff/1/lily/slur-configuration.cc File lily/slur-configuration.cc (left): https://codereview.appspot.com/15400049/diff/1/lily/slur-configuration.cc#oldcode62 lily/slur-configuration.cc:62: On 2013/10/23 04:22:23, Keith wrote: > > but the ...
10 years, 6 months ago (2013-10-24 03:33:42 UTC) #10
janek
fix the problems - sort of..
10 years, 6 months ago (2013-10-25 00:42:34 UTC) #11
janek
New patch set uploaded. I expect that it may not be very good - i'm ...
10 years, 6 months ago (2013-10-25 00:44:35 UTC) #12
Keith
The behavior of the first patch was good, only the code was difficult to understand. ...
10 years, 6 months ago (2013-10-25 06:18:49 UTC) #13
Keith
I suggest making the minimal changes to the structure of the old code (plus whatever ...
10 years, 5 months ago (2013-11-12 01:27:32 UTC) #14
janek
10 years, 5 months ago (2013-11-15 16:40:32 UTC) #15
Hi Keith,

I'm sorry for not replying earlier - i had to focus on other things,
and i didn't have time to spare on the slur stuff.  Thanks for all
your suggestions; i'll get back to this when i finish one thing i have
to do for Urs (hopefully after the weekend).

best,
JAenk

2013/11/12  <k-ohara5a5a@oco.net>:
> I suggest making the minimal changes to the structure of the old code
> (plus whatever comments you like) that make the change we all want in in
> behavior.
>
>
>
https://codereview.appspot.com/15400049/diff/120001/lily/slur-configuration.cc
> File lily/slur-configuration.cc (left):
>
>
https://codereview.appspot.com/15400049/diff/120001/lily/slur-configuration.c...
> lily/slur-configuration.cc:45: {
>       Real t = ts[0];
>       Real y = bez.curve_point (t)[Y_AXIS];
>
>       Grob *staff = state.extremes_[LEFT].staff_;
>
>       Real p = 2 * (y - staff->relative_coordinate
> (state.common_[Y_AXIS], Y_AXIS))
>                / state.staff_space_;
>
>       Real const round = my_round (p);
>       Real const frac = p - round;
>       Real min_separation = 0.5 * state.thickness_
>         + (frac * state.dir_ > 0.0)
>           ? state.parameters_.min_gap_inside_
>           : state.parameters_.min_gap_outside_;
>
>       if (fabs (frac) < 2 * min_separation
>           && Staff_symbol_referencer::on_staff_line (staff, int
> (round)))
>         {
>           Direction resolution_dir = (frac > 0.0) ? UP : DOWN;
>
>           Real newp = round + resolution_dir * min (1.0, 2 *
> min_separation);
>
>           Real dy = (newp - p) * state.staff_space_ / 2.0;
>
>           bez.control_[1][Y_AXIS] += dy;
>           bez.control_[2][Y_AXIS] += dy;
>
>           // The horizontal part of the curve moves 3t-3t² as far
>           // as the middle control-points, so the remaining correction
> is:
>           dy -= dy * 3.0 * t * (1.0 - t);
>
>           bez.control_[0][Y_AXIS] += dy;
>           bez.control_[1][Y_AXIS] += dy;
>           bez.control_[2][Y_AXIS] += dy;
>           bez.control_[3][Y_AXIS] += dy;
>         }
>
> https://codereview.appspot.com/15400049/
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b