2.3.2 Music function usage

Music functions may currently be used in three places. Depending on where they are used, restrictions apply in order to be able to parse them unambiguously. The result a music function returns must be compatible with the context in which it is called.

The special rules for trailing arguments make it possible to write polymorphic functions like \tweak that can be applied to different constructs.

There is another somewhat special rule: if you have a predicate ly:music? directly before a ly:duration? predicate, then the corresponding music expression must be either a music identifier, or literal sequential or parallel music enclosed in {} or <<>> explicitly. Otherwise, Lilypond could get confused about where the music ends and the duration starts.


LilyPond — Extending