2.4 Event functions

To use a music function in the place of an event, you need to write a direction indicator before it. But sometimes, this does not quite match the syntax of constructs you want to replace. For example, if you want to write dynamics commands, those are usually attached without direction indicator, like c'\pp. Here is a way to write arbitrary dynamics:

dyn=#(define-event-function (arg) (markup?)
         (make-dynamic-script arg))
\relative { c'\dyn pfsss }

[image of music]

You could do the same using a music function, but then you always would have to write a direction indicator before calling it, like c-\dyn pfsss.

Extending LilyPond v2.25.18 (development-branch).