lilypond-user
[Top][All Lists]
Advanced

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

Re: Expert question on named contexts


From: Mats Bengtsson
Subject: Re: Expert question on named contexts
Date: Sat, 09 Aug 2008 12:37:13 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20061113 Debian/1.7.8-1sarge8

Han-Wen Nienhuys wrote:

On Wed, Aug 6, 2008 at 9:11 AM, Mats Bengtsson <address@hidden> wrote:

\relative c' <<
\new Staff \new Voice = myvoice { c d e f }
\new Staff \context Voice = myvoice { g f e d }

both contexts get the same name.  If you want to refer to either of
them, you need to name the staves too,


\relative c' <<
\new Staff = "A" \new Voice = myvoice { c d e f }
\new Staff = "B" \context Voice = myvoice { g f e d }

so you can do \context Staff = A \context Voice = myvoice { .. }

to send something the 1st voice.
Thanks for the explanation. The next question is if both these
Voice contexts can be refered to using \lyricsto, since the
Lyrics context isn't part of any Staff context.

In the following example, I tried to put them into separate
ChoirStaff contexts, hoping that the search for the Voice
first is done locally in the context hierarchy, but it seems
that both \lyricsto find the same Voice context.

\score{
\relative c' <<
 \new ChoirStaff<<
   \new Staff \new Voice = myvoice { c1 | d2 e | f1 }
   \new Lyrics \lyricsto myvoice { What hap -- pens here? }
 >>
 \new ChoirStaff<<
   \new Staff \new Voice = myvoice { c2 d | e1 | f1 }
   \new Lyrics \lyricsto myvoice { What hap -- pens here? }
 >>
>>
}


Apparently, LilyPond lets the latter requirement override the former one.
However, what happens to the context names? Is the Voice context in the
lower
stave given some random unknown name or do both have the same name but are
kept separate because of the context hierarchy. In the latter case, is it
even possible
to refer to the Voice context of the lower stave using the name "myvoice",
under
some circumstance?

Perhaps we should have a nice scheme hack that will print out the
context hierarchy at any point.


That would be great!

   /Mats




reply via email to

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