lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange loop executed only once!


From: Łukasz Czerwiński
Subject: Re: Strange loop executed only once!
Date: Fri, 4 May 2012 01:20:45 +0200


On 3 May 2012 04:18, Keith OHara <address@hidden> wrote:
On Wed, 02 May 2012 17:12:33 -0700, Łukasz Czerwiński <address@hidden> wrote:

On 22 April 2012 13:28, Han-Wen Nienhuys <address@hidden> wrote:

this also looks a little suspect:

        Real total_head_length = previous_extents[d].length ()
                                 + current_extents[d].length ();

As for Keith's code:
{ \time 4/1
 \override Score.SpacingSpanner #'packed-spacing = ##t
c'1 a <b'' c'''> <g''' a'''> }

I can see no too much spacing between b'' and c''', and g''' and a'''

The notes within the chords are spaced normally, but the chords are too-far separated from each other.  It is only a tiny problem.  No-one reported noticing the problem in output, only in the code.

Well, it's a bug, so it should be at least *tried* to be solved. As I guess, it will need only one change in line: 
          Real total_head_length = previous_extents[d].length ()
                                   + current_extents[d].length ();
 
so it's doable and therefore desired :)


Was that bug already filed or should I do it?  

It is so closely related to
http://code.google.com/p/lilypond/issues/detail?id=2493
that I'll just add a note there.
Thanks.
 
Anyway, I don't understand: "The cause seems to be the decision
to scale the ledger from the notecolumn width,

I should have set "to scale the rod...".  The function set_rods() at
<http://codereview.appspot.com/6109046/diff/6001/lily/ledger-line-spanner.cc#newcode39>
is passed two columns and asked to figure out the space needed for ledgers.

Ah, I see... Now I'm starting to understand what's that code about. Thanks :)

 
Now I see that the extents passed to set_rods() include /only/ notes that go on ledgers, so finally I see how HanWen's original suggestion should work.

Where do you know it from? Is it this line which make it work so?
      if (staff_extent.contains (pos))
        continue;

 
And where to find what's min_length_fraction for?

It is a local variable holding the last parameter to set_rods() so you have to look at how set_rods() is called, and figure out how that last parameter is determined.   It comes from some property of a Ledger_line_spanner called "minimum-length-fraction" that might be talked about <http://lilypond.org/doc/v2.14/Documentation/internals/ledgerlinespanner>

I meant the link, not finding usage of a variable which is trivial :) Thanks for the link.

I don't understand why minimum-length-fraction is takenn into account while calculating rod.distance_, but let's say someone wise devised such a formula and it works properly :)



I'd like to comment set_rods and set_spacing_rods.
I'll place for set_rods a comment:
/*
 The extents passed to set_rods() include *only* notes that go on ledgers.
*/

and for set_spacing_rods:
/*
 This function sets rods to force a proper distance between chords that have 
 some notes on ledger lines.
*/

Is it correct?

I don't understand the whole idea of iterating through all heads:
extract_item_set (me, "note-heads", heads);
  for (vsize i = heads.size (); i--;)
 
Which heads would those be? As I guess, the answer is: those that are contained in Ledger_Line_Spanner, but... what is a ledger line spanner, when is it used, where does it lie and which notes will it contain? Just two chords that are neighbours?

Why iterating through heads forces the right order of the notes - first notes from the first chord, then from the second one?

Łukasz


reply via email to

[Prev in Thread] Current Thread [Next in Thread]