lilypond-devel
[Top][All Lists]
Advanced

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

Re: polyphonic shorthand; line-spanner-interface in Hairpin


From: Joe Neeman
Subject: Re: polyphonic shorthand; line-spanner-interface in Hairpin
Date: Tue, 17 Mar 2009 17:40:41 -0700

On Tue, 2009-03-17 at 16:47 -0600, Carl D. Sorensen wrote:
> 
> 
> On 3/17/09 3:48 PM, "Kieren MacMillan" <address@hidden>
> wrote:
> 
> > Hi Carl,
> > 
> >> One issue that comes up in your proposal is that a 1/16 note column
> >> does not
> >> take up 1/16 of a whole note column.  So exactly what space are you
> >> thinking
> >> you want?
> > 
> > In the perfect scenario, I suppose Lilypond would "Do The Right Thing":
> >     1. If there were another music event at the moment the Hairpin
> > was set to begin (delayed) or end (trimmed), it would line up as
> > expected.
> 
> So how about this as an explanation of DTRT?
> 
> Let's assume that the hairpin is a spanner (this much is correct, I think)
> and that we know the musical length of the span (This is known because we
> have the musical moment of the start and the musical moment of the end of
> the hairpin.)
> 
> Then we define the delayed start moment as the start moment of the hairpin
> plus the specified delay.
> 
> We define the trimmed end moment as the end moment of the hairpin minus the
> specified trim amount.
> 
> Now I'm getting very iffy.   If there's a musical paper column at the
> delayed start moment and the trimmed end moment, then we would want to shift
> the spanner to those musical paper columns.
> 
> If not, then we have to adjust the size of the hairpin some other way, and
> that's where things break down for me.  It may be a question of adjusting
> springs and rods, but springs and rods are deep in the computational alchemy
> of LilyPond, as far as I can see.

If you only care about adjusting the length of a hairpin without
affecting the spacing, things are fairly simple (at least conceptually;
actually writing the code might be a bit more challenging). You can get
a list of (ordered by moment) paper columns from Paper_score. If you
wait until after the page breaking is done, you can rely on the x-offset
of these columns (which you get by
paper_column->relative_coordinate(system,X_AXIS)) to be accurate. You
could do a binary search for the moment you want and then do an
interpolation if you don't find it. All of this is in the C++ code.

If you want to allow this length to affect the spacing, it's a bit more
complicated because the spacing engine only allows you to mandate
minimum space between two columns, so you somehow have to work backwards
from the interpolation that you want to figure our how much space you
need to reserve... but if you ignore this part, the only thing it will
affect is the behaviour of 'minimum-distance, which probably isn't
crucial.

Joe





reply via email to

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