lilypond-user
[Top][All Lists]
Advanced

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

RE: Variables and Bookpart


From: Mark Stephen Mrotek
Subject: RE: Variables and Bookpart
Date: Sun, 12 Mar 2023 17:42:11 -0700

Jean,

 

Shall follow you explicit structure printed at the bottom.

Please consider including it in the Learning Manual.

Thank you is inadequate for your efforts.

 

Mark

 

 

From: Jean Abou Samra [mailto:jean@abou-samra.fr]
Sent: Sunday, March 12, 2023 5:10 PM
To: Mark Stephen Mrotek <carsonmark@ca.rr.com>; 'Hans Aikema' <hans.aikema@aikebah.net>
Cc: 'lilypond-user mailinglist' <lilypond-user@gnu.org>
Subject: Re: Variables and Bookpart

 

Le dimanche 12 mars 2023 à 16:54 -0700, Mark Stephen Mrotek a écrit :

Hans,
 
Thank you for your advice.
That format is not what is given in the manual.
 
\bookpart {
  \header { … }
  \score { … }
}.

I find this fascinating, because the user who asked this question on -user-fr yesterday also thought the documentation was wrong. But it's not! Or I haven't seen a proof yet.

There is nothing contradicting the reality in the structure sketch you wrote above. You just have to understand that lilypon makes a distinction between assignments, which don't have a value but execute an action, and values. The "..." in this code are placeholders for values, not for other things. Does it surprise you that you cannot write

music = \relative c'' {
  var = { c d e }
  \var \var
}

but instead must write

var = { c d e }
 
music = \relative c'' {
  \var \var
}

?

If not, I'm not exactly sure why it is surprising to you, although I see that it's not surprising just to you, that

\bookpart {
  var = { c' }
  \score { \var }
}

does not work, but

var = { c' }
\bookpart {
  \score { \var }
}

does.

An what is the advantage of being able to code separate files (for individual movements) if the variables for each must be copied into the book part?

Instead of

% movement1.ly
variable = \relative c'' { ... }
\bookpart { \score { \variable } }
 
% movement2.ly
variableII = \relative c'' { ... }
\bookpart { \score { \variableII } }
 
% main.ly
% \book { % whoops, does not work
\include "movement1.ly"
\include "movement2.ly"
% }

use:

% movement1.ly
variable = \relative c'' { ... }
bookpartI = \bookpart { \score { \variable } }
 
% movement2.ly
variableII = \relative c'' { ... }
bookpartII = \bookpart { \score { \variableII } }
 
% main.ly
\include "movement1.ly"
\include "movement2.ly"
\book {
  \bookpart { \bookpartI }
  \bookpart { \bookpartII }
}

reply via email to

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