lilypond-user
[Top][All Lists]
Advanced

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

Re: global alignment tweak for ChordName


From: David Kastrup
Subject: Re: global alignment tweak for ChordName
Date: Tue, 21 Dec 2021 21:49:36 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Jean Abou Samra <jean@abou-samra.fr> writes:

> Certainly. Kieren, try this:
>
> \version "2.22.1"
>
> \layout { ragged-right = ##f }
>
> music = \chordmode {
>   c1 c:7 c:m7 c':m6.4.2/ees \once \omit ChordName c
> }
>
> \score {
>   <<
>     \new ChordNames \music
>     \new Staff \music
>   >>
>   \layout {
>     \context {
>       \Score
>       \override ChordName.X-offset =
>       #(lambda (grob)
>          (let ((sten (ly:grob-property grob 'stencil)))
>            (if (ly:stencil? sten)
>                (let* ((xex (ly:stencil-extent sten X))
>                       (width (interval-length xex)))
>                  (max -2 (* -0.5 (max 0 (- width 2))))))))
>     }
>   }
> }
> %%%%

Your "if" has no else path.  Maybe replace it with "and", assuming that
ChordName knows how to deal with an X-offset of #f (which tends to be a
valid setting for any predicate in grob properties).

-- 
David Kastrup



reply via email to

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