lilypond-user
[Top][All Lists]
Advanced

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

Re: Tweaking an ottava bracket after a break


From: Jean Abou Samra
Subject: Re: Tweaking an ottava bracket after a break
Date: Sat, 6 Nov 2021 22:19:01 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1



Le 06/11/2021 à 22:01, Knute Snortum a écrit :
Hello again,

I have a situation where I need to adjust the padding of an ottava
bracket after a line break. That is, I want to affect the bracket on
the second line, but not the first.

I know you can do something like this with the \shape function, but
what about brackets?

I tried this solution -- blatantly stolen from the Difficult Tweaking
section in the manual -- but it doesn't work.

%%%
\version "2.22.1"

#(define (my-callback grob)
    (let* (
           ;; have we been split?
           (orig (ly:grob-original grob))

           ;; if yes, get the split pieces (our siblings)
           (siblings (if (ly:grob? orig)
                         (ly:spanner-broken-into orig)
                         '())))

      (if (and (>= (length siblings) 2)
               (eq? (car (last-pair siblings)) grob))
          (ly:grob-set-property! grob 'padding 4))))

\relative {
   \override OttavaBracket.after-line-breaking = #my-callback
   \ottava 1 c''''1 \break
   c2 2
}
%%%

Anything easier than this?  Some other solution?


It should be Staff.OttavaBracket because the
Ottava_spanner_engraver is in Staff context
(http://lilypond.org/doc/v2.22/Documentation/internals/ottava_005fspanner_005fengraver).

As Kieren showed, this is much easier done using
\alterBroken. The documentation was outdated, see

https://gitlab.com/lilypond/lilypond/-/merge_requests/991

Best,
Jean



reply via email to

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