Jump to content

Adding volta brackets to additional staves: Difference between revisions

From LilyPond wiki
m Replace version="2.24.0" with version="2.24" now that the LilyWiki extension supports auto-selecting the latest release in a stable series
mNo edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
The <code>Volta_engraver</code> by default resides in the <code>Score</code> context, and brackets for the repeat are thus normally only printed over the topmost staff. This can be adjusted by adding the <code>Volta_engraver</code> to the <code>Staff</code> context where the brackets should appear; see also the “Volta multi staff” snippet.
The <code>Volta_engraver</code> by default resides in the <code>Score</code> context, and brackets for the repeat are thus normally only printed over the topmost staff. This can be adjusted by adding the <code>Volta_engraver</code> to the <code>Staff</code> context where the brackets should appear
 
<code>\repeat</code> and related commands should be present in all staves.
 
See also [[Volta brackets in multiple staves]].


<lilypond version="2.24">
<lilypond version="2.24">
<<
<<
   \new Staff { \repeat volta 2 { c'1 } \alternative { c' } }
   \new Staff {
   \new Staff { \repeat volta 2 { c'1 } \alternative { c' } }
    \repeat volta 2 { c'1
   \new Staff \with { \consists "Volta_engraver" } { c'2 g' e' a' }
                    \alternative { \volta 1 { d' }
   \new Staff { \repeat volta 2 { c'1 } \alternative { c' } }
                                    \volta 2 { e' } } }
  }
   \new Staff {
    \repeat volta 2 { c'1
                    \alternative { \volta 1 { d' }
                                    \volta 2 { e' } } }
  }
   \new Staff \with { \consists "Volta_engraver" } {
    \repeat volta 2 { c'2 g'
                      \alternative { \volta 1 { d' a' }
                                    \volta 2 { e' b' } } }
  }
   \new Staff {
    \repeat volta 2 { c'1
                    \alternative { \volta 1 { d' }
                                    \volta 2 { e' } } }
  }
>>
>>
</lilypond>
</lilypond>


[[Category:Contexts and engravers]]
[[Category:Repeats]]
[[Category:Repeats]]
[[Category:Included in the official documentation]]
[[Category:Snippet]]

Latest revision as of 08:59, 4 December 2025

The Volta_engraver by default resides in the Score context, and brackets for the repeat are thus normally only printed over the topmost staff. This can be adjusted by adding the Volta_engraver to the Staff context where the brackets should appear

\repeat and related commands should be present in all staves.

See also Volta brackets in multiple staves.

\version "2.24"

<<
  \new Staff {
    \repeat volta 2 { c'1
                     \alternative { \volta 1 { d' }
                                    \volta 2 { e' } } }
  }
  \new Staff {
    \repeat volta 2 { c'1
                     \alternative { \volta 1 { d' }
                                    \volta 2 { e' } } }
  }
  \new Staff \with { \consists "Volta_engraver" } {
    \repeat volta 2 { c'2 g'
                      \alternative { \volta 1 { d' a' } 
                                     \volta 2 { e' b' } } }
  }
  \new Staff {
    \repeat volta 2 { c'1
                     \alternative { \volta 1 { d' }
                                    \volta 2 { e' } } }
  }
>>