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 (parser location arg) (markup?)
         (make-dynamic-script arg))
\relative c' { 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.

Other languages: deutsch, español, français.
About automatic language selection.

LilyPond — Extending v2.17.97 (development-branch).