I am trying to write functions in Lilypond which take a chord (or list of pitches) as an argument and return music with said chord inserted into a rhythm. More specifically, I would like the function to be invoked in some way like this:
\chordFunction <c ef f af>
% or
\chordFunction #'(c ef f af)
and to return Lilypond code like so:
\tuplet 3/2 {<c ef f af>4 <c ef f af>8~} <c ef f af>2
jazzsyncoA =
#(define-music-function
(parser location chord)
(symbol-list-or-music?)
#{
\tuplet 3/2 {$<chord>4 $<chord>8~} $<chord>2
#}
)
but that throws
error: GUILE signaled an error for the expression beginning here
\tuplet 3/2 {$
<chord>4 $<chord>8~} $<chord>2
along with other errors when I attempt invocation. How should I write functions to accomplish this? Am I approaching the problem improperly?
I've looked in the Lilypond docs on predefined type predicates, but I can't recognize any of potential use.