> > BTW, I also tend to prepare lead sheets in F and A. Of course, you may > not need this. But if you are preparing a template, it might be helpful to > include other common transpositions. > > OK. The choice there is either to compile the file three times, adjusting > \PieceTranspose in the sequence c c then c f then c a, or to make two more > copies of the book-generating section, with (e.g.) \PieceTransposeFourth > and \PieceTransposeSixth in between. > > This would make it all a bit unwieldy, and as I want to be able to share > this with novice LilyPond users, I don?t want the make the file too long or > too clever! >
Sorry if I was not clear. I wasn't suggesting that you transpose every piece to the keys of F and A, but rather to be able to produce lead sheets in those common keys as well: HornTranspose = #(define-music-function (parser location m) (ly:music?) #{ \transpose f, c $m #}) AClarinetTranspose = #(define-music-function (parser location m) (ly:music?) #{ \transpose a, c $m #}) Granted, A clarinet isn't too common for Jazz, but it can't hurt. And as a clarinettist, I couldn't avoid the suggestion! > > But below, instead of using \PieceTranspose everywhere (which kind of > defeats the purpose of doing something globally) I would suggest > transposing \TheChords and \TheHead and then using \TransposedChords and > \TransposedHead in the template: > > This comes to the same thing, but uses two extra variables. > > But I can see the advantage in doing this in terms of clarity if it comes > immediately after the definition of the PieceTranspose function. > Besides that, I think that variables help if they clarify things. In this case, it provides an explicit name for the result of "\PieceTranspose { \TheHead } " This introduce twos additional variables, but results in six fewer function calls. Also, if I understand your intentions here, users of this template will never have to modify the score blocks, or these variables. So, I don't see the down side of introducing them. If anything, they separate boilerplate code (that doesn't have to be modified) from the piece-specific code (which does). If part of your point is to make use of \transpose less fraught, I think you still have an issue, since users of this template still have to modify "\transpose c c" within that function. Something that might be more friendly: originalKey = c newKey = f PieceTranspose = #(define-music-function (parser location m) (ly:music?) #{ \transpose \originalKey \newKey $m #}) That way, your users won't have to figure out which "c" in "\transpose c c $m" to adjust. Glad to hear this discussion has been helpful. David Elaine Alt 415 . 341 .4954 "*Confusion is highly underrated*" ela...@flaminghakama.com self-immolation.info skype: flaming_hakama Producer ~ Composer ~ Instrumentalist -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
_______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user