Jump to content

Analysis brackets with labels: 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
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
Text markup may be added to analysis brackets through the <code>text</code> property of the <code>HorizontalBracketText</code> grob. Adding different texts to brackets beginning at the same time requires the <code>\tweak</code> command.
Text markup may be added to analysis brackets using the <code>text</code> property of the <code>HorizontalBracketText</code> grob. Adding different texts to brackets beginning at the same time requires the <code>\tweak</code> command.


Bracket text will be parenthesized after a line break.
Bracket text gets parenthesized after a line break.
 
<lilypond version="2.24" full>
\paper { tagline = ##f }


<lilypond version="2.24">
\layout {
\layout {
   \context {
   \context {
Line 31: Line 29:
</lilypond>
</lilypond>


[[Category:Contexts and engravers]]
[[Category:Editorial annotations]]
[[Category:Editorial annotations]]
[[Category:Tweaks and overrides]]
[[Category:Tweaks and overrides]]
[[Category:Included in the official documentation]]
[[Category:Included in the official documentation]]
[[Category:Snippet]]

Latest revision as of 12:09, 11 December 2025

Text markup may be added to analysis brackets using the text property of the HorizontalBracketText grob. Adding different texts to brackets beginning at the same time requires the \tweak command.

Bracket text gets parenthesized after a line break.

\version "2.24"

\layout {
  \context {
    \Voice
    \consists "Horizontal_bracket_engraver"
    \override HorizontalBracket.direction = #UP
  }
}

{
  \once\override HorizontalBracketText.text = "a"
    c''\startGroup d''\stopGroup
    \once\override HorizontalBracketText.text = "a'"
    e''\startGroup d''\stopGroup |
  c''-\tweak HorizontalBracketText.text
        \markup \bold \huge "b" \startGroup
     -\tweak HorizontalBracketText.text "a" \startGroup
    d''\stopGroup
    e''-\tweak HorizontalBracketText.text "a'" \startGroup
    d''\stopGroup\stopGroup |
  c''-\tweak HorizontalBracketText.text foo \startGroup
    d'' e'' f'' | \break
  g'' a'' b'' c'''\stopGroup
}