Node:Setting variables, Next:, Previous:Piano staves, Up:Tutorial



Setting variables

When the music is converted from notes to print, it is interpreted from left-to-right order, similar to what happens when we read music. During this step, context-sensitive information, such as the accidentals to print, and where barlines must be placed, are stored in variables. These variables are called context properties. The properties can also be manipulated from input files. Consider this input:

     \property Staff.autoBeaming = ##f
     

It sets the property named autoBeaming in the current staff at this point in the music to ##f, which means `false'. This property controls whether beams are printed automatically:

       c8 c c c
       \property Staff.autoBeaming = ##f
       c8 c c c
     

[picture of music]

LilyPond includes a built-in programming language, namely, a dialect of Scheme. The argument to \property, ##f, is an expression in that language. The first hash-mark signals that a piece of Scheme code follows. The second hash character is part of the boolean value true (#t). Values of other types may be entered as follows:

There are many different properties, and not all of them are listed in this manual. However, the program reference lists them all in the section Context-properties, and most properties are demonstrated in one of the tips-and-tricks examples.


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

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