2017-01-22 11:40 GMT+01:00 Richard Shann <rich...@rshann.plus.com>:
> Consider:
>
> \version "2.19.43"
>         \new Staff
>             <<
>                 \set Staff.instrumentName = \markup "Treble Recorder"
>                  {
>                    \grace f'8
>                    g'4  g'
>                 }
>             >>
>
> with the grace note the instrument name is not printed, without it, it
> is. Should the syntax used here work? I realize that by replacing << >>
> with {} it works, but is there a good reason why this <<>> syntax
> suddenly fails when a grace note starts the music?
>
> Richard



Hi Richard,

the << ... >> initializes simultaneous music.

So the first expression is: \set Staff.instrumentName = ...
The second: { \grace f'8 ... }

Maybe you see it already: it's issue 34, grace-synchronization.
And indeed the following works:
\new Staff
  <<
      { \set Staff.instrumentName = \markup "Treble Recorder" \grace s8 }
      { \grace f'8 g'4  g' }
  >>

Ofcourse nobody wants this sort of code.

Best you can do is setting the instrumentName in \with {}:
\new Staff
  \with { instrumentName = \markup "Treble Recorder" }
  { \grace f'8 g'4  g' }

Personally, I think we should change the docs to always show \with {
instrumentName = ... }.
A snippet showing a reasonable use-case for \set Staff.instrumentName
= ... could be added, although I can't think of such reasonable
use-case. Sometimes it makes sense to change th shortInstrumentName
with this command, though.

Cheers,
  Harm

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to