lilypond-user
[Top][All Lists]
Advanced

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

Re: More problems with hor. alignment of button numbers when misusing ly


From: David Nalesnik
Subject: Re: More problems with hor. alignment of button numbers when misusing lyrics (for accordion)
Date: Tue, 26 Jul 2016 12:47:39 -0500

Hi Mojca,

On Tue, Jul 26, 2016 at 7:44 AM, Mojca Miklavec
<address@hidden> wrote:

> To summarise again: I want to add button numbers (and optional finger
> numbers) on top of pitches (usually one to three buttons at the same
> time) to aid diatonic accordion players.
>
> Following David's advice I'm currently misusing the lyrics for that.
> But apart from a bug in vertical alignment when the "first syllable"
> in the top row is missing (the only workaround I found so far was to
> use "-" as the first syllable instead of an empty space), there's
> another problem that I just discovered.
>
> Namely, when one chord is played with more buttons/fingers than other
> chords inside the same "bar", LilyPond tries to be smart and aligns
> the top positions towards other chords where there is presumably more
> space. But at the end this looks ugly.
>

Frankly, this looks like a bug.  It seems that the property
'self-alignment-X is not always respected.

For testing, I added a callback which prints the X-offset values of
the LyricText grobs.  (This should reflect whatever self-alignment-X
setting is in place; default is CENTER).

Callback:

\layout {
    %ragged-right = ##f
    \context {
      \Lyrics
      %\override LyricText.self-alignment-X = #LEFT
      \override LyricText.after-line-breaking =
      #(lambda (grob)
         (format #t "~a shift: ~a~%"
           (markup->string (ly:grob-property grob 'text))
           (ly:grob-property grob 'X-offset)))
    }
  }

Here's what I get:

3 B4 shift: 0.0
2 B3 shift: -1.42092227559055
1 B2 shift: -1.42092227559055
 A5 shift: 0.0
 A4 shift: -0.594124708661417
 B4 shift: -0.594124708661417

Same results with ragged-right set to #f.

With self-alignment-X set to LEFT, we get (as expected):

3 B4 shift: 0.0
2 B3 shift: 0.0
1 B2 shift: 0.0
 A5 shift: 0.0
 A4 shift: 0.0
 B4 shift: 0.0

(I'm running 2.19.30 at the moment.)

As far as a workaround, you could define a single Lyrics context with
the elements stacked into bottom-aligned columns.  Which I think would
be a hassle.  Your code should work.

DN



reply via email to

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