lilypond-user
[Top][All Lists]
Advanced

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

Re: can't seem to apply tweaks on tweaks


From: Thomas Morley
Subject: Re: can't seem to apply tweaks on tweaks
Date: Wed, 30 Dec 2015 14:34:21 +0100

2015-12-30 13:48 GMT+01:00 Kieren MacMillan <address@hidden>:
> Hi Harm,
>
>> Of course you should use Staff.OttavaBracket
>
> Curiously,
>
>    \once \override OttavaBracket.extra-offset …
>
> [without the Staff context] works fine. (??)
>
>> but in `octU_single’ OttavaBracket.stencil is set to ly:line-spanner::print
>> which doesn’t support 'shorten-pair, as far as I know.
>
> Is there a better (e.g., more flexible, or more post-hoc-tweakable) way to 
> override the stencil?

The whole reason for exchanging the stencil seems to be getting sort
of superscript of "va" in "8va" and to have the spanning line starting
at top right edge.

If so, consider the code below.
Not that nice to mess around with \with-dimensions, but
`details.stencil-align-dir-y' had to be found manually before as well.

\version "2.19.32"

#(define eightva
  #{
    \markup
      %% messing around with \with-dimensions, because OttavaBracket has no
      %% possibility to set details.stencil-align-dir-y
      %% :((
      \with-dimensions #'(0 . 4) #'(0 . 2.8)
      \italic \concat { "8" \raise #0.5 { \hspace #0.25 "va" } \hspace #0.5 }
  #})

ottavaBracketNewText =
%% Not sure why a direct 'text-override does not work
\override Staff.OttavaBracket.after-line-breaking =
  #(lambda (grob) (ly:grob-set-property! grob 'text eightva))


%% 1
{
  \ottava #1
  c''''1^"untouched original"
}

%% 2

{
  \once \override Staff.OttavaBracket.shorten-pair = #'(-10 . -10)
  \ottava #1
  c''''1^"original, 'shorten-pair applied"
}

%% 3

{
  \ottavaBracketNewText
  \ottava #1
  c''''1^"text changed"
}

%% 4

{
  \once \override Staff.OttavaBracket.shorten-pair = #'(-10 . -10)
  \ottavaBracketNewText
  \ottava #1
  c''''1^"text changed, 'shorten-pair applied"
}

HTH,
  Harm



reply via email to

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