Jump to content

Changing the text for sustain markings: Difference between revisions

From LilyPond wiki
No edit summary
m New category
Line 19: Line 19:
[[Category:Included in the official documentation]]
[[Category:Included in the official documentation]]
[[Category:Keyboards]]
[[Category:Keyboards]]
[[Category:Tweaks and overrides]][[Category:Snippet]]
[[Category:Tweaks and overrides]]
[[Category:Snippet]]

Revision as of 23:12, 21 November 2025

Staff.pedalSustainStrings can be used to set the text used for pedal down and up. Note that the only valid strings are those found in the list of pedal glyphs - the values used this snippet constitute an exhaustive list.

\version "2.24"

sustainNotes = { c4\sustainOn d e\sustainOff\sustainOn f\sustainOff }

\relative c' {
  \sustainNotes 
  \set Staff.pedalSustainStrings = #'("P" "P-" "-")
  \sustainNotes 
  \set Staff.pedalSustainStrings = #'("d" "de" "e")
  \sustainNotes 
  \set Staff.pedalSustainStrings = #'("M" "M-" "-")
  \sustainNotes 
  \set Staff.pedalSustainStrings = #'("Ped" "*Ped" "*")
  \sustainNotes 
}