On 2018-05-11 14:17, David Kastrup wrote:
Aaron Hill <lilyp...@hillvisions.com> writes:
The error message reads pretty clearly, though. The result of a music
function cannot be a single NOTENAME_PITCH.
The result of a music function cannot be a pitch, period. It has to be
a music expression. A pitch is not a music expression.
I think we are in violent agreement here. It is going to be pointless
to nitpick details that are likely irrelevant and off-topic. So in an
effort to circle back to summarize and address the original question...
A music function must evaluate to a music expression.
The reason why #{ $p #} does not work as the body of a music function is
that it will only evaluate to a pitch not a note, and that pitch by
itself is not enough to create a music expression.
#{ $p 4 #} works because a pitch followed by a duration clearly defines
a note, which is enough to form a music expression.
#{ $p $p #} and #{ $p a' #}, even though missing explicit durations,
both work because two or more bare pitches can be interpreted as a
sequence of notes where the duration of the notes will be defined by
preceding context.
Finally, #{ { $p } #} works because the inner braces specifically
instantiate a music expression. Though, again, the note resulting from
the bare pitch will have to inherit its duration from prior notes or
default values.
Clear as mud? :)
-- Aaron Hill
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user