Next: , Previous: Instrument names, Up: Orchestral music



3.14.5 Transpose

A music expression can be transposed with \transpose. The syntax is

     \transpose from to musicexpr

This means that musicexpr is transposed by the interval between the pitches from and to: any note with pitch from is changed to to.

For example, consider a piece written in the key of D major. If this piece is a little too low for its performer, it can be transposed up to E major with

     \transpose d e ...

Consider a part written for violin (a C instrument). If this part is to be played on the A clarinet, the following transposition will produce the appropriate part

     \transpose a c ...

Since from and to are pitches, so \transpose must be inside a \notes section. \transpose distinguishes between enharmonic pitches: both \transpose c cis or \transpose c des will transpose up half a tone. The first version will print sharps and the second version will print flats

     mus =\notes { \key d \major cis d fis g }
     \score { \notes \context Staff {
       \clef "F" \mus
       \clef "G"
       \transpose c g' \mus
       \transpose c f' \mus
     }}

[image of music]

See also

Program reference: TransposedMusic, and UntransposableMusic.

Bugs

If you want to use both \transpose and \relative, you must put \transpose outside of \relative, since \relative will have no effect music that appears inside a \transpose.

Read comments on this page, or add one.

This page is for LilyPond-2.2.6 (stable-branch).

Report errors to <bug-lilypond@gnu.org>.