[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: global alignment tweak for ChordName
From: |
Valentin Petzel |
Subject: |
Re: global alignment tweak for ChordName |
Date: |
Tue, 21 Dec 2021 20:50:18 +0000 (UTC) |
Hello Jean, hello David, hello Kieren,
you should even be able to write (if sten (ly:stencil-extent sten)), as the
stencil should always be a stencil or #f.
Cheers,
Valentin
21.12.2021 21:42:13 Jean Abou Samra <jean@abou-samra.fr>:
> Le 21/12/2021 à 21:33, David Kastrup a écrit :
>> Kieren MacMillan <kieren@kierenmacmillan.info> writes:
>>> Hi again,
>>>
>>> When I try to use it in my main file, I get this:
>>>
>>> In procedure ly:stencil-extent in expression (ly:stencil-extent sten X):
>>> /Users/kmac/Documents/01_music/scores/_include/paper/musical.ily:254:21:
>>> Wrong type argument in position 1 (expecting Stencil): #f
>>>
>>> Any thoughts about what might be going wrong?
>> It is applied to a grob that has been given the \omit treatment?
>
>
> 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))))))))
> }
> }
> }
> %%%%
>
> Best,
> Jean
- Re: global alignment tweak for ChordName, (continued)
- Re: global alignment tweak for ChordName, Aaron Hill, 2021/12/21
- Re: global alignment tweak for ChordName, Kieren MacMillan, 2021/12/21
- Re: global alignment tweak for ChordName, Kieren MacMillan, 2021/12/21
- Re: global alignment tweak for ChordName, David Kastrup, 2021/12/21
- Re: global alignment tweak for ChordName, Jean Abou Samra, 2021/12/21
- Re: global alignment tweak for ChordName, Kieren MacMillan, 2021/12/21
- Re: global alignment tweak for ChordName, David Kastrup, 2021/12/21
- Re: global alignment tweak for ChordName, Jean Abou Samra, 2021/12/21
- Re: global alignment tweak for ChordName, David Kastrup, 2021/12/21
- Re: global alignment tweak for ChordName, Jean Abou Samra, 2021/12/21
- Re: global alignment tweak for ChordName,
Valentin Petzel <=
- Re: global alignment tweak for ChordName, David Kastrup, 2021/12/21
- Re: global alignment tweak for ChordName, Valentin Petzel, 2021/12/21