Re: Modify ly:duration->string
Lukas-Fabian Moser <[email protected]> Sun, 10 May 2026 13:37:13 +0200
| Newsgroups | gmane.comp.gnu.lilypond.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Harm, Am 10.05.26 um 12:36 schrieb Thomas Morley: > consider the following: > #(pretty-print (ly:duration->string (ly:make-duration -3))) > returning: > "log = -3" > > Is it possible to let it return "maxima" (similar for "longa", "breve")? > To be more precise, this is a request to modify ly:duration->string (I > have already some clumsy custom code to deal with negative durations). Of course it's basically no problem to make this change (I assume it's the fact that ly:duration->string is implemented in C++ that makes you ask this question in the first place). But I have a slight issue with that: One might hard-code ly:duration->string to output \maxima etc. (which I'd prefer to 'maxima', since all other duration strings returned by the function are valid LilyPond syntax). But "maxima" is not a term that's baked into the C++ part of LilyPond, but it's a (so to speak) arbitrary definition in ly/declarations-init.ly. It would, at first glance, feel strange to me to implement this term unconditionally in the C++ code as a return string for ly:duration->string ... What do you think? Lukas