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: Kieren MacMillan
Subject: Re: global alignment tweak for ChordName
Date: Tue, 21 Dec 2021 15:15:18 -0500

Hi Aaron,

> I've used something like this in the past

That's great! I just wrapped your 'center-er' in a (max -2 etc), and it's 
exactly what I want:

%%%%
\version "2.22.0"

\layout { ragged-right = ##f }

music = \chordmode {
  c1 c:7 c:m7 c':m6.4.2/ees
}

\score {
  <<
    \new ChordNames \music
    \new Staff \music
  >>
  \layout {
    \context {
      \Score
      \override ChordName.X-offset =
      #(lambda (grob)
         (let* ((sten (ly:grob-property grob 'stencil))
                (xex (ly:stencil-extent sten X))
                (width (interval-length xex)))
           (max -2 (* -0.5 (max 0 (- width 2))))))
    }
  }
}
%%%%

Thanks!
Kieren.


reply via email to

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