Node: Default contexts, Next: , Previous: Creating contexts, Up: Interpretation context



Default contexts

Every top level music is interpreted by the Score context; in other words, you may think of \score working like

     \score {
       \context Score music
     }
     

Music expressions inherit their context from the enclosing music expression. Hence, it is not necessary to explicitly specify \context for most expressions. In the following example, only the sequential expression has an explicit context. The notes contained therein inherit the goUp context from the enclosing music expression.

       \notes \context Voice = goUp { c'4 d' e' }
     

[picture of music]

Second, contexts are created automatically to be able to interpret the music expressions. Consider the following example:

       \score { \notes { c'4-( d' e'-) } }
     

[picture of music]

The sequential music is interpreted by the Score context initially, but when a note is encountered, contexts are setup to accept that note. In this case, a Thread, Voice, and Staff context are created. The rest of the sequential music is also interpreted with the same Thread, Voice, and Staff context, putting the notes on the same staff, in the same voice.


This page is for LilyPond-2.0.1 (stable-branch).

Report errors to <bug-lilypond@gnu.org>.