lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: with and set


From: David Kastrup
Subject: Re: with and set
Date: Sun, 05 Feb 2017 23:38:44 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Noeck <address@hidden> writes:

> Hi,
>
> I read on the dev list and in the issues [1] that setting some
> properties in the \with block is advisable, instead of setting them
> somewhere in the music. So
> \new Staff \with { instrumentName = "Flute" } { a }
> is better than
> { \set Staff.instrumentName = "Flute" a }
> even though the output is identical.
>
> From a logical point of view I understand that. It is a staff property.
> But I always used \set, because:

[...]

> So my question:
> What is the reason to recommend using \with for such properties?

Because it works?

> What are cases in which that makes a difference? I always thought they
> were equivalent.

Once you take over the job of LilyPond, we might take note that you
consider them equivalent and change the documentation.  In the meantime,
LilyPond's thoughts about the issue are more relevant.

>
> [1]: https://sourceforge.net/p/testlilyissues/issues/5039/

Is it really too much to ask to just follow the reference given as
justification in the issue?

There is the failing example right at the top and the whole
justification below.

Let me just paste the browser page as rendered by Emacs: I am sure you
can do it in some other way you like better, but it helps for putting
the text into the discussion.  I'll let its signature end this mail as
well.

Re: grace note suppresses instrument name!

--------------------------------------------------------------------------------

 From:   David Kastrup  
 Subject:   Re: grace note suppresses instrument name!  
 Date:   Sun, 22 Jan 2017 12:27:09 +0100  
 User-agent:   Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)  
--------------------------------------------------------------------------------
Richard Shann <address@hidden> writes:

> 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?

No.

> 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?

It doesn't fail.  Due to choosing simultaneous music for setting the
instrument name, the instrument name gets set at time 0.  The grace
note, however, gets typeset at time 0-1/8G (namely an eighth note's
grace time duration before that) and triggers creation of the staff.

This can be viewed as related to the _expectations_ of issue 34 in the
issue tracker.

But stuff like instrument names actually is a static property of the
staff.  You really, really should set it like

\new Staff \with { instrumentName = "Treble Recorder" }
{
  \grace f'8
  g'4 g'
}

At some point of time, a fix to issue 34 might change the behavior in
situations like this.  But I don't feel that such a fix would
unambiguously address your failed expectations here: in some respect the
behavior is actually correct and might be retained in this situation in
spite of an issue 34 fix.

-- 
David Kastrup



reply via email to

[Prev in Thread] Current Thread [Next in Thread]