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: Mon, 02 Jun 2008 12:30:13 +0200
User-agent: Thunderbird 2.0.0.5 (X11/20070716)



James E. Bailey wrote:

Am 02.06.2008 um 09:57 schrieb Valentin Villenave:

2008/6/1 James E. Bailey <address@hidden>:

How coincidental. I've been wondering myself about the difference between \new and \context. I kinda just use them interchangably and see if anything
new happens.

The only difference AFAIK is that \context allows you to tap into an
existing context:

\new Staff = "coolStaff" " { (your music here) }

and then later:

\context Staff = "coolStaff" % look! the same context!
                                  { (your other music here) }


Cheers,
Valentin


But couldn't you do that with coolStaff = { (my music here) }

\context Staff = \coolStaff

?
No, the point is that you can add contents to an existing context "afterwards". A classical example is shown in the first SATB template in http://lilypond.org/doc/v2.11/Documentation/user/lilypond-learning/Vocal-ensembles#Vocal-ensembles where you first create an empty Lyrics context and call in sopranos, in order to place it above the staff and then fill it with its contents some lines later in the \score block, in order to be able to use \lyricsto. (In this particular example, there's now an alternative solution using aligned contexts, but before that property was introduced, the only possibility was to use \context = "alreadydefinedcontext").

Also, your code isn't syntactically correct. Did you mean
\context Staff \coolStaff ?

  /Mats

   /Mats




reply via email to

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