(moved from bug-lilypond to lilypond-user)

Here's another solution. The only issue is that
I don't know how to configure it so that you 
can modify extra-x-padding and extra-y-padding
on-the-fly. Anyone?

- Mark



      
\version "2.13.0"
\pointAndClickOff

#(define (whiteout-volta-stil grob)
   (let* ((extra-x-padding '(0.3 . 0.8))
          (extra-y-padding '(3 . 0))
          (this-stil (ly:volta-bracket-interface::print grob))
          (stil-x-ext (ly:stencil-extent this-stil 0))
          (stil-y-ext (ly:stencil-extent this-stil 1))
          (box-x-ext (cons (- (car stil-x-ext)
                              (car extra-x-padding))
                           (+ (cdr stil-x-ext)
                              (cdr extra-x-padding))))
          (box-y-ext (cons (- (car stil-y-ext)
                              (car extra-y-padding))
                           (+ (cdr stil-y-ext)
                              (cdr extra-y-padding))))
          (box-w (- (cdr box-x-ext) (car box-x-ext)))
          (box-h (- (cdr box-y-ext) (car box-y-ext)))
          )
     (ly:grob-set-property! grob 'stencil
      (ly:stencil-add
       (ly:make-stencil
        (list 'embedded-ps
         (ly:format
          (string-append "gsave\n"
                         "currentpoint translate\n"
                         "1 setgray\n"
                         "~a ~a ~a ~a rectfill\n"
                         "grestore\n")
          (car box-x-ext)
          (car box-y-ext)
          box-w
          box-h))
        stil-x-ext
        stil-y-ext)
       this-stil))))

whiteoutVoltas = {
  \override Slur #'layer = #-2
  \override Tie #'layer = #-2
  \override Score.VoltaBracket #'avoid-slur = ##f
  \override Score.VoltaBracket #'layer = #-1
  \override Score.VoltaBracket #'stencil = #whiteout-volta-stil
}

normalVoltas = {
  \revert Slur #'layer
  \revert Tie #'layer
  \revert Score.VoltaBracket #'avoid-slur
  \revert Score.VoltaBracket #'layer
  \revert Score.VoltaBracket #'stencil
}

\paper {
  ragged-right=##t
}
\relative c'' {
  \repeat volta 2 {
    c,2^\markup {tacet la 1 \hspace #-1.5 \raise #1.0 ma volta}\p(
      b a g4) g'8( f |
    e4 c d2) |
    % you need to call \whiteoutVoltas before the slur starts:
    \whiteoutVoltas 
      r4 e8( c cis4 a' |
  }
  
  \alternative {
    { r1 | }
    {
      \normalVoltas
      c,!2 b) |
    }
  }
}

<<attachment: breaking-slurs.png>>

_______________________________________________
lilypond-user mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to