Hi all,
When engraving music where an instrument comes in later in the piece, I
normally prefer to remove its empty staves using RemoveAllEmptyStaves within
the Staff context. When doing so, the instrument name is not printed when the
staff becomes visible later in the piece.
Is there a way to (i) give the entire staff a new indent similar to the indent
at the start of the piece (to accommodate space for the instrument name) and
(ii) print the instrument name on the staff when it first becomes visible?
I am aware that I could use shortInstrumentName to print the instrument name on
all staffs, but I am only interested in printing the instrument name only on
the first staff of an instrument when it first becomes visible in the piece.
See below MWE showing that although the instrument name is given, it is not
printed on a staff whose start was removed with RemoveAllEmptyStaves
Please also note that I have asked this question on music StackExchange
https://music.stackexchange.com/questions/142858/print-instrument-name-of-staff-whose-empty-section-from-the-start-was-removed-wi.
\version "2.24.4"
soloVoice = {\repeat unfold 20 d1}
instrumentVoice = {R1*10 \break \repeat unfold 10 d1}
\score {
<<
\new Staff
\with {
instrumentName = "Soloist"
}
<<
\soloVoice
>>
\new Staff
\with {
instrumentName = "Instrument"
}
<<
\instrumentVoice
>>
>>
\layout {
\context {
\Staff \RemoveAllEmptyStaves
}
}
}
[enter image description here]<https://i.sstatic.net/3GNJMful.png>