lilypond-user
[Top][All Lists]
Advanced

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

Re: Center align Bar numbers to first note in first measures on new line


From: Jean Abou Samra
Subject: Re: Center align Bar numbers to first note in first measures on new lines
Date: Mon, 19 Apr 2021 11:07:18 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1


Le 18/04/2021 à 20:16, F M a écrit :
Thank you
 
Correction

Currently, I have bar numbers aligned to the right of the key signatures

This is what I have at the moment:

MvmntIVoiceI = {
\override Score.BarNumber.font-size = #0.2 
\override Score.BarNumber.font-series = #'bold 
\override Score.BarNumber #'break-align-symbols = #'(key-signature staff-bar clef) 
\override Score.Clef #'break-align-anchor-alignment = #RIGHT 
\tempo "Allegro" 
\stemUp

fis''4 r8 fis'' e'' fis'' g''4\AutoBarline
         fis'' r8 fis'' e'' fis'' g''4\AutoBarline
         fis'' r8 a'' b'' a'' d''' a''\AutoBarline
         b'' a'' d''' a'' g''4 fis''\AutoBarline
%5
         e'' r8<>  \p a''8 b'' a'' d''' a''\AutoBarline
         b'' a'' d''' a'' g''4 fis''\AutoBarline
         e'' \revert Stem.direction  r4 a''16 g'' fis'' e'' d'' cis'' b' a'\AutoBarline
         b'8 b' b' b' b''16 a'' g'' fis'' e'' d'' cis'' b'\AutoBarline
         cis''8 cis'' cis'' cis'' cis'''16 b'' a'' g'' fis'' e'' d'' cis'' 
\AutoEndMovementBarline}

Note, I am using Denemo software.


Hello,

Here is a potential way to achieve this layout:


\version "2.23.3"

#(define fake-musical-when-first
   (grob-transformer 'after-line-breaking
     (lambda (bar-number dummy)
       (let* ((sys (ly:grob-system bar-number))
              (columns (ly:grob-object sys 'columns))
              (break-alignment (ly:grob-parent bar-number X))
              (bar-number-column (ly:grob-parent break-alignment X))
              (first-column (ly:grob-array-ref columns 0))
              (first-musical-column (ly:grob-array-ref columns 1))
              (is-first (eq? bar-number-column first-column)))
         (if is-first
             (let ((refpoint (ly:grob-common-refpoint bar-number first-musical-column X)))
               (ly:grob-translate-axis!
                 bar-number
                 (- (ly:grob-relative-coordinate first-musical-column refpoint X)
                    (ly:grob-relative-coordinate bar-number refpoint X))
                 X)))))))

\layout {
  \context {
    \Score
    \override BarNumber.after-line-breaking = #fake-musical-when-first
    \override BarNumber.break-visibility = ##(#f #t #t)
    \override BarNumber.outside-staff-priority = 1000
  }
}


<<
  {
    c'1
    \break
    <c' d'>4^"Marcato" e' f' g'
    a' b' c' d'
    \break
    g' g' g' g'
  }
  {
    c'1
    1
    1
    1
  }
>>


Regards,
Jean


reply via email to

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