Jump to content

Using alternative flag styles: 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
No edit summary
Line 36: Line 36:
[[Category:Included in the official documentation]]
[[Category:Included in the official documentation]]
[[Category:Rhythms]]
[[Category:Rhythms]]
[[Category:Tweaks and overrides]]
[[Category:Tweaks and overrides]][[Category:Snippet]]

Revision as of 23:02, 21 November 2025

Alternative styles of flag on eighth and shorter notes can be displayed by overriding the stencil property of Flag. Valid values are modern-straight-flag, old-straight-flag and flat-flag.

\version "2.24"

testnotes = {
  \autoBeamOff
  c8 d16 c32 d64 \acciaccatura { c8 } d64 r4
}

\score {
  \relative c' {
    \time 2/4
    \testnotes
  
    \override Flag.stencil = #modern-straight-flag
    \testnotes
  
    \override Flag.stencil = #old-straight-flag
    \testnotes
  
    \override Flag.stencil = #flat-flag
    \testnotes
  
    \revert Flag.stencil
    \testnotes
  }
  \layout {
    indent = 0
    \context {
      \Score
      \override NonMusicalPaperColumn.line-break-permission = ##f
    }
  }
}