Jump to content

Controlling the appearance of tremolo slashes: 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 7: Line 7:
** <code>constant</code>: all slashes are beam-like and have the same slope except for down-stem flags.
** <code>constant</code>: all slashes are beam-like and have the same slope except for down-stem flags.


<lilypond version="2.24" full>
<lilypond version="2.24">
music = {
music = {
   a''4:32 a':
   a''4:32 a':
Line 43: Line 43:
   \override StemTremolo.slope = -0.2
   \override StemTremolo.slope = -0.2
   \music
   \music
}
\paper {
  indent = 0
  tagline = ##f
}
}
</lilypond>
</lilypond>
Line 54: Line 49:
[[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 09:28, 4 December 2025

Using various properties of the StemTremolo grob it is possible to control the appearance of tremolo slashes.

  • Property slope sets the slope for tremolo slashes.
  • Property shape determines whether tremolo slashes look like rectangles (value rectangle) or like very small beams (value beam-like).
  • Property style sets both the slope and the shape depending on whether the note has flags, beams, or only a plain stem. This is in contrast to the previous two properties, which change the slope and shape unconditionally. There are two styles defined.
    • default: slashes for down-stem flags are longer and more sloped than slashes for up-stem flags; slashes on beamed notes have a rectangular shape and are parallel to the beam.
    • constant: all slashes are beam-like and have the same slope except for down-stem flags.

\version "2.24"

music = {
  a''4:32 a':
  e''8: \noBeam e':
  a'':[ a':]
  f':[ g':]
  d':[ d':]
}

\new Staff {
  <>^\markup "default"
  \music
}

\new Staff {
  <>^\markup \typewriter "style = #'constant"
  \override StemTremolo.style = #'constant
  \music
}

\new Staff {
  <>^\markup \typewriter "shape = #'rectangle"
  \override StemTremolo.shape = #'rectangle
  \music
}

\new Staff {
  <>^\markup \typewriter "shape = #'beam-like"
  \override StemTremolo.shape = #'beam-like
  \music
}

\new Staff {
  <>^\markup \typewriter "slope = -0.2"
  \override StemTremolo.slope = -0.2
  \music
}