lilypond-user
[Top][All Lists]
Advanced

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

Re: Ragged right for contents but not staff?


From: David Nalesnik
Subject: Re: Ragged right for contents but not staff?
Date: Thu, 13 Mar 2014 18:45:08 -0500

Hello,

On Thu, Mar 13, 2014 at 12:25 PM, David Nalesnik <address@hidden> wrote:

On Thu, Mar 13, 2014 at 11:43 AM, David Nalesnik <address@hidden> wrote:
 
I'll post a revision of this in a little while.  It incorporates reduce as David K. suggests, and it also allows you to specify alignments as pairs: left/center/right of one to left/center/right of the other.

I'm not too wild about it, as the function uses 'extra-offset, which is usually "contraindicated."

Here's a bit of a revision of the original function.

Well, not one to leave well enough alone, here's another version.

I think at the time this was first posted years ago, \overrideProperty was necessary.  Now it appears \override is the better choice.  Changed accordingly.  Put \once before \alignGrob for \once \override.

You can now input the name of a grob as Context.Grob

It's possible to displace the X-alignment.  The reason I allow this is that I've found a little tweaking may be necessary.  The final example of the attached file shows why.  Here, without the tiny offset to X (0.08), the barline doesn't look right--due
to the fact that the rounded end of the staff-lines isn't considered in the staff's grob-extent.  0.08 happens to be the "blot-diameter" or the protruding rounded ends.
.

**I did not address the interface.

I have no idea how to make the user's experience nicer.  Suggestions welcome.

Anyway, the syntax as it stands is this:

[\once] \alignGrob  [Context].Grob-to-align  [Context].Grob-to-align-to  alignment-dir(s)  extra-offset(s)

*The second Context isn't needed ever, but _not_ permitting it seems more confusing to me.

*alignment-dir(s):
  --a number (-1 or LEFT, 0 or CENTER, 1 or RIGHT; fractional values are converted to one of these) or a pair of such numbers
  --if a single number is given, the same side of both objects is used

*extra-offset(s):
  --if a single number, that's the Y part of the override of extra-offset that \alignGrob basically is
  --if a pair, the first number is a correction (in staff-spaces) to the new alignment of X (an "extra-extra-offset");
    the second number is, again, the Y value of extra-offset. 
 
Yuck.  Well, the attached examples should make it clearer.

Several observations:

This all is a glorified version of \override Grob.extra-offset.  'extra-offset is useful for recklessly moving stuff around in post-processing.  You, the user, are the collision detector.

The automated alignment concerns the X-axis only.

Enjoy,
David 

 

Attachment: alignGrob-update3.ly
Description: Text Data


reply via email to

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