lilypond-user
[Top][All Lists]
Advanced

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

Re: VoltaBracket flipped vertically


From: Thomas Morley
Subject: Re: VoltaBracket flipped vertically
Date: Tue, 26 May 2015 18:09:23 +0200

2012-12-19 16:15 GMT+01:00 Daniel Rosen <address@hidden>:
> I'm trying to get VoltaBrackets to appear both above and below the Score. 
> I've come up with the solution below, which works quite well, but I'd like to 
> get the volta text to appear inside the bracket, as it does when VoltaBracket 
> #'direction is not altered. Is there a way to do this? I can't seem to find a 
> separate layout object for the volta text.
>
> %%% example starts
>
> \version "2.16.1"
> <<
>   \new Voice { \repeat unfold 12 { c' } }
>   \new Dynamics \with {
>     \consists "Volta_engraver"
>     \override VoltaBracket #'direction = #-1
>   } {
>     \repeat volta 2 { s1 }
>     \alternative { { s1 } { s1 } }
>   }
>>>
>
> %%% example ends
>
> DR

Hi all,

I revive this (very) old thread, because of a request in the german Forum.

Is there really no other possibility than poking in the stencul-expr,
which will likely break soon?

\version "2.19.20"

\layout {
  indent = #0
  \context { \Score \remove "Volta_engraver" }
}

\new Staff \with {
  \consists "Volta_engraver"
  \override VoltaBracket.direction = #DOWN
  \override VoltaBracketSpanner.direction = #DOWN

  \override VoltaBracket.after-line-breaking =
  #(lambda (grob)
    (let* ((default-stil (ly:volta-bracket-interface::print grob))
           (x-ext (ly:stencil-extent default-stil X))
           (y-ext (ly:stencil-extent default-stil Y))
           (stencil-expr (ly:stencil-expr default-stil)))

    (ly:grob-set-property! grob 'stencil
      (ly:make-stencil
        (cons 'combine-stencil
          (cons
            (append
              (list 'translate-stencil '(0 . 2.3))
              (list (cadr (third stencil-expr ))))
            (cddr (third stencil-expr))))

       x-ext
       y-ext))))
}

%%%%%%%%%%%%%%%%
%% EXAMPLE
%%%%%%%%%%%%%%%%

\relative c' {
  \repeat volta 2 { c1 }
  \alternative {
    { c }
    { c }
  }
  c
}


Cheers,
  Harm



reply via email to

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