2

This is actually a repeat of a 20 year old question that I never found an answer to:

I'm trying to get something like this:

          |--------------||--------------||-------------- 
|: Notes1 | Alternative1 :| Alternative2 || Alternative3 |. Notes2...

The problem I'm facing is that the right side of the second volta bracket is open as soon as I'm changing the bar line after the second alternative to "|.|" using the \bar command.

Here is my test case:

\version "2.24.0"

voltaToVerse = \markup { 2. \text \italic { to verse } }
voltaFine = \markup { \text \bold { Final. } }

\relative {
  f''4 g a b
  \set Score.repeatCommands = #'((volta "1."))
  c1 
  \bar ":|."

  \set Score.repeatCommands = #(list(list 'volta voltaToVerse))
  c1 
  \bar "|.|"
  
  \set Score.repeatCommands = #(list(list 'volta voltaFine))
  c1
  \bar ".."
  \set Score.repeatCommands = #'((volta #f))
}

Here's what I get: Test Output

Any hints how to force the volta brackets to be closed on the 2nd ending are welcome.

1 Answer 1

2

Use

\allowVoltaHook "|.|"

on toplevel to set voltas to hook down at this bar line glyph. Alternatively we might do something like

\once\override Score.VoltaBracket.before-line-breaking =
#(lambda (grob)
   (ly:grob-set-property! grob 'edge-height '(2 . 2)))

to selectively hook down specific Volta brackets. Here is a MWE showing both options in action:

\allowVoltaHook "|.|"

\repeat volta 4 {
  \alternative {
    { 1 \bar "||" }
    { 1 \bar "|.|" }
    {
      \once\override Score.VoltaBracket.before-line-breaking =
      #(lambda (grob)
         (ly:grob-set-property! grob 'edge-height '(2 . 2)))
      1 \bar "."
    }
    { 1 \bar ".." }
  }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.