lilypond-user
[Top][All Lists]
Advanced

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

Re: Height of start bar brace


From: Pierre Perol-Schneider
Subject: Re: Height of start bar brace
Date: Wed, 27 May 2015 10:23:27 +0200

Hi Joram,

2015-05-26 14:46 GMT+02:00 Noeck <address@hidden>:
Dear Pierre,

thanks for looking into this. However, I don't understand what you tell
me here. If I run your code, I see that it does *not* automatically
scale the brace but it is rather odd: too small or too big.

Cheers,
Joram

See:
 
2015-04-26 23:42 GMT+02:00 Nathan Ho <address@hidden>:
 
For some reason this solution doesn't automatically center the bracket perfectly, but it's a start.
 
So I slightly change Nathan's code so that it 'centers' automatically, no matter what scaling is (crazy scalings were just to show up).
As far as I understood, brace scale setting depends on you, doesn't it?
E.g. #0.99 :

%% => http://lilypond.1069038.n5.nabble.com/Height-of-start-bar-brace-td175422.html

\version "2.19.16"

\new PianoStaff
  \with {
    \override SystemStartBrace.stencil =
      #(lambda (grob)
         (let* ((scale-amount 0.99)
                (stil (ly:system-start-delimiter::print grob))
                (scaled-stil (ly:stencil-scale stil scale-amount scale-amount))
                (extent (ly:stencil-extent stil Y))
                (height (- (cdr extent) (car extent))))
           (ly:stencil-translate-axis
             scaled-stil
               (* -0.5 (- 1 scale-amount) (+ height 3.5))
             Y)))
  } 
  <<
    \new Staff { c'1 }
    \new Staff { c'''1 }
  >>

\new PianoStaff
  \with {
    \override SystemStartBrace.stencil =
      #(lambda (grob)
         (let* ((scale-amount 0.99)
                (stil (ly:system-start-delimiter::print grob))
                (scaled-stil (ly:stencil-scale stil scale-amount scale-amount))
                (extent (ly:stencil-extent stil Y))
                (height (- (cdr extent) (car extent))))
           (ly:stencil-translate-axis
             scaled-stil
               (* -0.5 (- 1 scale-amount) (+ height 3.5))
             Y)))
  }
  <<
    \new Staff { c1 }
    \new Staff { c''''1 }
  >>

\new PianoStaff
  \with {
    \override SystemStartBrace.stencil =
      #(lambda (grob)
         (let* ((scale-amount 0.99)
                (stil (ly:system-start-delimiter::print grob))
                (scaled-stil (ly:stencil-scale stil scale-amount scale-amount))
                (extent (ly:stencil-extent stil Y))
                (height (- (cdr extent) (car extent))))
           (ly:stencil-translate-axis
             scaled-stil
               (* -0.5 (- 1 scale-amount) (+ height 3.5))
             Y)))
  }
  <<
    \new Staff { c,1 }
    \new Staff { c'''''1 }
  >>

\new PianoStaff
  \with {
    \override SystemStartBrace.stencil =
      #(lambda (grob)
         (let* ((scale-amount 0.99)
                (stil (ly:system-start-delimiter::print grob))
                (scaled-stil (ly:stencil-scale stil scale-amount scale-amount))
                (extent (ly:stencil-extent stil Y))
                (height (- (cdr extent) (car extent))))
           (ly:stencil-translate-axis
             scaled-stil
               (* -0.5 (- 1 scale-amount) (+ height 3.5))
             Y)))
  }
  <<
    \new Staff { c,,1 }
    \new Staff { c''''''1 }
  >>



Cheers,
Pierre



reply via email to

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