bug-lilypond
[Top][All Lists]
Advanced

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

Re: The exact semantics of the new \new command?


From: Graham Percival
Subject: Re: The exact semantics of the new \new command?
Date: Sun, 23 Apr 2006 03:23:07 -0700


On 23-Apr-06, at 2:50 AM, Mats Bengtsson wrote:

What, exactly, is the semantics of the \new <context> = <name> ...
syntax? As far as I understood the discussion leading to this
syntax, it should be equivalent to
\context <context> = <name>
if that context wasn't already created and it should
issue a warning if the context already existed.

IIRC, it was decided that no warning would be issued. This was to make the implementation easier; I believe that there was some mention of upcoming 3.0 syntax changes that would change \new and \context further, and thus it didn't make sense to spend a lot of effort on it right now.

As the following example shows (and the last example in
"More Stanzas", for example), what really happens is equivalent
to \new <context>, i.e. you get a new instance of the context
with some anonymous name. Also, no warning is issued.

\version "2.8.0"

\relative <<
 \new Staff = FIRST \new Voice { c1^"in FIRST" }
  % Should at least issue a warning:
 \new Staff = FIRST \new Voice { e1 e^"2nd incarnation of FIRST" }
 % Which of the above two will this one end up in?:
 \context Staff = FIRST \new Voice { g1 g g^"back in FIRST" }
>>

Disregarding the warning issue (in HWN's words, "Don't Do That"), this example works (if you rename the second FIRST to SECOND).

It seems that whoever updated the examples such as the
last example in "More Stanzas" rather had the impression
that
\new <context> = <name> ...
will always be equivalent to
\context <context> = <name> ...
which clearly isn't the case, so this is a problem both
in the implementation and the documentation and example
files.

I didn't think that \new was the same as \context, but I also don't claim to fully understand this issue. As far as I know, right now \new works well other than not giving warnings.

The issue with "More Stanzas" is that I was updating the docs during a music theory lecture, and (as always) I don't really know what I'm doing with vocal music. The two
\new Lyrics = "mainlyrics"
are obviously a mistake. I've changed the second one to \context, and it looks right to me.

Cheers,
- Graham





reply via email to

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