[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cleanly dealing with variables and reducing code duplication in mult
From: |
Paul Morris |
Subject: |
Re: cleanly dealing with variables and reducing code duplication in multimovement works |
Date: |
Thu, 3 Apr 2014 08:10:22 -0700 (PDT) |
Shevek wrote
> I'm working on a multi-movement piece, so far using a separate file for
> the score of each movement. I'm trying to add a file to the project that
> compiles all the movements and frontmatter into a single pdf, using
> bookparts, and I'm having trouble figuring out the best way to do that.
I recently faced this as well, but ended up using the equivalent of prefixes
on the variables, which made sense for my use case. You can see what I came
up with here:
http://clairnote.org/sheet-music/#180-fiddle-tunes
(There's a standard notation version of the ly files linked from there as
well.)
In order to make it easy to produce versions in different clefs and for
transposed instruments I wrote a music function that produced the score for
each tune, passing it four arguments: title, composer, melody, and chords.
The melodies and chords were stored in variables in include files, one file
for each tune (with a score block commented out for editing individual
tunes). The layout is arranged using bookparts (one per page), calling the
score-generating function for each tune from within the bookparts.
It sounds like Urs or Jan-Peter's approaches may be more what you're after
in terms of variable names though.
Cheers,
-Paul
--
View this message in context:
http://lilypond.1069038.n5.nabble.com/cleanly-dealing-with-variables-and-reducing-code-duplication-in-multimovement-works-tp161112p161152.html
Sent from the User mailing list archive at Nabble.com.