Hi Graham, I'm not sure if it's of great help or even applicable to your problem at hand, but I have just more or less completed an infrastructure for a larger edition project that should at least include a solution.
If you want you can go to https://git.openlilylib.org/bfsc/kayser/tree/tidy-up and have a look (or clone the whole repository, check out the tidy-up branch (although I'm pretty close to merging it) and look around locally). It's a system that "pulls" music based on its location in the directory tree and generates scores flexibly from that. All the content - and metadata such as titles - is stored in a Scheme tree (provided by openLilyLib's option handling mechanism. When generating a part, score or bookpart the relevant information is retrieved from the corresponding leaf of the tree, e.g. kayser.content.masses.three.kyrie.meta.title to fetch the title string of the kyrie of mass three. The title is stored in a file works/masses/three/kyrie/commons.ily with \setMovementMetadata \with { title = "I. Kyrie" ... } where \setMovementMetadata determines the appropriate path in the tree from the file location. I won't go into any more details because I don't know it's useful at all for you. But I can of course provide any additional info. In general I had the impression that accessing data through the tree structure helped me avoid issues I had with top-level variables bleeding over. One neat thing about the system is that its interface is extremely simple (see the "entry" file https://git.openlilylib.org/bfsc/kayser/tree/tidy-up/make.ly), and the content is stored in remarkably clean files as well (see for example https://git.openlilylib.org/bfsc/kayser/blob/tidy-up/works/masses/three/kyrie/bc.ily for a continuo part with figured bass). This means that a) the contents of our edition may be quite easily reused if the "system" should one day prove unmaintainable and b) it should be rather straightforward to adapt existing music to the system. Best Urs Am 29.07.2016 um 22:07 schrieb Graham Percival: > I'm preparing a few books of my compositions, and looking for the > best way to organize my files. For example, one such book > consists of 5 pieces for 3 cellos. I have: > - 5 "music data" files > - 20 "print instrument \bookpart" files ((1 score + 3 cellos) * 5 > pieces) > - 4 "top-level" files which combine the relevant "print > instrument \bookpart" files into \books. > > I have a working system (below), but I'm wondering if I can > simplify it. In particular, I'd like to avoid repeating the > \bookpart { > \header { ... } > material in every "print instrument" file. > > Essentially, I'm hoping that it's possible to say "any time you > see a \bookpart, set its \header{} values to these > currently-defined variables, then clear those variables and > continue parsing". So far all my attempts along those lines > result in definitions intended for the second piece being used for > the first piece as well. > > Cheers, > - Graham > > > \version "2.18.2" > > %%% music-op-1-1.ly > title = "title 1 in C" > opus = "Op 1, no. 1" > piece = "This is a short performance note." > music = << > \tag #'score \tag #'one { e'4 } > \tag #'score \tag #'two { c'4 } >>> > > %%% print-score-op-1-1.ly > \bookpart { > \header { > title = \title > opus = \opus > piece = \piece > } > \score { \keepWithTag #'score \music } > } > > %%% music-op-1-2.ly > title = "title 2 in D" > opus = "Op 1, no. 2" > piece = "" > music = << > \tag #'score \tag #'one { f'4 } > \tag #'score \tag #'two { d'4 } >>> > > %%% print-score-op-1-2.ly > \bookpart { > \header { > title = \title > opus = \opus > piece = \piece > } > \score { \keepWithTag #'score \music } > } > > > _______________________________________________ > lilypond-user mailing list > [email protected] > https://lists.gnu.org/mailman/listinfo/lilypond-user > -- Urs Liska www.openlilylib.org _______________________________________________ lilypond-user mailing list [email protected] https://lists.gnu.org/mailman/listinfo/lilypond-user
