That makes sense. I'll try to stick with the \with notation whenever possible. Thanks for the clear explanation.
On Thu, Nov 18, 2021 at 8:23 PM David Kastrup <d...@gnu.org> wrote: > "Omid Mo'menzadeh" <omid.mnza...@gmail.com> writes: > > > Hello all. > > I think I just described the problem in the title, but it only happens > if I > > have a multi-voice staff, as the following example demonstrates: > > > > %%% > > \version "2.22.1" > > \score { > > \new Staff << > > \set Staff.instrumentName = \markup \bold "Name" > > \context Voice = "voice" \relative c'' { \appoggiatura b16 c1 } > > >> > > } > > %%% > > You start _simultaneous_ music on a new Staff (that's what <<...>> > does). That means that all the parallel music starts on the first beat > with the exception of grace notes. The only grace note is b16, and > LilyPond needs to create the Staff for placing it anywhere. Then, on > the first beat, it typesets both the c1 and executes the \set > Staff.instrumentName command which comes too late to affect the Staff > that already needed to be created for the sake of the appoggiatura. As > Knute stated, for settings supposed to be an unchanging part of some > context, it makes more sense to establish them in a \with block rather > than inside of the context after it has already started. Instrument > names certainly belong in that category. > > -- > David Kastrup >