|
From: | Lukas-Fabian Moser |
Subject: | Re: overriding voiceOne to add properties to that specific voice context |
Date: | Thu, 20 Aug 2020 14:46:09 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
Hi Maurits, Am 20.08.20 um 11:10 schrieb Maurits Lamers:
Hi, Great! This is the perfect solution. I had to adjust the (define-scheme-function) call a bit to run also under 2.18: setStructuralVoice = #(define-scheme-function (parser location num) (integer?) (make-apply-context (lambda (context) (ly:context-set-property! context 'structuralVoice (if (> num 0) num '()))))) It might need even more tweaks to run under 2.14 which is my target. I know it is a very old version, but there is a large body of Lilypond code my work depends on and that is lilypond 2.14. I am afraid that it would distract the current effort and cost too much time at the moment to convert that body of work to a more recent version of lilypond. So, it will probably end up like this, as I am unsure whether lilypond v20 can deal with v18 type calls to define-scheme-function.
[...]No need for that: When David K. got rid of the need to write out parser/location in every function definition five years ago, he also added a mechanism that detects and supports old-style usage (starting with "parser"). So your above definition works just fine in 2.20/2.21.
Nevertheless, I'd urge you to try and make sure that everything you develop will work with current LilyPond versions. Not only in order to lower the barrier for developers to help you (or others to make use of your additions), but also because LilyPond simply has evolved a great deal in the in the nine (!!) years since 2.14.2 was released, and is now at the same time much more feature-rich _and_ easier to use.
Lukas
[Prev in Thread] | Current Thread | [Next in Thread] |