lilypond-user
[Top][All Lists]
Advanced

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

Re: Context creation


From: Mats Bengtsson
Subject: Re: Context creation
Date: Wed, 04 Jun 2008 13:37:07 +0200
User-agent: Thunderbird 2.0.0.5 (X11/20070716)

How about the following example of how to get an ossia stave for alternative versions of the music. The method described in the manual is somewhat clumsy since you have to count the number of bars to know what \skip commands to insert between each ossia. Here, you can enter the two
versions of the music together.

\version "2.10"
\relative c' <<
 \new Staff = ossia \with
 {
   %No time signature in the ossia staff
   \remove "Time_signature_engraver"
   fontSize = #-3
   \override StaffSymbol #'staff-space = #(magstep -3)
   \override StaffSymbol #'thickness = # (magstep -3)
   firstClef = ##f
 }  {\stopStaff s1*4} % Keep the context alive during the full score
 \new Staff {
 c4 d e f |
 << { g a b c }
    \context Staff = ossia {\startStaff g8 f g a b a b c \stopStaff } >> |
 b4 a g f |
 << { e4 d c2 }
    \context Staff = ossia {\startStaff e8 f e d c2 \stopStaff } >> |
 }
>>


Another fine detail about the difference between \new and \context is that if you do
<<
\new Staff = one { c d e f }
\new Staff = one { g f e d }
>>
then LilyPond will take the word "new" more seriously than the "= one", i.e. even though you specify the same name to both staves, you will get a new copy since you used \new and not
\context on the second line.

   /Mats

Jesse Engle wrote:
Coffer,

Thanks for the good example, though are there any other uses for
reusing existing contexts other than setting lyrics?

- Jesse

On 6/3/08, coffer <address@hidden> wrote:
Kieren MacMillan wrote:
Hi Jesse,

If \context allegedly allows one to add notes to an existing context,
why does the following example not do so?

\version "2.10.33"

\new Staff = "mycontext" \relative c' { c4 d e f g2. }

\context Staff = "mycontext" \relative c' { g'4 g f e d c1 }
Because you have asked (implicitly) for two different Staff
contexts.  =)

What you want is to force the two musics to be *consecutive* rather
than *concurrent*:

{ \new Staff = "mycontext" \relative c' { c4 d e f g2. } \context
Staff = "mycontext" \relative c' { g'4 g f e d c1 } }

Hope this helps!
Kieren.


_______________________________________________
lilypond-user mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/lilypond-user


It was helpful for me to understand the example from

http://lilypond.org/doc/v2.11/Documentation/user/lilypond/Divisi-lyrics#Divisi-lyrics

\score{ <<
       \new Voice = "melody" \relative c' {
         c2 e | g e | c1 |
         \new Voice = "verse" \repeat volta 2 {c4 d e f | g1 | }
         a2 b | c1}
       \new Lyrics = "mainlyrics" \lyricsto melody \lyricmode {
         do mi sol mi do
         la si do }
       \context Lyrics = "mainlyrics" \lyricsto verse \lyricmode {
        do re mi fa sol }
       \new Lyrics = "repeatlyrics" \lyricsto verse \lyricmode {
        dodo rere mimi fafa solsol }
     >>
     }

In this case the "\context Lyrics" doesn´t start a new line but fit a new
lyrics part in the existing line (stanza). That means "consecutive"
lyrics...

coffer
--
View this message in context:
http://www.nabble.com/Context-creation-tp17588961p17626698.html
Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com.



_______________________________________________
lilypond-user mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/lilypond-user



_______________________________________________
lilypond-user mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/lilypond-user

--
=============================================
        Mats Bengtsson
        Signal Processing
        School of Electrical Engineering
        Royal Institute of Technology (KTH)
        SE-100 44  STOCKHOLM
        Sweden
        Phone: (+46) 8 790 8463                         
       Fax:   (+46) 8 790 7260
        Email: address@hidden
        WWW: http://www.s3.kth.se/~mabe
=============================================





reply via email to

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