bug-lilypond
[Top][All Lists]
Advanced

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

Re: Can't use \clef inside NoteNames and similar contexts


From: Reinhold Kainhofer
Subject: Re: Can't use \clef inside NoteNames and similar contexts
Date: Thu, 23 Dec 2010 20:49:55 +0100
User-agent: KMail/1.13.5 (Linux/2.6.35-22-generic; KDE/4.5.3; i686; ; )

Am Donnerstag, 23. Dezember 2010, um 20:25:09 schrieb Reinhold Kainhofer:
> In particular, the problem appears not only with NoteNames, but with any
> other context that is used without a surrounding staff, i.e. FiguredBass,
> ChordNames, etc. The offending code can be found in line 138 of
> scm/parser- clef.scm (function make-clef-set):
> 
>         (context-spec-music seq 'Staff))
> 
> If you use \clef inside a music expression that is not surrounded by a
> staff, lilypond tries to fine the surrounding staff. As that fails,
> apparently, it simply picks up the first Staff context it finds...


Actually, it's even worse: It's not really a bug in the \clef function, but a 
much more general problem with \set and \override!

In particular, if you use \override Staff..... inside a context that does not 
have a Staff parent (like NoteNames, FiguredBass, etc.), then that \override 
will always be applied to the very first staff of the score!

Simple example for this behavior is attached.


Analyzed in more detail: If you set a property for a context that is not a 
parent of the current context, then lilypond will use the first context of 
that name that it finds anywhere in the score and apply the settings there!

The attached example also contains a second example showing this behavior: In 
the voice of the first staff, I set FiguredBass.BassFigure #'color. As 
FiguredBass is no parent of that voice, lilypond searches for a FiguredBass 
context anywhere in the score and applies the setting to the only FiguredBass 
context it finds in the score (although that setting should never have any 
effect on parallel contexts, only on parents or children!).


And a third example of this bug is also contained in the example: If you use 
\set PianoStaff.ShortInstrumentName ... in a normal staff (not inside a 
PianoStaff), the instrument name of an independen PianoStaff will be changed 
instead!

Cheers,
Reinhold

-- 
------------------------------------------------------------------
Reinhold Kainhofer, address@hidden, http://reinhold.kainhofer.com/
 * Financial & Actuarial Math., Vienna Univ. of Technology, Austria
 * http://www.fam.tuwien.ac.at/, DVR: 0005886
 * LilyPond, Music typesetting, http://www.lilypond.org

Attachment: set.ly
Description: Text Data


reply via email to

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