[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Issue 1322 in lilypond: \context must die (whenever \new can be used ins
From: |
lilypond |
Subject: |
Issue 1322 in lilypond: \context must die (whenever \new can be used instead) |
Date: |
Tue, 12 Oct 2010 23:17:05 +0000 |
Status: Accepted
Owner: ----
Labels: Type-Documentation Priority-Medium Syntax
New issue 1322 by v.villenave: \context must die (whenever \new can be used
instead)
http://code.google.com/p/lilypond/issues/detail?id=1322
There really are only two cases where \context is acceptable:
- when introducing a block inside \layout { ... }
- when referring to an existing, /explicitely named/ context.
The first case is off the table.
The second possibility, of course, is much less frequent/useful/used at
all. Truth is, most of the time people use \context instead of \new without
any good reason whatsoever, which leads to syntax inconsistencies.
The documentation isn't entirely clear either: for instance, NR
5.1.2 "Creating contexts" has the following example
<<
\new Staff \context Voice = "A" \music
\context Voice = "A" \arts
where \new would be more appropriate when creating the Voice:
<<
\new Staff \new Voice = "A" \music
\context Voice = "A" \arts
Another example: NR 1.1.3.5 Automatic accidentals uses the following
example:
\new PianoStaff {
<<
\context Staff = "up" {
#(set-accidental-style 'default)
\musicA
}
\context Staff = "down" {
#(set-accidental-style 'default)
\musicB
}
>>
It's also used a lot in LM snippets (templates, etc.).
---
It's not uncommon that users (particularly new users, or users who have
been using older versions in the past, when the syntax was different)
encounter problems (and ask for help) just because of that. So we
definitely need to:
- discourage this syntax (unless specifically needed, which is quite
advanced and pretty rare -- in fact, I've yet to see a case where it
actually is)
- clean up the docs/regtests (and possibly snippets), just like we did
with \new Score.
- I even wonder if a warning could be issued by convert-ly when it
encounters \context outside of a \layout block?
- Issue 1322 in lilypond: \context must die (whenever \new can be used instead),
lilypond <=
- Re: Issue 1322 in lilypond: \context must die (whenever \new can be used instead), lilypond, 2010/10/12
- Re: Issue 1322 in lilypond: \context must die (whenever \new can be used instead), lilypond, 2010/10/12
- Re: Issue 1322 in lilypond: \context must die (whenever \new can be used instead), lilypond, 2010/10/12
- Re: Issue 1322 in lilypond: \context must die (whenever \new can be used instead), lilypond, 2010/10/12
- Re: Issue 1322 in lilypond: \context must die (whenever \new can be used instead), lilypond, 2010/10/12
- Re: Issue 1322 in lilypond: \context must die (whenever \new can be used instead), lilypond, 2010/10/13
- Re: Issue 1322 in lilypond: \context must die (whenever \new can be used instead), lilypond, 2010/10/13
- Re: Issue 1322 in lilypond: \context must die (whenever \new can be used instead), lilypond, 2010/10/13
- Re: Issue 1322 in lilypond: \context must die (whenever \new can be used instead), lilypond, 2010/10/13