lilypond-user-fr
[Top][All Lists]
Advanced

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

magnifyStaff et BarLine.bar-extent


From: Ya Gloops
Subject: magnifyStaff et BarLine.bar-extent
Date: Tue, 12 Apr 2022 09:29:08 +0000 (UTC)

Bonjour à tous !
J'ai l'habitude de modifier le BarLine.bar-extent mais quand j'utilise le 
magnifyStaff le BarLine n'est pas magnifié...
J'ai donc rajouté le (BarLine bar-extent) dans la fonction magnifyStaff.
Je ne suis pas sûr que ce soit la meilleure méthode mas ça à l'air de 
fonctionner...
Gilles

\version "2.22.2"

\score 
{
  \new Staff
  \with{\override BarLine.bar-extent = #'(-3.5 . 3.5)}
  { c'1}
}

\score 
{
  \new Staff
  \with{ \override BarLine.bar-extent = #'(-3.5 . 3.5) \magnifyStaff #1/2 }
  { c'1}
}

magnifyStaff =
#(define-music-function (mag) (positive?)
   (_i "Change the size of the staff, adjusting notation size and
horizontal spacing automatically, using @var{mag} as a size factor.")


   ;; these props are NOT allowed to shrink below default size
   (define unshrinkable-props
     '((StaffSymbol thickness)))


   ;; these props ARE allowed to shrink below default size
   (define shrinkable-props
     (let* ((baseline-skip-props
             (find-named-props 'baseline-skip all-grob-descriptions))
            (word-space-props
             (find-named-props 'word-space all-grob-descriptions))
            (space-alist-props
             (find-named-props 'space-alist all-grob-descriptions)))
       (append
        baseline-skip-props
        word-space-props
        space-alist-props
        '(
           ;; override at the 'Score level
           (SpacingSpanner spacing-increment)


           (StaffSymbol staff-space)
           (BarLine kern)
           (BarLine bar-extent) ;Test
           (BarLine segno-kern)
           (BarLine hair-thickness)
           (BarLine thick-thickness)
           (Stem beamlet-default-length)
           (Stem double-stem-separation)
           ))))


   #{
     \stopStaff


     %% revert settings from last time
     %% (but only if \magnifyStaff has already been used
     %% and the staff magnification is changing)
     #(revert-fontSize 'magnifyStaff mag)
     #(revert-props    'magnifyStaff mag (append unshrinkable-props
                                           shrinkable-props))


     %% scale settings
     %% (but only if staff magnification is changing
     %% and does not equal 1)
     #(scale-fontSize 'magnifyStaff mag)
     #(scale-props    'magnifyStaff mag #f unshrinkable-props)
     #(scale-props    'magnifyStaff mag #t shrinkable-props)


     %% this might cause problems until Issue 3990 is fixed
     \newSpacingSection


     \startStaff
     \set Staff.magnifyStaffValue = #mag
   #})


\score 
{
  \new Staff
  \with{ \override BarLine.bar-extent = #'(-3.5 . 3.5) \magnifyStaff #1/2 }
  { c'1}
}


reply via email to

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