On Fri, 17 Feb 2023 at 19:26, Immanuel Asmus <
iasmus@freenet.de> wrote:
>
> Hello,
>
> I’d like to have an OttavaBracket with ottavation "8", but after a line
> break, the ottavation should read "(8)". I cannot figure out whether
> this can be achieved with \alterBroken, since ottavation is not a
> feature of OttavaBracket. I read in the internals that the
> Ottava_spanner_engraver creates a text spanner, but TextSpanner is not
> the right grob for \alterBroken either.
>
> I worked around my problem by adding
>
> \ottava #1
> \set Staff.ottavation = #"(8)"
>
> where the line breaks. But maybe there is a universal solution for the
> whole score.
Hello,
Slight adaptation of Valentin's answer here:
#(define (my-callback grob)
(let* ((orig (ly:grob-original grob))
(siblings (ly:spanner-broken-into orig)))
(if (not (eq? grob (car siblings)))
(ly:grob-set-property! grob 'text "(8)"))))
\score {
\new Staff {
\override Staff.OttavaBracket.after-line-breaking = #my-callback
\ottava #1
c''' 4 d''' e'''' f''''
\break
d''' f'''' g'''' a''''
\break
d''' f''' g''' a'''
}
}
Cheers,