# Consistent use of LIlypond Transpose Function

From the current lilypond doucmentation: http://lilypond.org/doc/v2.18/Documentation/notation/changing-multiple-pitches

I see the following explanation for the function `\transpose`:

``````\transpose frompitch topitch musicexpr
``````

It also provides two examples:

To go from a piece written in D to a piece written in E

``````\transpose d e {
\relative c' {
\key d \major
d4 fis a d
}
}
``````

To go from a piece written in C to a part written in A

``````\transpose a c' {
\relative c' {
\key c \major
c4 d e g
}
}
``````

I'm having trouble following applying this from pitch & to pitch logic.

Simply put, if I'm transposing from concert pitch, to instrument pitch, why isn't the expression `\transpose c a {}`. Testing this logic of course shows that this notation does not work, hence probably the two distinct use cases documented and demonstrated in the documentation.

Is there any particular reason why, using common vocabulary / logic, is inherently incorrect to interpret going from concert pitch, to instrument pitch? It's interesting to me that the documentation switches from talking about to and from pitches to talking about equivalent pitches between the two examples, but to me, it's all simple interval changes so I'm struggling to see the difference.

The difference in the two example is going "from a piece to a piece" in the first one and "from a piece to a part" in the second one.

The other confusing thing about the transpose command in Lilypond is that only the difference between the two notes is important.

In the first example there is a real transposition. When the transposed music is played, it sounds a whole tone higher.

It is logical to write "transpose d e" to transpose music that is actually in D major, into E major, but in fact any transposition by a whole tone (for example "transpose f g") would have the same effect. Try it!

In the second example there is no real transposition. The notes played by a Clarinet in A should be exactly the same pitch as played by a Flute (in C).

To do that, the Clarinet part must be written a minor third higher, so that when the Clarinet player reads an E flat, instrument plays a C.

You could specify that "transposition" as "transpose c es" but mathematically that is the same as "transpose a c'", and the second version is easier to get right because it includes the key of the transposing instrument (i.e. A for the clarinet).

I have no idea how you get from the original text in the documentation stating "If a part written in C (normal concert pitch) is to be played on the A clarinet (for which an A is notated as a C and thus sounds a minor third lower than notated), the appropriate part will be produced with: " to "To go from a piece written in C to a part written in A".

The only guess why you would equate those to is that you don't understand what an "A clarinet" (a transposing instrument) is, but it is explained in the sentence! Basically the instrument transposes written C down to concert pitch A, and when you write a score for it, you need to transpose the concert pitch A back up to written C.

The documentation is clear in that \transpose performs an actual transposition which has a distance (or interval) and a direction (up or down) as result. What you need to be clear about is that a transposing instrument needs its part transposed in the reverse direction as the transposition the instrument does. In that sense, the transpose function is low level, because you have to think which direction you need to apply it. Once you realize this direction has to be the opposite from that the instrument does (to make a part for it from a score in concert pitch), it is easy to apply.

That said, if you want to transpose music in concert pitch to music for, say, a clarinet in A, and you want a function which admits pitch arguments in the order "C A", that is a reverse transposition that is not exactly the same as the \transpose built-in, low level function. You could theoretically create a wrapper reverse transpose function which reverses the order of its arguments and calls transpose in turn.