From: Graham Percival Date: Sun, 25 Nov 2007 01:20:33 +0000 (-0800) Subject: Small update to tutorial. X-Git-Tag: release/2.11.36-1~83 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=498805dc8fdddb5b321a0dcf404a068b58cdae74;p=lilypond.git Small update to tutorial. --- diff --git a/Documentation/user/tutorial.itely b/Documentation/user/tutorial.itely index 5769244075..8b377a34e2 100644 --- a/Documentation/user/tutorial.itely +++ b/Documentation/user/tutorial.itely @@ -1584,8 +1584,6 @@ namedMusic = @{ @dots{} @} 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). -Variables must be defined @emph{before} the main music -expression. @lilypond[verbatim,quote,ragged-right] violin = \new Staff { \relative c'' { @@ -1607,7 +1605,22 @@ cello = \new Staff { \relative c { The name of a variable must have alphabetic characters only, no numbers, underscores, or dashes. -It is possible to use variables for many other types of objects in +Variables must be defined @emph{before} the main music +expression, but may be used as many times as required anywhere after +they have been defined. They may even be used in a later definition +of another variable, giving a way of shortening the input if a +section of music is repeated many times. + +@lilypond[verbatim,quote,ragged-right] +tripletA = \times 2/3 { c,8 e g } +barA = { \tripletA \tripletA \tripletA \tripletA } + +\relative c'' { + \barA \barA +} +@end lilypond + +Variables may be used for many other types of objects in the input. For example, @example