I want to create a function in Lilypond that accepts one note as input and returns the note with some markup applied. Specifically, I want to simplify something like the following:
\relative c' { d^\markup{\hspace #2 \smaller +1}-\bendAfter #+1 }
to something along the lines of
\relative c' { \bend{d} }
Currently I have the following snippet:
mF = \markup{\hspace #2 \smaller +1}
bF = \bendAfter #+1
bendF = #(define-music-function (parser location note) (ly:music?)
#{ $note^\mF-\bF #}
)
\relative c' { d^\mF-\bF }
\relative c' { \bendF{d} }
\version "2.16.2"
It seems that the data type ly:music?
is not the right one, or it is impossible to append the markup directly, and I end up with not very descriptive interpreter errors.
What is the best way to achieve this effect?