I've written a score for a short piece for violin and cello in Lilypond.
\version "2.20"
\header {
title = "Transpose Example"
}
main = {
\key g \major
\numericTimeSignature \time 3/4
\clef "treble"
\tempo 4 = 84
\relative g' {
% motif primary sequence
g8\mf d'8 b8 d4 b8 | d8~ d16 b16 g16 r16 g16 a16~ a4 |
g8 d'8 b8 d4 b8 | d16 c16 b16 r16 g8 b4~ b8 |
\bar "||"
}
}
cello = {
\key g \major
\clef "bass"
\relative g' {
R2.*4
}
}
\score {
\new StaffGroup = "StaffGroup" <<
\context Staff = "clarinet" \with { instrumentName = "Violin" }<<
\main
\set Staff.midiInstrument = "violin"
>>
\context Staff = "cello" \with { instrumentName = "Cello" } <<
\cello
\set Staff.midiInstrument = "cello"
>>
>>
\layout { }
\midi { }
}
But I now want to set the Violin staff for a B-flat clarinet (which is a transposing instrument). Is there any easy way to have Lilypond produce the B-flat Clarinet staff when the notes are written in the target sound (concert pitch)?
The \transposition pitch
command seems to be for when you have written for the instrument and you want the midi output to be correct.