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 <l...@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