lilypond-user
[Top][All Lists]
Advanced

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

conditional formatting


From: Marten Visser
Subject: conditional formatting
Date: Mon, 04 Oct 2010 01:03:30 +0200

Hello again,

Typesetting my masterpiece :D, I ran into the following problem:
I have a piece for piccolo and guitar. If I typeset the music for guitar, I'd like to have a tablature staff in addition to the notes, but If I typset for piccolo, I'd like to omit the tablature. Since the music is the same in either case, I prefer to have one file where I can make a definition at the very beginning of the document like

=======================
% Outcomment whichever one is inappropriate
TypesetForInstrument = "Piccolo"
TypesetForInstrument = "Guitar"
=======================

Then, in the score-block, I'd like to typeset the TABStaff based on the value of the \TypesetForInstrument variable. I know scheme has a conditional 'if', but could somebody please provide me with a working example of how to implement the scheme conditional?

My guess is, the code should look something like:

=======================
if (eq TypesetForInstrument #"Piccolo")
#{ \new TabStaff
        <<
                ... (score for tablature)
        >>
#}
#{ % nothing to do if not guitar
#}
=======================

Thanks for your attention :)
--Marten




reply via email to

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