lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A matter of optional arguments


From: Jean Abou Samra
Subject: Re: A matter of optional arguments
Date: Fri, 23 Dec 2022 18:17:39 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0

Le 23/12/2022 à 17:54, Rip _Mus a écrit :
Hello everyone,
I'm working on a function that prints a personal type of tremolo.
This function has four arguments, the first and the last are optional.
The first is actually optional, as you can see in the minimal exemple attached. The last, instead, is problematic: if I omit it, there is an error.
May I ask for your help?



Trailing optional arguments are simply not supported, as they would mess up the parsing. See

https://lilypond.org/doc/v2.24/Documentation/extending/scheme-function-usage.html

If an optional argument is the last argument, the only way to use it is to put \default as a placeholder.

You can also most the 'st' argument just after 'fr'. In that case, if you want to use it, you have to specify fr with its default 1/4, because once an optional argument is skipped, all following optional arguments are skipped. (\default would not work, since it also sets all the following arguments to their default values.)

Yet another possibility is putting 'st' between 'main-note' and 'aux-pitch', in which case it will really behave in the most flexible way.

Best,
Jean

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]