lilypond-user
[Top][All Lists]
Advanced

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

Re: Storing a bookpart in a variable


From: Jacques Menu Muzhic
Subject: Re: Storing a bookpart in a variable
Date: Thu, 25 Feb 2016 09:08:10 +0100

Hello Vaughan,

Not sure to understand your need: would tags help in that case?

JM

> Le 25 févr. 2016 à 00:48, Vaughan McAlley <address@hidden> a écrit :
> 
> Greetings,
> 
> I’d like to be able to specify at the top of my main score which
> movements are printed. I can store a \bookpart in a variable, but I
> can’t seem to return it from a scheme expression. Is there a bookpart
> equivalent to define-music-function that I haven’t found?
> 
> Vaughan
> 
> 
> %%%%%%%%%%%%%%%%%%
> \version "2.18.2"
> 
> compileTheseMovements = "2" % change to "12" to compile both movements
> 
> EmptyBookpart = \bookpart {}
> 
> FirstMovement = \bookpart {
>   \tocItem "First Movement"
>   \header {
>      title = "Multi-movement piece"
>      composer = "LvB"
>      subtitle = "First Movement"
>   }
> 
>   \score {
>      { \time 2/4 r8 g' [ g' g'] es'2 }
>      \layout {}
>      \midi {}
>   }
> 
> }
> 
> SecondMovement = \bookpart {
>   \tocItem "Second Movement"
>   \header {
>      title = ##f
>      subtitle = "Second Movement"
>   }
>   \score {
>      { \time 3/8 \partial 8 es16. as32 c'8 c'16. bes32 as16. c'32 f4 }
>      \layout {}
>      \midi {}
>   }
> }
> 
> \book {
>   #(if
>     (string-contains compileTheseMovements "1")
>     FirstMovement
>     EmptyBookpart)
> 
>   #(if
>     (string-contains compileTheseMovements "2")
>     SecondMovement
>     EmptyBookpart)
> 
> %{
>   % This works fine
>   \FirstMovement
>   \SecondMovement
> %}
> 
> } % \book
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> 
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user




reply via email to

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