Re: Instrument name disappears if I start it with a grace note

2021-11-18 Thread Omid Mo'menzadeh
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  wrote:

> "Omid Mo'menzadeh"  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
>


Re: Instrument name disappears if I start it with a grace note

2021-11-18 Thread David Kastrup
"Omid Mo'menzadeh"  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



Re: Instrument name disappears if I start it with a grace note

2021-11-18 Thread Kieren MacMillan
Hi Knute,

>> It's still interesting to see why it happens, and document it if it is the 
>> expected behavior.
> I'm guessing that it has to do with LilyPond's most famous bug, issue #34:
> https://gitlab.com/lilypond/lilypond/-/issues/34

Yep. \with happens before the first actual score moment, which is where the bug 
officially "starts".
There are several Lilypond behaviour issues that I get around by using \with 
(and then \undo, if necessary).

Cheers,
Kieren


Kieren MacMillan, composer (he/him/his)
‣ website: www.kierenmacmillan.info
‣ email: kie...@kierenmacmillan.info




Re: Instrument name disappears if I start it with a grace note

2021-11-18 Thread Knute Snortum
On Thu, Nov 18, 2021 at 8:31 AM Omid Mo'menzadeh  wrote:
>
> Thank you! It does work.
> It's still interesting to see why it happens, and document it if it is the 
> expected behavior.

I'm guessing that it has to do with LilyPond's most famous bug, issue #34:

https://gitlab.com/lilypond/lilypond/-/issues/34

--
Knute Snortum



Re: Instrument name disappears if I start it with a grace note

2021-11-18 Thread Omid Mo'menzadeh
Thank you! It does work.
It's still interesting to see why it happens, and document it if it is the
expected behavior.

On Thu, Nov 18, 2021 at 7:32 PM Knute Snortum  wrote:

> On Thu, Nov 18, 2021 at 7:54 AM Omid Mo'menzadeh 
> wrote:
> >
> > 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 }
> >   >>
> > }
> > %%%
> >
> > The name appears if one removes the beginning appoggiatura. It works
> with grace, slashedGrace, and acciaccatura too.
> > Thanks in advance,
> > Omid Momenzadeh
>
> I don't know why it works, but try this:
>
> %%%
> \version "2.22.1"
> \score {
>   \new Staff \with { instrumentName = \markup \bold "Name" } <<
> \context Voice = "voice" \relative c'' { \appoggiatura b16 c1 }
>   >>
> }
> %%%
>
> --
> Knute Snortum
>


Re: Instrument name disappears if I start it with a grace note

2021-11-18 Thread Knute Snortum
On Thu, Nov 18, 2021 at 7:54 AM Omid Mo'menzadeh  wrote:
>
> 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 }
>   >>
> }
> %%%
>
> The name appears if one removes the beginning appoggiatura. It works with 
> grace, slashedGrace, and acciaccatura too.
> Thanks in advance,
> Omid Momenzadeh

I don't know why it works, but try this:

%%%
\version "2.22.1"
\score {
  \new Staff \with { instrumentName = \markup \bold "Name" } <<
\context Voice = "voice" \relative c'' { \appoggiatura b16 c1 }
  >>
}
%%%

--
Knute Snortum



Instrument name disappears if I start it with a grace note

2021-11-18 Thread Omid Mo'menzadeh
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 }
  >>
}
%%%

The name appears if one removes the beginning appoggiatura. It works with
grace, slashedGrace, and acciaccatura too.
Thanks in advance,
Omid Momenzadeh