Am Dienstag, 3. Oktober 2023, 12:55:21 CEST schrieb Robert Mengual:
> Thanks a lot Valentin, that's simply perfect!
> 
> However, after reading a lot of the documentation I think I would have
> never been able to find any solution close to yours. I am very confused
> with a few things, and I can't find the answers in the documentation. Let
> me ask you a few questions in hope that I will be able to solve problems on
> my own next time.

Hello Robert,

I do understand that getting into details for a oftware like lilypond can be a 
bit hard. Since 
it is a small open source project it is not perfectly documented in each 
regard, especially 
once you start to go into extending it. I’d recommend reading Jean’s 
introduction into 
extending lilypond:

https://extending-lilypond.gitlab.io/[1]

Once you’ve seen these things a few times it will become a lot easier (I did 
take some time 
to get where I am now, and it would have been much less if I had something like 
Jean’s 
guide).

>    - How did you know you could pass a function that receives a grob to
>    KeySignature.key?

(Raw) grob properties can be either values or callbacks, which are functions 
that take the 
grob itself as argument (these are automatically evaluated when getting the 
property). 
You doing

\override KeySignature.stencil = #ly:text-interface::print

is assingning a function to the stencil property.

>    - If an overriden property expects a number, can it be defined as a
>    function that receives a grob and returns a number?

Exactly.

>    - How did you know alterations-alist is a property of that grob?

https://lilypond.org/doc/v2.24/Documentation/internals/
key_002dsignature_002dinterface[2]

>    - What is #:vcenter and how did you know of its existence?

markup command for vertically centering stuff (relative to itself), see here:

https://lilypond.org/doc/v2.24/Documentation/notation/align[3]

Using this the number will not extend from the middle line upward, but be 
centered 
around the middle line.

Cheers,
Valentin

--------
[1] https://extending-lilypond.gitlab.io/
[2] https://lilypond.org/doc/v2.24/Documentation/internals/
key_002dsignature_002dinterface
[3] https://lilypond.org/doc/v2.24/Documentation/notation/align

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to