lilypond-user
[Top][All Lists]
Advanced

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

Re: Control of score visibility based on variables


From: Matthew Fong
Subject: Re: Control of score visibility based on variables
Date: Wed, 2 Dec 2020 16:50:08 -0800

... and I will have use of question? Didn't know about that!

On Wed, Dec 2, 2020 at 1:49 PM Matthew Fong <oxengen@gmail.com> wrote:
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!


mattfong

On 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



reply via email to

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