Urs Liska <[email protected]> writes: > Am 07.12.18 um 10:55 schrieb mansouraoun: >> i wrote the code in raw and it's somehow not displayed in my message >> Here it is >> >> dynx = >> #(define-music-function >> (parser location X-offset) >> (number?) >> #{ >> \once\override DynamicText.X-offset = #X-offset >> #}) >> >> Mansour >> > As David said: if you use the development version (currently 2.19.82) > you can simplify this by skipping "parser location": > > ... > #(define-music-function (X-offset)(number?) > ...
Actually, if you switch to the development version, you can simplify this by writing dynx = \once\override DynamicText.X-offset = \etc but the \etc construct works only for a limited number of uses and does nothing different than generating a music function of that kind. Also when writing the music function manually, you can use a more specific predicate and have the arguments checked directly for the right type and possibly coerced: for example, -3 without further qualification is a number, but when you use a ly:event? predicate for a music function, it will be a fingering. -- David Kastrup _______________________________________________ lilypond-user mailing list [email protected] https://lists.gnu.org/mailman/listinfo/lilypond-user
