On 02.02.2017 21:25, SoundsFromSound wrote:
Urs Liska wrote
You can use the explicit staff name to access the context (or compare to
some arbitrary value), and it's for example used in the \change Staff =
"upper" command.
Can you give an example of a simple score where you create a staff and
access the context explicitly? I am having trouble visualizing what you
mean, but I understand the idea and how powerful it can be when it's used in
practice.
(i.e. \new Staff = 'Example')...then later in the file, access \context
Example and override something.
Well, the most simple and very common use cases are
%%%%%%%%%%%%%%%%%%%
\version "2.19"
\new PianoStaff <<
\new Staff = upper { s1 }
\new Staff = lower \relative { g8 a b c \change Staff = upper
\voiceTwo d e f g }
>>
<<
\new Voice = melody { 4 4 2 }
\new Lyrics \lyricsto melody { text text text }
>>
%%%%%%%%%%%%%%%%%%%
One case involving \context would be
%%%%%%%%%%%%%%%%%%%
\new ChoirStaff <<
\new Lyrics = sopLyrics
\new Staff = sa <<
\new Voice = soprano { \voiceOne 2 4 4 }
\new Voice = alto { \voiceTwo 4 4 2 }
>>
\context Lyrics = sopLyrics \lyricsto soprano { text text text }
\new Lyrics = altoLyrics \lyricsto alto { text text text }
>>
%%%%%%%%%%%%%%%%%%%
because \lyricsto can only be used if the associatedVoice context
already exists.
Best, Simon
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel