Jump to content

Altering the length of beamed stems: Difference between revisions

From LilyPond wiki
No edit summary
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:
\relative c'' {
\relative c'' {
   \override Stem.details.beamed-lengths = #'(2)
   \override Stem.details.beamed-lengths = #'(2)
  a8[ a] a16[ a] a32[ a]
    a8[ a] a16[ a] a32[ a]
  \override Stem.details.beamed-lengths = #'(8 10 12)
    \override Stem.details.beamed-lengths = #'(8 10 12)
  a8[ a] a16[ a] a32[ a] r8
    a8[ a] a16[ a] a32[ a] r8 |
   \override Stem.details.beamed-lengths = #'(8)
   \override Stem.details.beamed-lengths = #'(8)
  a8[ a]
    a8[ a]
  \override Stem.details.beamed-lengths = #'(8.5)
    \override Stem.details.beamed-lengths = #'(8.5)
  a8[ a]
    a8[ a]
  \revert Stem.details.beamed-lengths
    \revert Stem.details.beamed-lengths
  a8[ a] a16[ a] a32[ a] r16
    a8[ a] a16[ a] a32[ a] r16 |
}
}
</lilypond>
</lilypond>
Line 18: Line 18:
[[Category:Included in the official documentation]]
[[Category:Included in the official documentation]]
[[Category:Pitches]]
[[Category:Pitches]]
[[Category:Tweaks and overrides]][[Category:Snippet]]
[[Category:Tweaks and overrides]]
[[Category:Snippet]]

Latest revision as of 05:51, 11 January 2026

Stem lengths on beamed notes can be varied by overriding the beamed-lengths property of the details of the Stem. If a single value is used as an argument, the length applies to all stems. When multiple arguments are used, the first applies to eighth notes, the second to sixteenth notes and so on. The final argument also applies to all notes shorter than the note length of the final argument. Non-integer arguments may also be used.

\version "2.24"

\relative c'' {
  \override Stem.details.beamed-lengths = #'(2)
    a8[ a] a16[ a] a32[ a]
    \override Stem.details.beamed-lengths = #'(8 10 12)
    a8[ a] a16[ a] a32[ a] r8 |
  \override Stem.details.beamed-lengths = #'(8)
    a8[ a]
    \override Stem.details.beamed-lengths = #'(8.5)
    a8[ a]
    \revert Stem.details.beamed-lengths
    a8[ a] a16[ a] a32[ a] r16 |
}