lilypond-user
[Top][All Lists]
Advanced

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

Re: instrument-name-again


From: Mats Bengtsson
Subject: Re: instrument-name-again
Date: Fri, 17 Oct 2003 15:54:46 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312

If you give each staff the same name, you should be able to avoid that:
\context Staff=foo <<
      bar


Hmm, I thought it was necessary to give each staff its own name.  Is
this only if they're in the same context together?  This baffles me
slightly.

In this situation, you wanted to make sure that the property setting
and the actual music belonged to the same Staff context, so if you
had typed

staffA = \context Staff {...}

it would have helped to do replace it by

staffA = \context Staff = nameA {...}

to make sure that you didn't get an additional Staff context when
you did.

staffAnameA = \context Staff = nameA <<
        \property Staff.instrument = "NameA"
        \property Staff.instr = "nA"
        \staffA
     >>

The tricky part here is that if you start a context with a simultaneous
construct (i.e. a <<...>>), then Lilypond will by default create new
contexts for each part of the simultaneous.

Often, you have the opposite problem, namely that you think you create
two different contexts but they actually end up being the same context,
for example in
\context Voice = mymusic { c d e f <<{g g g g}{e e e e}>>, where the upper and lower voices of the simultaneous will belong to the same Voice
construct. Then it helps to say
\context Voice = mymusic { c d e f <<{g g g g}
    \context Voice = lower {e e e e}>>
if you for example want to set different stem directions for the two
voices. Note, though, that the modern way to do this is
\context Voice = mymusic { c d e f <<{g g g g} \\ {e e e e}>>
or
\context Voice = mymusic { c d e f <<{g g g g}\new Voice {e e e e}>>

   /Mats





reply via email to

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