lilypond-user
[Top][All Lists]
Advanced

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

Re: space the width of key signature


From: David Nalesnik
Subject: Re: space the width of key signature
Date: Sat, 2 Jul 2016 12:49:31 -0500

Hi Harm,

On Sat, Jul 2, 2016 at 10:43 AM, Thomas Morley <address@hidden> wrote:
> 2016-07-01 20:43 GMT+02:00 Br. Gabriel-Marie | SSPX <address@hidden>:
>> Because stanza numbers only appear on the first line.  Using instrumentName
>> to label verse numbers provides automatic numbering on every line.  It
>> wasn't my idea, actually, credit for that goes to Thomas Morley  a few
>> issues ago in Vol 163:issue 95.  It works quite well.
>>
>> On 7/1/2016 1:30 PM, address@hidden wrote:
>>>
>>> Why not use StanzaNumbers instead of instrumentName to label verse
>>> numbers?
>
>
> Meanwhile I tried to make StanzaNumber at every line-begin work, see attached.
> Though, it's stacking workarounds, thus pretty expensive.
> At least it _is_ possible, even now.
> Maybe someone steps in futher improving it.

It is possible to check the break status of the NonMusicalPaperColumn
to the left of the StanzaNumber.  This eliminates the need to filter a
list of all grobs on the line.

First, you need the StanzaNumber's column.  Then you can get its left
neighbor (which is needed b/c the stanza's column is a PaperColumn and
won't carry useful break info.).  If the neighbor is non-musical and
right-broken, we're at the start of the line.

&=====================

#(define (at-line-beginning? grob)
   (let* ((col (ly:item-get-column grob))
          (ln (ly:grob-object col 'left-neighbor)))
     (not (and (eq? #t (ly:grob-property ln 'non-musical))
               (= 1 (ly:item-break-dir ln))))))

#(define (keep-stanza-number-at-line-begin grob)
   (if (at-line-beginning? grob)
       (ly:grob-suicide! grob)))

&====================

The override to use would be:

%====================
\override StanzaNumber.after-line-breaking =
    #keep-stanza-number-at-line-begin
&====================

I don't know how infallible this is :)

Hope this is useful!

David



reply via email to

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