From: Graham Percival Date: Sun, 21 Jan 2007 05:29:37 +0000 (-0800) Subject: Oops; the previous update wasn't final. This one should be. :) X-Git-Tag: release/2.11.13-1~13^2~1 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=24a22b6937e74c52e14849225e53bf3160b9218a;p=lilypond.git Oops; the previous update wasn't final. This one should be. :) --- diff --git a/Documentation/user/putting.itely b/Documentation/user/putting.itely index de163bfdb2..1dd8222330 100644 --- a/Documentation/user/putting.itely +++ b/Documentation/user/putting.itely @@ -18,7 +18,6 @@ create @code{\score} blocks. * Extending the templates:: * How LilyPond files work:: * Score is a single musical expression:: -* Organizing larger pieces:: * An orchestral part:: @end menu @@ -463,62 +462,6 @@ text editor! -@node Organizing larger pieces -@section Organizing larger pieces - -When all of the elements discussed earlier are combined to produce -larger files, the @code{\score} blocks get a lot bigger because the -music expressions are longer, and, in the case of polyphonic music, -more deeply nested. Such large expressions can become unwieldy. - -By using variables, also known as identifiers, it is possible to break -up complex music expressions. An identifier is assigned as follows - -@example -namedMusic = @{ @dots{} @} -@end example - -@noindent -The contents of the music expression @code{namedMusic}, can be used -later by preceding the name with a backslash, i.e., @code{\namedMusic}. -In the next example, a two-note motive is repeated two times by using -variable substitution - -@lilypond[quote,ragged-right,verbatim,nofragment] -seufzer = { - e'4( dis'4) -} -{ \seufzer \seufzer } -@end lilypond - -The name of an identifier should have alphabetic characters only: no -numbers, underscores, or dashes. The assignment should be outside of -running music. - -It is possible to use variables for many other types of objects in the -input. For example, - -@example -width = 4.5\cm -name = "Wendy" -aFivePaper = \paper @{ paperheight = 21.0 \cm @} -@end example - -Depending on its contents, the identifier can be used in different -places. The following example uses the above variables - -@example -\paper @{ - \aFivePaper - line-width = \width -@} -@{ c4^\name @} -@end example - -More information on the possible uses of identifiers is given in the -technical manual, in @ref{Input variables and Scheme}. -@c fixme: the ref is too technical. - @node An orchestral part @section An orchestral part diff --git a/Documentation/user/tutorial.itely b/Documentation/user/tutorial.itely index ffefa1c43b..566a5db8d7 100644 --- a/Documentation/user/tutorial.itely +++ b/Documentation/user/tutorial.itely @@ -1266,6 +1266,7 @@ of the manual. * Version number:: * Adding titles:: * Absolute note names:: +* Organizing pieces with identifiers:: * After the tutorial:: * How to read the manual:: @end menu @@ -1388,6 +1389,67 @@ However, absolute mode is useful for music which has large intervals, and is extremely useful for computer-generated LilyPond files. +@node Organizing pieces with identifiers +@subsection Organizing pieces with identifiers + +When all of the elements discussed earlier are combined to produce +larger files, the music expressions get a lot bigger. In polyphonic +music with many staves, the input files can become very confusing. We can +reduce this confusion by using @emph{identifiers}. + +Identifiers (also known as variables or macros), we can break up +complex music expressions. An identifier is assigned as follows + +@example +namedMusic = @{ @dots{} @} +@end example + +The contents of the music expression @code{namedMusic} can be used +later by placing a backslash in front of the name +(@code{\namedMusic}, just like a normal LilyPond command). Identifiers +must be defined @emph{before} the main music expression. + +@lilypond[quote,verbatim,ragged-right] +violin = \new Staff { \relative c'' { + a4 b c b +}} +cello = \new Staff { \relative c { + \clef bass + e2 d +}} +{ + << + \violin + \cello + >> +} +@end lilypond + +@noindent +The name of an identifier should have alphabetic characters only: no +numbers, underscores, or dashes. + +It is possible to use variables for many other types of objects in the +input. For example, + +@example +width = 4.5\cm +name = "Wendy" +aFivePaper = \paper @{ paperheight = 21.0 \cm @} +@end example + +Depending on its contents, the identifier can be used in different +places. The following example uses the above variables: + +@example +\paper @{ + \aFivePaper + line-width = \width +@} +@{ c4^\name @} +@end example + + @node After the tutorial @subsection After the tutorial