lilypond-devel
[Top][All Lists]
Advanced

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

Re: \bookpart and variables


From: Werner LEMBERG
Subject: Re: \bookpart and variables
Date: Mon, 09 Feb 2015 17:02:36 +0100 (CET)

>> why are variable assignments not allowed in \bookpart? [...]
> 
> Well, as far as I can see, assignments are also not allowed in
> books.

Hmm...

> And the reason mostly would be that books and bookparts don't have
> scope of their own (apart from book's \paper block).  So even if it
> were allowed, it would end up just the same as a global assignment
> outside of the book/bookpart.

OK.  Even if \book and \bookpart don't provide `real' grouping (in the
lilypond sense), they contain data between `{' and `}' – let's call
this visual grouping.  I consider it quite natural to put stuff into
`\bookmark { ... } ' to indicate that it belongs together.

> Do you have a particular use case in mind?

Yes.  I have the following structure for a collection of piano pieces

  file-a.ly:  left = ...
              right = ...

  file-b.ly:  left = ...
              right = ...
  ...

and I would like to organize it as follows.

   \bookpart {
     \include "file-a.ly"
     \score { ... }
   }

   \bookpart {
     \include "file-b.ly"
     \score { ... }
   }

   ...

Right now, I have to do this:

   \include "file-a.ly"
   \bookpart {
     \score { ... }
   }

   \include "file-b.ly"
   \bookpart {
     \score { ... }
   }

   ...


    Werner

reply via email to

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