X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Documentation%2Fuser%2Ftutorial.itely;h=c0f622f7897c50bce49b446a8009d6a06b470c21;hb=f9214bac21e9926dc3248416f58190c98c4167a9;hp=ffefa1c43b7209c673d32eab96383d1d6728d6c0;hpb=8f5514f91a6d721dcacd9f868bd704b738798dc5;p=lilypond.git diff --git a/Documentation/user/tutorial.itely b/Documentation/user/tutorial.itely index ffefa1c43b..c0f622f789 100644 --- a/Documentation/user/tutorial.itely +++ b/Documentation/user/tutorial.itely @@ -48,12 +48,14 @@ picture in the HTML version of this manual, you will see the exact LilyPond input that was used to generate that image. Try it on this image -@lilypond[fragment,quote,ragged-right,relative=2] -c-\markup { \bold \huge { Click here. } } +@c no verbatim here +@lilypond[quote,ragged-right] +\relative c'' { + c-\markup { \bold \huge { Click here. } } +} @end lilypond -By cutting and pasting everything from the @qq{Start cut-&-pastable-section} -to the end of the file, you have a +By cutting and pasting everything in the @qq{ly snippet} section, you have a starting template for experiments. If you like learning in this way, you will probably want to print out or bookmark the @ref{Cheat sheet}, which is a table listing of the most common @@ -98,6 +100,7 @@ notation. For example, if we write @noindent the result looks like this +@c in this case we don't want verbatim @lilypond[quote,ragged-right] { c' e' g' e' @@ -105,7 +108,7 @@ the result looks like this @end lilypond @strong{Warning:} Every piece of LilyPond input needs to have @strong{@{ curly -braces @}} placed around the input. The braces should be also be +braces @}} placed around the input. The braces should also be surrounded by a space unless they are at the beginning or end of a line to avoid ambiguities. These may be omitted in some examples in this manual, but don't forget them in your own music! @@ -198,7 +201,7 @@ Converting to `test.pdf'... @noindent The result is the file @file{test.pdf} which you can print or view with the standard facilities of your operating system.@footnote{If -your system does not have any tools installed, you can try +your system does not have any such tools installed, you can try @uref{http://@/www@/.cs@/.wisc@/.edu/@/~ghost/,Ghostscript}, a freely available package for viewing and printing PDF and PostScript files.} @@ -689,9 +692,8 @@ see @ref{Phrasing slurs}. @cindex staccato @subheading Articulations -@c FIXME: change to @rglos once the term is added (articulations) -Common articulations can be added to a note using a dash (@samp{-}) and a -single character: +Common @rglos{articulations} can be added to a note using a dash @samp{-} +and a single character: @lilypond[quote,ragged-right,verbatim,fragment,relative=2] c-. c-- c-> c-^ c-+ c-_ @@ -786,10 +788,9 @@ see @ref{Manual beams}. @cindex partial measure @subheading Partial measure -@c FIXME: glossary "anacrusis". -A pickup (or @q{anacrusis}) is entered with the keyword @code{\partial}. It -is followed by a duration: @code{\partial 4} is a quarter note pickup -and @code{\partial 8} an eighth note. +A pickup (or @rglos{anacrusis}) is entered with the keyword +@code{\partial}. It is followed by a duration: @code{\partial 4} is +a quarter note pickup and @code{\partial 8} an eighth note. @lilypond[quote,ragged-right,verbatim,fragment,relative=2] \partial 8 @@ -1175,10 +1176,6 @@ line}. It is entered as two underscores @code{__}: Similarly, hyphens between words can be entered as two dashes, resulting in a centered hyphen between two syllables -@example -A -- le gri -- a -@end example - @c no ragged-right here because otherwise the hypens get lost. @lilypond[quote,verbatim] << @@ -1186,7 +1183,7 @@ A -- le gri -- a \time 2/4 f4 f c c } - \addlyrics { A -- le gri -- a } + \addlyrics { A -- le -- gri -- a } >> @end lilypond @@ -1266,6 +1263,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 +1386,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