Jump to content

Controlling tuplet bracket visibility: Difference between revisions

From LilyPond wiki
m New category
Tags: Mobile edit Mobile web edit
mNo edit summary
 
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" full>
<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:
   }
   }
}
}
\paper { tagline = ##f }
</lilypond>
</lilypond>



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
  }
}