[icon]

GNU LilyPond

-- --

What is LilyPond
Home
Examples
Templates
Download
GNU/Linux binaries
Windows binaries
Source code
Documentation
Tutorial
Manual
Glossary
Index

Support
Mailing lists
Search
WikiWiki

External sites
lilypond.org/stable
lilypond.org/development
savannah.gnu.org
ftp.lilypond.org
Mutopia
Other music online

Creating contexts

Contexts for a music expression can be selected manually, using the following music expression.

     \context contexttype [= contextname] musicexpr
     

This instructs lilypond to interpret musicexpr within the context of type contexttype and with name contextname. If this context does not exist, it will be created.

     \score {
       \notes \relative c'' {
         c4 <d4 \context Staff = "another" e4> f
       }
     }
     
[picture of music]

In this example, the c and d are printed on the default staff. For the e, a context Staff called another is specified; since that does not exist, a new context is created. Within another, a (default) Voice context is created for the e4. When all music referring to a context is finished, the context is ended as well. So after the third quarter, another is removed.

Go back to index of LilyPond.

Please send GNU LilyPond questions and comments to lilypond-user@gnu.org.

Please send comments on these web pages to (address unknown)

Copyright (c) 1997--2002 Han-Wen Nienhuys and Jan Nieuwenhuizen.

Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.


This page was built from LilyPond-1.7.14 (development-branch) by

Buchan Milne <(address unknown)>, Thu Mar 6 21:11:35 2003 CET.