Controlling tuplet bracket visibility: Difference between revisions
Appearance
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 3: | Line 3: | ||
To control the visibility of tuplet brackets, set the property <code>bracket-visibility</code> to either <code>#t</code> (always print a bracket), <code>if-no-beam</code> (only print a bracket if there is no beam) or <code>#f</code> (never print a bracket). The latter is in fact equivalent to omitting the <code>TupletBracket</code> object altogether from the printed output. | To control the visibility of tuplet brackets, set the property <code>bracket-visibility</code> to either <code>#t</code> (always print a bracket), <code>if-no-beam</code> (only print a bracket if there is no beam) or <code>#f</code> (never print a bracket). The latter is in fact equivalent to omitting the <code>TupletBracket</code> object altogether from the printed output. | ||
<lilypond version="2.24" | <lilypond version="2.24"> | ||
music = \relative c'' { | music = \relative c'' { | ||
\tuplet 3/2 { c16[ d e } f8] | \tuplet 3/2 { c16[ d e } f8] | ||
| Line 24: | Line 24: | ||
} | } | ||
} | } | ||
</lilypond> | </lilypond> | ||
| Line 32: | Line 30: | ||
[[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 10:11, 30 November 2025
The default behavior of tuplet-bracket visibility is to print a bracket unless there is a beam of the same length as the tuplet.
To control the visibility of tuplet brackets, set the property bracket-visibility to either #t (always print a bracket), if-no-beam (only print a bracket if there is no beam) or #f (never print a bracket). The latter is in fact equivalent to omitting the TupletBracket object altogether from the printed output.
\version "2.24"
music = \relative c'' {
\tuplet 3/2 { c16[ d e } f8]
\tuplet 3/2 { c8 d e }
\tuplet 3/2 { c4 d e }
}
\new Voice {
\relative c' {
\override Score.TextMark.non-musical = ##f
\textMark "default" \music
\override TupletBracket.bracket-visibility = #'if-no-beam
\textMark \markup \typewriter "'if-no-beam" \music
\override TupletBracket.bracket-visibility = ##t
\textMark \markup \typewriter "#t" \music
\override TupletBracket.bracket-visibility = ##f
\textMark \markup \typewriter "#f" \music
\omit TupletBracket
\textMark \markup \typewriter "omit" \music
}
}