lilypond-user
[Top][All Lists]
Advanced

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

Re: RemoveEmptyStaffContext erases previous setting


From: Mats Bengtsson
Subject: Re: RemoveEmptyStaffContext erases previous setting
Date: Fri, 05 Feb 2010 18:20:23 +0100
User-agent: Internet Messaging Program (IMP) H3 (4.0.5)

Quoting Neil Thornock <address@hidden>:

My understanding is that LilyPond can only take one \layout block -
no?  So any subsequent layout block will override the previous one.

No! You can have several layout blocks and the accumulated result of
all settings is used.

I don't think it's buggy at all.  You just need separate layout blocks
for different components of your project.  I always have one for
scores and a different one for parts.

Seems like a bad idea if large parts of the settings are the same for
both scores and parts.

The problem that Reinhold mentions is well-known and is documented in
http://lilypond.org/doc/v2.12/Documentation/user/lilypond/Changing-context-default-settings#Changing-context-default-settings

The simple solution is to change the order, so that you do \layout {
 \context { \RemoveEmptyStaffContext }
}

before any other

\layout {
 \context { \Staff
   ...
 }
}

To understand why this happens, you have to know that

\layout {
 \context { \Staff
  ...
means that the current settings for the Staff context are used as a
starting point and all following lines are additions to these settings.
When the closing } appears, the resulting list of settings is saved as
the new settings for the Staff context.

On the other hand, \RemoveEmptyStaffContext is a variable containing a
full list of settings, which replace the current list of settings for a
Staff context.

A pedagogical problem is that the syntax looks the same in both cases,
but what really happens is fundamentally different. Apart from the
warning in the manual, mentioned above, the only way to know if
\layout{
 \SomeName
 ...

will do one or the other, is to look in the file
.../ly/engraver-init.ly and see if \SomeName is defined as a variable
or if it's the name of a context.


Section 5.1 Interpretation Contexts, in the Notation Reference, will
hopefully provide enough details to understand what I just wrote.


If would be pedagogically simpler to realize this difference if the
syntax was separate if you define a context from scratch (as is the
case with \RemoveEmptyStaffContext) or if it's defined by adding onto
an existing context. For example, a syntax like

\context{
 % Copy the current settings of the Staff context:
 \use Staff
 % do whatever additional settings
}

could be used to distinguish from

\context{
 % Take settings from a variable:
 \Variable
 % do whatever additional settings
}

and

\context{
 % Start from scratch:
 \type ...
 \name ...
 \consists ...
 ...
}


 /Mats


On Fri, Feb 5, 2010 at 8:14 AM, Reinhold Kainhofer
<address@hidden> wrote:
I found out the hard way that apparently adding \RemoveEmptyStaffContext
globally to a score will erase some previous settings. In particular, if you
have:

\layout {
 \context { \Staff
   ignoreFiguredBassRest = ##f
 }
}

\layout {
 \context { \RemoveEmptyStaffContext }
}

then the score will still use ignoreFiguredBassRest=##t (which is the
default). If you don't add the RemoveEmptyStaffContext, then ##f is used.

Attached is an example file displaying this behavior.

Is this a bug? In my eyes, it is quite severe, because it means you can't
trust  lilypond any more. If you check e.g. the individual parts
(which do not
add the RemoveEmptyStaffContext) for errors, you cannot be sure any
more that
the full score or e.g. the  choral score are correct, too!

Cheers,
Reinhold

PS: What is the reason anyway to have
 ignoreFiguredBassRest = ##t
for the Staff context? Bass figures on rests ARE used and have a
well-defined
meaning (namely that they take the next bass note as reference, but play the
harmony on the rest already). It seems that Han-Wen added this
feature a while
ago and set the default to ##t, but didn't really give any good reason to
silently discart bass figures on rests...
So, are there any reasons against making ##f the default (i.e. NOT silently
discarding vital bass figures)???

--
------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
email: address@hidden, http://reinhold.kainhofer.com/
 * Financial and Actuarial Mathematics, TU Wien,
http://www.fam.tuwien.ac.at/
 * Edition Kainhofer Music Publishing, http://www.edition-kainhofer.com/
 * LilyPond music typesetting software, http://www.lilypond.org/

_______________________________________________
lilypond-user mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/lilypond-user





--
Neil Thornock, D.M.
Check out the newly designed website!
http://neilthornock.net
Assistant Professor of Music
Composition/Theory
Brigham Young University


_______________________________________________
lilypond-user mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/lilypond-user








reply via email to

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