[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: booleans and conditional compilation?
From: |
Simon Albrecht |
Subject: |
Re: booleans and conditional compilation? |
Date: |
Fri, 1 Apr 2016 22:43:47 +0200 |
On 01.04.2016 21:23, Johannes Waldmann wrote:
Hi.
Is there a standard way of conditional compilation,
e.g., to turn parts (on any level) of a score on and off?
The standard way is using tags, as Urs said.
But of course you can do everything you like via scheme:
\version "2.19.38"
foo = ##f
A = { c' }
B = { d' }
{
#(if foo A B)
}
or, without music variables,
\version "2.19.38"
foo = ##f
{
#(if foo
#{ { c' } #}
#{ { d' } #})
}
However that seems like a work-around because lilypond
has LISP inside and that sure has booleans and conditionals.
Oh, and I looked up "conditional" in the docs
(D. LilyPond command index) (no results).
There are no conditionals in LilyPond syntax, but you can use Guile
Scheme. The use of it in LilyPond is explained in the Extending Manual
<http://lilypond.org/doc/v2.19/Documentation/extending/index.html>.
HTH, Simon