I'm trying to use the code from a snippet found on the official documentation on "Displaying pitches" (scroll down to "Known issues and warnings"):
\version "2.18.2"
forget = #(define-music-function (music) (ly:music?) #{
\accidentalStyle forget
#music
\accidentalStyle modern
#})
{
\accidentalStyle modern
\time 2/4
\repeat volta 2 {
c'2
}
\alternative {
\repeat volta 1 { cis' }
\repeat volta 2 { \forget c' }
}
}
When I compile it, I get the following error:
Changing working directory to: `/tmp'
Processing `/tmp/11678868158475380898.ly'
Parsing.../usr/share/lilypond/2.18.2/scm/ly-syntax-constructors.scm:56:23: In expression (apply (ly:music-function-extract fun) parser ...):
/usr/share/lilypond/2.18.2/scm/ly-syntax-constructors.scm:56:23: Wrong number of arguments to #<procedure #f (music)>
I get a similar error when trying other substitution functions, e.g. the ones provided here. I'm not familiar with Scheme so I can't really debug/analyze what I'm doing wrong.
I'm using Lilypond 2.18.2 on a Raspberry Pi, if that matters.