Re: Snippet for conditional score compilation

2017-11-16 Thread Kieren MacMillan
Hi Saul,

> Here's a short little snippet to turn on or off whether a score is compiled.
> I'm using this to control which movements are compiled across all my 
> instrumental parts from a flag in a single file.

Nice! I do the same kind of thing in my big multi-movement works (operas, 
musicals, etc.)

For those searching the list and finding this thread, here's another way of 
accomplishing conditional engraving:

  SNIPPET BEGINS
\version "2.19.80"

include_A = ##t

nullscore = \markup \null
score_A = \score { { c''4 } }

$(if include_A score_A nullscore)
  SNIPPET ENDS

Best,
Kieren.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Snippet for conditional score compilation

2017-11-16 Thread Saul Tobin
Hi all,

Here's a short little snippet to turn on or off whether a score is compiled.

\version "2.18.2"

% Swap the commented lines to demonstrate that you can turn the score on
and off

flag = ##t
% flag = ##f

compileIf = #(define-void-function (parser location flag score)  (boolean?
ly:score?)
   (if flag
   (add-score parser score)
   ))

\compileIf \flag \score {
  \new Staff { c'1 }
  % \new Staff { d'1 }
}

I'm using this to control which movements are compiled across all my
instrumental parts from a flag in a single file.

Saul
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user