lilypond-user
[Top][All Lists]
Advanced

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

Re: best practices


From: Kieren MacMillan
Subject: Re: best practices
Date: Sun, 29 Jun 2008 10:50:03 -0400

Hello all,

For anyone who is interested in putting their 2ยข in on this discussion...

Here is a simple instrument-doubling-with-key-signature-changes challenge:

%%%%%%%%%%%%%%%%%%%%%
\version "2.11.49"
\include "english.ly"
#(set-global-staff-size 14)
\layout { \context { \Score printKeyCancellation = ##f } }

global =
{
        \time 4/4       \key c \major s1*2 \bar "||"
        \key c \minor s1*2 \bar "||"
        \key d \major s1*4 \bar "||"
}

flute = \relative
{
        c'4^\markup { flute (in C) } d e f | g1 | c,4 d ef f |
        g1^\markup { alto flute (in F) } | d4 e fs g | a1 |
        d,4^\markup { piccolo (in C') } e fs g | a1
}

\markup { C SCORE/PART }
\score { \new Staff = "fl" << \global \flute >> }

\markup { TRANSPOSED SCORE/PART }
\score { \new Staff = "fl" << \global \flute >> }

\markup { TRANSPOSED SCORE/PART SHOULD MATCH THE FOLLOWING: }
\score
{
        \relative
        {
\time 4/4 \key c \major c'4^\markup { flute (in C) } d e f | g1 \bar "||" \key c \minor c,4 d ef f | \key f \minor c'1^\markup { alto flute (in F) } \bar "||" \key g \major g4 a b c | d1 |
                \key d \major d,,4^\markup { piccolo (in C') } e fs g | a1 \bar 
"|."
        }
}
%%%%%%%%%%%%%%%%%%%%%%

The goal is to make this (i.e., the transposed score/part) happen with:
    1. a minimum of additional code;
2. a minimum of structural changes (e.g., if possible, we want to keep the key changes in a single variable, not break up the flute music variable, etc.);
    3. a maximum of code reusability.

In other words, something that can easily be put in a template for the average Lilypond user.

Good luck!
Kieren.

p.s. For the record, I haven't been able to find a way to use \tag and \transpose together to solve the problem -- it always requires code duplication or restructuring -- but my intuition currently says that's the best approach...





reply via email to

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