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: Lukas-Fabian Moser
Subject: Re: Control of score visibility based on variables
Date: Wed, 2 Dec 2020 14:16:20 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

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]