@cindex instrument names, changing
@cindex changing instrument names
-The @code{shortInstrumentName} may be changed in the middle of a piece.
+The @code{shortInstrumentName} may be changed in the middle of a piece,
+along with other settings as needed for the new instrument.
However, only the first instance of @code{instrumentName} will be
printed and subsequent changes will be ignored:
-@lilypond[verbatim,quote,ragged-right,relative=1]
-\new Staff \with {
- instrumentName = #"Flute"
- shortInstrumentName = #"Flt."
-}
-{
- c1 c c c \break
- c1 c c c \break
- \set Staff.instrumentName = #"Clarinet"
- \set Staff.shortInstrumentName = #"Clt."
- c1 c c c \break
- c1 c c c \break
+@lilypond[verbatim,quote,ragged-right]
+prepPiccolo = <>^\markup \italic { muta in Piccolo }
+
+setPiccolo = {
+ \set Staff.instrumentName = #"Piccolo"
+ \set Staff.shortInstrumentName = #"Picc."
+ \set Staff.midiInstrument = #"piccolo"
+ <>^\markup \bold { Piccolo }
+ \transposition c''
}
-@end lilypond
-
-@cindex instrument switch
-@cindex switching instruments
-@funindex \addInstrumentDefinition
-@funindex addInstrumentDefinition
-@funindex \instrumentSwitch
-@funindex instrumentSwitch
+prepFlute = <>^\markup \italic { muta in Flauto }
-If an instrument @emph{switch} is needed,
-@code{\addInstrumentDefinition} may be used in combination with
-@code{\instrumentSwitch} to create a detailed list of the
-necessary changes for the switch. The
-@code{\addInstrumentDefinition} command has two arguments: an
-identifying string, and an association list of context properties
-and values to be used for the instrument. It must be placed in
-the toplevel scope. @code{\instrumentSwitch} is used in the music
-expression to declare the instrument switch:
-
-@lilypond[verbatim,quote,ragged-right]
-\addInstrumentDefinition #"contrabassoon"
- #`((instrumentTransposition . ,(ly:make-pitch -1 0 0))
- (shortInstrumentName . "Cbsn.")
- (clefGlyph . "clefs.F")
- (middleCPosition . 6)
- (clefPosition . 2)
- (instrumentCueName . ,(make-bold-markup "cbsn."))
- (midiInstrument . "bassoon"))
+setFlute = {
+ \set Staff.instrumentName = #"Flute"
+ \set Staff.shortInstrumentName = #"Flt."
+ \set Staff.midiInstrument = #"flute"
+ <>^\markup \bold { Flute }
+ \transposition c'
+}
\new Staff \with {
- instrumentName = #"Bassoon"
+ instrumentName = #"Flute"
+ shortInstrumentName = #"Flt."
+ midiInstrument = #"flute"
}
-\relative c' {
- \clef tenor
- \compressFullBarRests
- c2 g'
- R1*16
- \instrumentSwitch "contrabassoon"
- c,,2 g \break
- c,1 ~ | 1
+\relative c'' {
+ g1 g g g \break
+ g1 g \prepPiccolo R R \break
+ \setPiccolo
+ g1 g g g \break
+ g1 g \prepFlute R R \break
+ \setFlute
+ g1 g g g
}
@end lilypond
+
@seealso
Notation Reference:
@ref{paper variables for shifts and indents,,@code{@bs{}paper} variables for shifts and indents},
oboeNotes = \relative c'' {
R1
- \new CueVoice { \set instrumentCueName = "flute" }
+ <>^\markup \tiny { flute }
\cueDuring #"flute" #UP { R1 }
g2 c,
}
}
@end lilypond
-The name of the instrument playing the cue can be printed by setting
-the @code{instrumentCueName} property in a temporary @code{CueVoice}
-context. The placement and style of the @code{instrumentCueName} is
-controlled by the @code{InstrumentSwitch} object, see
-@ref{Instrument names}. If the cue notes require a change in clef,
+Markup can be used to show the name of the quoted instrument.
+If the cue notes require a change in clef,
this can be done manually but the original clef should also be
restored manually at the end of the cue notes.
\clef bass
R1
\clef treble
- \new CueVoice { \set instrumentCueName = "flute" }
+ <>^\markup \tiny { flute }
\cueDuring #"flute" #UP { R1 }
\clef bass
g4. b8 d2
bassoonNotes = \relative c {
\clef bass
R1
- \new CueVoice { \set instrumentCueName = "flute" }
+ <>^\markup { \tiny "flute" }
\cueDuringWithClef #"flute" #UP #"treble" { R1 }
g4. b8 d2
}
@funindex \killCues
@funindex killCues
-@funindex \addInstrumentDefinition
-@funindex addInstrumentDefinition
The @code{\killCues} command removes cue notes from a music
expression, so the same music expression can be used to produce
R1
\tag #'part {
\clef treble
- \new CueVoice { \set instrumentCueName = "flute" }
+ <>^\markup \tiny { flute }
}
\cueDuring #"flute" #UP { R1 }
\tag #'part \clef bass
c4. g8
% position name of cue-ing instrument just before the cue notes,
% and above the staff
- \new CueVoice {
- \override InstrumentSwitch.self-alignment-X = #RIGHT
- \set instrumentCueName = "Flute"
- }
+ <>^\markup { \right-align { \tiny "Flute" } }
\cueDuring "flute" #UP { g4 bes4 }
}
pianoLH = \relative c { c4 <c' e> e, <g c> }
automatically. The example below shows this transposition for a
B-flat clarinet. The notes in this example are low on the staff so
@code{DOWN} is specified in @code{\cueDuring} (so the stems are
-down) and the instrument name is positioned below the staff. Note
-also that the piano right-hand voice is explicitly declared. This
-is because the cue notes in this example begin at the start of the
-first bar and this would otherwise cause the entire piano right-hand
-notes to be placed in a @code{CueVoice} context.
+down) and the instrument name is positioned below the staff.
@lilypond[quote,verbatim]
clarinet = \relative c' {
pianoRH = \relative c'' {
\transposition c'
% position name of cue-ing instrument below the staff
- \new CueVoice {
- \override InstrumentSwitch.self-alignment-X = #RIGHT
- \override InstrumentSwitch.direction = #DOWN
- \set instrumentCueName = "Clar."
- }
+ <>_\markup { \right-align { \tiny "Clar." } }
\cueDuring "clarinet" #DOWN { c4. g8 }
g4 bes4
}
@rlsr{Vocal music}.
Internals Reference:
-@rinternals{InstrumentSwitch},
@rinternals{CueVoice}.
@knownissues