lilypond-devel
[Top][All Lists]
Advanced

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

Re: Question about '\new Staff =' command


From: Simon Albrecht
Subject: Re: Question about '\new Staff =' command
Date: Thu, 2 Feb 2017 21:50:30 +0100

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



reply via email to

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