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

Issue 4001046: Cleanup beam scoring code. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 3 months ago by hanwenn
Modified:
13 years, 3 months ago
Reviewers:
mike, wl, Graham Percival (old account), c_sorensen, MikeSol, reinhold
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Cleanup beam scoring code. Introduce Beam_scoring_problem to encapsulate parameters and methods for beam scoring. This is a preparation for using a priority queue on the to-be-computed scores. Document Interval::delta(). Don't crash on a pending spanner in Staff_symbol_engraver dtor.

Patch Set 1 #

Patch Set 2 : Fix init of edge_dirs. #

Patch Set 3 : squash #

Patch Set 4 : Fix beam slope problems #

Unified diffs Side-by-side diffs Delta from patch set Stats (+390 lines, -285 lines) Patch
M lily/beam.cc View 4 chunks +18 lines, -3 lines 0 comments Download
M lily/beam-quanting.cc View 1 2 3 11 chunks +218 lines, -241 lines 0 comments Download
M lily/include/beam.hh View 3 chunks +4 lines, -41 lines 0 comments Download
A lily/include/beam-scoring-problem.hh View 1 2 3 1 chunk +150 lines, -0 lines 0 comments Download

Messages

Total messages: 13
hanwenn
Hi, this is a first step in making the beam scoring a bit saner and ...
13 years, 3 months ago (2011-01-31 15:41:46 UTC) #1
hanwenn
Note - there are some beam related regressions. I'll fix those tonight. cheers.
13 years, 3 months ago (2011-01-31 15:44:01 UTC) #2
hanwenn
On 2011/01/31 15:44:01, hanwenn wrote: > Note - there are some beam related regressions. I'll ...
13 years, 3 months ago (2011-02-01 01:26:27 UTC) #3
MikeSol
LGTM. Reads a lot cleaner and is much more extensible. This may be for another ...
13 years, 3 months ago (2011-02-01 01:44:30 UTC) #4
hanwenn
The reasonable score is to go in a subsequent patch. Stay tuned. On Mon, Jan ...
13 years, 3 months ago (2011-02-01 02:25:55 UTC) #5
Graham Percival (old account)
I see some fairly crazy beams in input/regression/spacing-to-grace.ly input/regression/accidental-contemporary.ly ... etc... there's some really steep ...
13 years, 3 months ago (2011-02-01 22:12:13 UTC) #6
hanwenn
On 2011/02/01 22:12:13, Graham Percival wrote: > I see some fairly crazy beams in > ...
13 years, 3 months ago (2011-02-02 03:30:12 UTC) #7
hanwenn
There is one diff remaining: see the attached file. I introduced some streamlining of an ...
13 years, 3 months ago (2011-02-02 03:34:32 UTC) #8
c_sorensen
On 2/1/11 8:34 PM, "Han-Wen Nienhuys" <hanwenn@gmail.com> wrote: > There is one diff remaining: see ...
13 years, 3 months ago (2011-02-02 03:50:25 UTC) #9
wl_gnu.org
> There is one diff remaining: see the attached file. I introduced > some streamlining ...
13 years, 3 months ago (2011-02-02 05:49:26 UTC) #10
reinhold_kainhofer.com
Am Mittwoch, 2. Februar 2011, um 06:49:14 schrieb Werner LEMBERG: > > There is one ...
13 years, 3 months ago (2011-02-02 11:34:38 UTC) #11
hanwenn
On Wed, Feb 2, 2011 at 3:49 AM, Werner LEMBERG <wl@gnu.org> wrote: >> There is ...
13 years, 3 months ago (2011-02-02 14:54:39 UTC) #12
mike_apollinemike.com
13 years, 3 months ago (2011-02-03 02:16:33 UTC) #13
On Feb 2, 2011, at 9:54 AM, Han-Wen Nienhuys wrote:

> On Wed, Feb 2, 2011 at 3:49 AM, Werner LEMBERG <wl@gnu.org> wrote:
>>> There is one diff remaining: see the attached file.  I introduced
>>> some streamlining of an inner loop, which affects the way we handle
>>> beams that start/end with invisible stems.
>>> 
>>> The compare image is the new one.  I have no examples of tremolo beams
>>> handy, but the new layout actually looks better to me.
>> 
>> For me, it doesn't.  While the old behaviour is not optimal, the new
>> one looks really worse to me, especially in bar 3 (which is admittedly
>> a quite artificial example).  The most important issue for me: Why is
>> there no slant of the beams?  I currently have not enough time to
> 
> But the old version also had no slant?  I'm inclined to take interpret
> all these answers as "tremolo on whole notes was broken, and it still
> is, just differently," and commit.
> 
> My concern is about breaking something that was working as intended before.

Hey all,

Han-Wen: I know that you had mentioned earlier revisiting the reasonable_score
problem.  A thought just occurred to me.  In a loop like:

 for (vsize i = configs.size (); i--;)
   if (configs[i]->demerits < reasonable_score)
     {
       score_count ++;
       score_stem_lengths (configs[i]);
     }

If the function score_stem_lengths returned the value of the score, then you
could do something like:

vector<Beam_configuration*> rejects;
Real high_score = 0.0;
 for (vsize i = configs.size (); i--;)
   if (configs[i]->demerits < reasonable_score)
     {
       score_count ++;
       high_sore = max (high_score, score_stem_lengths (configs[i]));
     }
  else
    rejects.push_back (configs[i]);

 for (vsize i = rejects.size(); i--)
   rejects[i]->add (high_score, "F");

 rejects.clear ();

I don't have a good sense of how much compiling time this would add on, but it
is a way to pad the unreasonable scores with a value that preserves their
unreasonableness.

Cheers,
Mike
Sign in to reply to this message.

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