|
From: | Matthew Fong |
Subject: | Re: Control of score visibility based on variables |
Date: | Wed, 2 Dec 2020 16:50:08 -0800 |
Hello Wim and Lukas,Many thanks for chiming in. I do like the cleaner solutions. At some point in the future, I will turn my work over to someone else, and they get to figure out some of these details!mattfongOn Wed, Dec 2, 2020 at 5:16 AM Lukas-Fabian Moser <lfm@gmx.de> wrote:Hi Matthew,
> I lifted an idea from your solution. I was looking for the
> if-statement, and didn't know the syntax for doing so. My
> solution looks like:
>
> isAmenFPO = ##t
>
> $(if (eq? isAmenFPO #t)
> #{
> \score { ...
> } % end score
> #}
> )
Perhaps easier with a bit of syntactic sugar:
\version "2.21.80"
myFlag = ##t
scoreIf = #(define-void-function (question? score) (scheme? ly:score?)
(if question? (add-score score)))
myScore = \score {
{ a4 b }
}
mySecondScore = \score {
{ c' d' }
}
myThirdScore = \score {
{ e' f' }
}
\scoreIf \myFlag \myScore
\scoreIf ##t \mySecondScore
% Compilation toggles every second...
\scoreIf #(even? (current-time)) \myThirdScore
Lukas
[Prev in Thread] | Current Thread | [Next in Thread] |