Thank you for this! I’m not sure how it works—it looks like a Scheme engraver 
that changes the x parent of some time signatures—but it sure does!

> On Nov 8, 2022, at 2:59 PM, Jean Abou Samra <j...@abou-samra.fr> wrote:
> 
> Le 08/11/2022 à 14:13, Nate Whetsell a écrit :
>> I’ve noticed two issues with this. First, the above-score time signatures 
>> are usually centered over bar lines, but not when a measure is preceded by a 
>> clef change. In this case, time signatures seem to be placed before the new 
>> clef rather than centered over the following bar line. Second, when a new 
>> time signature occurs at the end of a page, it seems to be centered on the 
>> right margin. In the case of compound meters, this can cause the time 
>> signature to extend off the page. I’ve tried setting break-align-orders 
>> (https://lilypond.org/doc/v2.23/Documentation/internals/break_002dalignment_002dinterface
>>  
>> <https://lilypond.org/doc/v2.23/Documentation/internals/break_002dalignment_002dinterface>)
>>  and space-alist to fix this 
>> (https://lilypond.org/doc/v2.23/Documentation/internals/timesignature 
>> <https://lilypond.org/doc/v2.23/Documentation/internals/timesignature>), but 
>> nothing seems to have an effect.
> 
> 
> 
> For this one, try:
> 
> 
> 
> \version "2.23.80"
> 
> time-signatures = {
>   \time 2/4
>   s2 | \noBreak
>   \time 3/4
>   s2. | \noBreak
>   \time 4/4
>   s1 |
>   \break
>   \pageBreak
>   \compoundMeter #'((1 1 3 4))
>   s1*5/4 |
> }
> 
> \layout {
>   \numericTimeSignature
>   \context {
>     \Staff
>     \override InstrumentName.self-alignment-X = #RIGHT
>   }
>   \context {
>     \Score
>     \consists
>       #(lambda (context)
>          (let ((time-sigs '())
>                (break-alignment #f))
>            (make-engraver
>              (acknowledgers
>               ((time-signature-interface engraver grob source-engraver)
>                (when (not (ly:grob-property grob 'break-align-symbol #f))
>                  (set! time-sigs (cons grob time-sigs))))
>               ((break-alignment-interface engraver grob source-engraver)
>                (set! break-alignment grob)))
>              ((stop-translation-timestep engraver)
>               (when break-alignment
>                 (for-each
>                  (lambda (sig)
>                    (ly:grob-set-parent! sig X break-alignment))
>                  time-sigs))
>               (set! time-sigs '())
>               (set! break-alignment #f)))))
>     \override TimeSignature.break-align-anchor =
>       #ly:break-aligned-interface::calc-extent-aligned-anchor
>     \override TimeSignature.break-align-anchor-alignment = #CENTER
>   }
> }
> 
> \paper {
>   short-indent = 0.5\in
>   left-margin = 0.5\in
> }
> 
> \score {
>   <<
>     \new Dynamics \with {
>       \consists Time_signature_engraver
>       \override TimeSignature.break-align-symbol = ##f
>       \override TimeSignature.font-size = #5
>       \override TimeSignature.self-alignment-X = #CENTER
>       \override TimeSignature.X-offset =
>         #self-alignment-interface::self-aligned-on-breakable
>       \override TimeSignature.break-align-symbols =
>         #'(staff-bar time-signature)
>     } {
>       \time-signatures
>     }
> 
>     \new Staff \with {
>       instrumentName = "Instruments"
>       shortInstrumentName = \markup {
>         \override #'(baseline-skip . 2.5)
>         \fill-line
>         {
>           \lower #1.25 "Ins."
>           \right-column { "1" "2" }
>         }
>       }
>     } \relative {
>       \clef "bass"
>       c16 d e f g a b c |
>       \clef "treble"
>       c16 d e f g a b c d e f g |
>       c,,16 d e f g a b c d e f g a b c d |
>       c,,16 d e f g a b c d e f g a b c d e f g a |
>     }
>   >>
> }
> 
> 
> 
> Best,
> Jean

Reply via email to