X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Documentation%2Fuser%2Ftutorial.itely;h=b0dd10d42d6005a39f6ba31fe22ca70f10c4ecad;hb=b76d0173a49e115b77120d673f5aa6169f4875aa;hp=2160899c590386d964f33e1355e9342019c805bf;hpb=643c1a49be582b0f0959db5904c284e8f1dd2a16;p=lilypond.git diff --git a/Documentation/user/tutorial.itely b/Documentation/user/tutorial.itely index 2160899c59..b0dd10d42d 100644 --- a/Documentation/user/tutorial.itely +++ b/Documentation/user/tutorial.itely @@ -4,13 +4,17 @@ @chapter Tutorial @menu -* Introduction:: Introduction -* Running LilyPond:: Getting started -* The first tune:: The first tune -* Lyrics and chords:: Lyrics and chords -* More movements:: More than one movement in a file -* A piano excerpt:: Piano music -* end of tutorial:: The end +* Introduction:: +* Running LilyPond:: Getting started +* The first tune:: The first tune +* Lyrics and chords:: Lyrics and chords +* More movements :: +* A piano excerpt:: Piano music +* An orchestral score:: +* Part extraction:: +* Latex and texinfo integration:: +* end of tutorial:: The end +* Pre-cooked makefile:: @end menu @node Introduction @@ -157,7 +161,7 @@ settings and titling. ly2dvi test.ly @end example After some disk-activity, you should end up with a @file{.dvi} file. -Ly2dvi is further described in the Chapter @ref{ly2dvi}. +Ly2dvi is further described in the @ref{ly2dvi}. Secondly, you can generate PostScript directly. This is useful if you can not or do not want to run @TeX{} on your system. @@ -168,17 +172,21 @@ To obtain PS output, invoke LilyPond as follows: @end example You have to set some environment variables to view or print this -output. More information can be found in the Section @ref{Invoking +output. More information can be found in the @ref{Invoking LilyPond}. Finally, there is a script called lilypond-book, that allows you to freely mix LilyPond input with Texinfo or LaTeX input. For example, this -manual was written using lilypond-book. +manual was written using lilypond-book. lilypond-book is discussed in +@ref{lilypond-book}. @unnumberedsubsec Windows [TODO] +* setting of env vars (TFMINPUTS,MFINPUTS,TEXINPUTS) +* dvi viewer doesn't display postscript + @node The first tune @section The first tune @@ -278,14 +286,14 @@ higher is @code{c''}. One and two octaves below the central C is denoted by @code{c} and @code{c,} respectively. @cindex relative -For pitches in a long piece you might have to type many quotes. To -remedy this, LilyPond has a ``relative'' octave entry mode. In this -mode, octaves of notes without quotes are chosen such that a note is -as close as possible (graphically, on the staff) to the the preceding -note. If you add a high-quote an extra octave is added. The lowered -quote (a comma) will subtract an extra octave. Because the first note -has no predecessor, you have to give the (absolute) pitch of the note -to start with. +For pitches in a long piece you might have to type many quotes. It is +easy to make typing errors with this, so LilyPond has a special entry +mode to remedy this. In this ``relative'' octave mode, octaves of notes +without quotes are chosen such that a note is as close as possible +(graphically, on the staff) to the the preceding note. If you add a +high-quote an extra octave is added. The lowered quote (a comma) will +subtract an extra octave. Because the first note has no predecessor, +you have to give the (absolute) pitch of the note to start with. @example \sequential @{ @@ -476,8 +484,7 @@ The last brace ends the @code{\score} block. @node Lyrics and chords @section Lyrics and chords -In this section we show how to typeset a song.@footnote{The author would -welcome information about the origin of this song.}. This file is +In this section we show how to typeset a song. This file is included as @file{flowing.ly}. @example @@ -524,9 +531,9 @@ accompaniment =\chords @{ @end example -The result would look this@footnote{The titling and font size shown +The result would look this.@footnote{The titling and font size shown may differ, since the titling in this document is not generated by -@file{ly2dvi}.}. +@file{ly2dvi}.} @center @strong{The river is flowing} @center Traditional @@ -908,7 +915,7 @@ For example, the following file (@file{layout.ly}) \version "1.3.124"; \header @{ title = "Two miniatures"; @} - #(set! point-and-click #t) + #(set! point-and-click line-column-location) \paper @{ linewidth = -1.0; @} @@ -931,7 +938,7 @@ not generated by ly2dvi, so details will differ.} @center @strong{Two miniatures} @flushright - Opus 1. +Opus 1. @end flushright @flushleft @var{Up} @@ -944,7 +951,7 @@ not generated by ly2dvi, so details will differ.} } @end lilypond @flushright - Opus 2. +Opus 2. @end flushright @flushleft @var{Down} @@ -1014,7 +1021,7 @@ version. This sets the titling information for the entire file. @example - #(set! point-and-click #t) + #(set! point-and-click line-column-location) @end example This is Scheme code. It sets the variable @code{point-and-click} to the @@ -1103,46 +1110,46 @@ under the name @file{sammartini.ly}. @lilypond[verbatim] \include "paper16.ly"; -stemdown = \property Voice.Stem \override #'direction = #-1 -stemup = \property Voice.Stem \override #'direction = #1 -stemboth = \property Voice.Stem \revert #'direction +stemDown = \property Voice.Stem \override #'direction = #-1 +stemUp = \property Voice.Stem \override #'direction = #1 +stemBoth = \property Voice.Stem \revert #'direction viola = \notes \relative c' \context Voice = viola { - \stemdown g'8. b,16 + \stemDown g'8. b,16 s1 s2. r4 g } oboes = \notes \relative c'' \context Voice = oboe { - \stemup s4 g8. b,16 c8 r + \stemUp s4 g8. b,16 c8 r \grace \times 2/3 { } < { \times 2/3 { a8 g c } \! c2 } \context Voice = oboeTwo { - \stemdown + \stemDown \grace { \property Grace.Stem \override #'direction = #-1 [f,16 g] } f8 e e2 } > - \stemboth + \stemBoth \grace <)b8. d8.-\trill> | [ < )f8. a>] <)b,8 d> r [ ] r | [ < )e8. g>] } hoomPah = \repeat unfold 8 - \notes \transpose c' { c8 \stemdown c'8 \stemup } + \notes \transpose c' { \stemUp c8 \stemBoth \stemDown c'8 \stemBoth } bassvoices = \notes \relative c' { c4 g8. b,16 \autochange Staff \hoomPah \translator Staff = down - \stemdown [c8 c'8] r4 + \stemDown [c8 c'8] r4 r4 - < {\stemup r2 } - \context Voice = reallyLow {\stemdown g2 ~ | g4 c8 } > + < {\stemUp r2 } + \context Voice = reallyLow {\stemDown g2 ~ | g4 c8 } > } \score { @@ -1166,7 +1173,7 @@ If it looks like incomprehensible gibberish to you, then you are right. This example has been doctored to have as many quirks as possible. @example - stemdown = \property Voice.Stem \override #'direction = #-1 + stemDown = \property Voice.Stem \override #'direction = #-1 @end example As you can see, this example features more voices on one staff. To make @@ -1189,7 +1196,7 @@ setting remains in effect until it is reverted. @end example This statement reverts the old setting. If you do this, the effect of a -@code{\stemdown} or @code{\stemup} is neutralised. +@code{\stemDown} or @code{\stemUp} is neutralised. @code{\override} and @code{\revert} function like a stack: you can push values onto the grob-setting-stack with @code{\override} and you pop @@ -1232,7 +1239,7 @@ note. signifying an arpeggio. @example - \stemdown + \stemDown @end example @@ -1260,9 +1267,9 @@ print the notes as one voice that makes chords. Again, we insure that these notes are indeed processed by precisely one context with @code{\context}. @example -\stemup s4 g8. b,16 c8 r +\stemUp s4 g8. b,16 c8 r @end example -@code{\stemup} is a reference to the @code{\property \override} command +@code{\stemUp} is a reference to the @code{\property \override} command defined above. . @example \grace < d4 f> @@ -1350,11 +1357,11 @@ the @code{f}. @end example This ends the two-part section. @example -\stemboth +\stemBoth \grace <)b8. d8.-\trill> | @end example @cindex trill -@cindex stemboth +@cindex stemBoth @code{\stemBoth} ends the forced stem directions. From here, stems are positioned as if it were single part music. @@ -1426,22 +1433,715 @@ line is not indented. The line still looks very cramped, but that is due to the page layout of this document. +@ignore [TODO: -* arpeggio, glissando, +* font-size, multi-stanza. + +* Simple part combining in a Hymn +@end ignore + +@node An orchestral score +@section An orchestral score + +If you've come this far, you should have seen enough LilyPond source to +feel comfortable with an orchestral score. We will not go through the +input line by line, but only indicate and explain the new elements. + +This orchestral score example consists of three input files. In the +first file, @file{os-music.ly}, we define the music for all instruments. +This file is to be used by the other two files, as you will see below. +If you run lilypond on this file, no output will be produced. + + +@example +% os-music.ly +\header @{ + title = "Zo, goed lieverd?"; + subtitle = "How's, this babe?"; + composer = "JCN"; + opus = "1"; + piece = "Laid back"; +@} +global = @{ + \time 2/4; + \skip 2*4; \bar "|."; +@} +Key = \notes \key as \major; +flautoI = \notes\relative c'' @{ + f8 g f g f g f g + bes as bes as bes as bes as +@} +flautoII = \notes\relative c'' @{ + as8 bes as bes R1 d4 ~ d +@} +tromboI = \notes\relative c'' @{ + c4. c8 c8 c4. es4 R1*1/2 es4 +@} +tromboII = \notes\relative c'' @{ + as4. as8 as8 as4. R1*1/2 as4 es' +@} +timpani = \notes\relative c, @{ + \times 2/3 @{ f4 f f @} + \times 4/5 @{ as8 as as as as @} + R1 +@} +corno = \notes\relative c' @{ + bes4 d f, bes d f, bes d +@} +@end example + +Things to note here are the definition of @code{\global} where we define +meter, and set the end bar. And the separate definition of @code{\Key} +that we will use all staffs except staffs for transposing instruments. + +The second file, @file{os-score.ly} reads the definitions of the first +(@file{os-music.ly}), and defines the @code{\score} block for the full +conductor's score. + +@example +% os-score.ly +\include "os-music.ly"; +\include "paper13.ly"; + +#(set! point-and-click line-column-location) +#(define text-flat '((font-relative-size . -2) + (music "accidentals--1"))) + +\score @{ + < + \global + \context StaffGroup = woodwind < + \context Staff = flauti < + \property Staff.midiInstrument = #"flute" + \property Staff.instrument = "2 Flauti" + \property Staff.instr = "Fl." + \Key + \context Voice=one @{ \voiceOne \flautoI @} + \context Voice=two @{ \voiceTwo \flautoII @} + > + > + \context StaffGroup = timpani < + \context Staff = timpani < + \property Staff.midiInstrument = #"timpani" + \property Staff.instrument = #'(lines "Timpani" "(C-G)") + \property Staff.instr = #"Timp." + \clef bass; + \Key + \timpani + > + > + \context StaffGroup = brass < + \context Staff = trombe < + \property Staff.midiInstrument = #"trumpet" + \property Staff.instrument = #`(lines "2 Trombe" "(C)") + \property Staff.instr = #`(lines "Tbe." "(C)") + \Key + \context Voice=one \partcombine Voice + \context Thread=one \tromboI + \context Thread=two \tromboII + > + \context Staff = corni < + \property Staff.midiInstrument = #"french horn" + \property Staff.instrument = #`(lines "Corno" + (rows "(E" ,text-flat ")")) + \property Staff.instr = #`(lines "Cor." + (rows "(E" ,text-flat ")")) + \property Staff.transposing = #3 + \notes \key bes \major; + \context Voice=one \corno + > + > + > + \paper @{ + indent = 15 * \staffspace; + linewidth = 60 * \staffspace; + textheight = 90 * \staffspace; + \translator@{ + \ThreadContext + \consists "Rest_engraver"; + @} + \translator@{ + \VoiceContext + \remove "Rest_engraver"; + \consists "Multi_measure_rest_engraver"; + \consists "Bar_engraver"; + @} + \translator@{ + \HaraKiriStaffContext + \remove "Multi_measure_rest_engraver"; + \remove "Bar_engraver"; + @} + \translator @{ + \OrchestralScoreContext + BarNumber \override #'padding = #3 + @} + @} + \midi @{ + \tempo 4 = 75; + @} +@} +@end example + +@center @strong{Zo, goed lieverd?} +@sp 1 +@center How's, this babe? +@flushright +Opus 1. +@end flushright +@flushleft +@sc{Laid back} +@end flushleft + +@lilypondfile{os-score.ly} + +First, we need to include the music definitions we made in +@file{os-music.ly}. +@example +\include "os-music.ly"; +@end example + +In a large orchestral score like this you're bound to make some small +mistakes, so we enable point and click (See @ref{Point and click}) +editing. +@example +#(set! point-and-click line-column-location) +@end example + +We need a flat sign in text to name the tuning of the french horn, so we +predefine it with bit of scheme markup text (See @ref{Text markup}). +@example +#(define text-flat '((font-relative-size . -2) + (music "accidentals--1"))) +@end example + +Of course, all staffs are simultaneous and use the same global settings. +@example + < + \global +@end example + +Then, we start a new staff group for the woodwind section (just the +flutes in this case). Immediately after that, we start the staff for +the two flutes, that also play simultaneously. +@example + \context StaffGroup = woodwind < + \context Staff = flauti < +@end example + +We specify the intrument for MIDI output (see @ref{MIDI instrument +names}). +@example + \property Staff.midiInstrument = #"flute" +@end example + +And define the intrument names to be printed in the margin, +@code{instrument} for the first line of the score, @code{instr} for the +rest of the score. +@example + \property Staff.instrument = "2 Flauti" + \property Staff.instr = "Fl." +@end example + +The flutes play in the default key. +@example + \Key +@end example + +Last come the actual flute parts. Remember that we're still in +simultaneous mode. We name both voices differently, so that LilyPond +will actually create two Voice contexts. The flute parts are simple, so +we specify manually which voice is which: @code{\voiceOne} forces the +direction of stems, beams, slurs and ties up, @code{\voiceTwo} sets +directions down. +@example + \context Voice=one @{ \voiceOne \flautoI @} + \context Voice=two @{ \voiceTwo \flautoII @} +@end example + +We close the flutes staff and woodwind staff group. +@example + > + > +@end example + +The timpani staff only shows a new piece of scheme markup, it sets two +lines of text. +@example + \property Staff.instrument = #'(lines "Timpani" "(C-G)") +@end example + +For the trumpets we use the automatic part combiner (see @ref{Automatic +part combining}) to combine the two simultaneous trumpet parts onto the +trumpet staff. Each trumpet gets its own Thread context, which must be +named @code{one} and @code{two}). The part combiner makes these two +threads share a Voice when they're similar, and splits the threads up +when they're different. +@example + \context Voice=one \partcombine Voice + \context Thread=one \tromboI + \context Thread=two \tromboII +@end example + +The french horn has the most complex scheme markup name, made up of two +lines of text. The second line has two elements (rows), the @code{E} +and the flat sign @code{text-flat} that we defined before. +@example + \property Staff.instrument = #`(lines "Corno" + (rows "(E" ,text-flat ")")) +@end example + +The french horn is to be tuned in E-flat, so we tell the MIDI backend to +transpose this staff by three steps. +@example + \property Staff.transposing = #3 +@end example + +Therefore, it has a different key. +@example + \notes \key bes \major; +@end example + +We specify a big indent for the first line and a small linewith for this +tuturial. +@example + indent = 15 * \staffspace; + linewidth = 60 * \staffspace; +@end example + +Because we have a Thread representing one instrument, we need to move +the @code{Rest_engraver} from Voice to Thread level. Similarly, we need +to move the @code{Multi_measure_rest_engraver} from Staff to Voice level. +@example + \translator@{ + \ThreadContext + \consists "Rest_engraver"; + @} + \translator@{ + \VoiceContext + \remove "Rest_engraver"; + \consists "Multi_measure_rest_engraver"; + \consists "Bar_engraver"; + @} +@end example + +In orchestral scores, it often happens that one instrument has only +rests during one line of the score. The @code{HaraKiriStaffContext} can +be used as a regular @code{StaffContext} drop-in and will take care of +the automatic removing of empty staffs. +@example + \translator@{ + \HaraKiriStaffContext + \remove "Multi_measure_rest_engraver"; + \remove "Bar_engraver"; + @} +@end example + +We want bar numbering at score level and want to move the bar number a +few staff spaces up. +@example + \translator @{ + \OrchestralScoreContext + BarNumber \override #'padding = #3 + @} +@end example -* \apply, \outputproperty, \translator @{@}, \molecule hacking. +@node Part extraction +@section Part extraction + +The third file, @file{os-flute-2.ly} also reads the definitions of the +first (@file{os-music.ly}), and defines the @code{\score} block for the +second flute part. + +@example +\include "os-music.ly"; +\include "paper16.ly"; -* font-size, cadenza. rhythmic staff, multi-stanza. +\score @{ + \context Staff < + \property Staff.midiInstrument = #"flute" + \global + \Key + \flautoII + > + \header @{ + instrument = "Flauto II"; + @} + \paper @{ + linewidth = 80 * \staffspace; + textheight = 200 * \staffspace; + \translator @{ + \OrchestralScoreContext + skipBars = ##t + @} + @} + \midi @{ + \tempo 4 = 75; + @} +@} +@end example +@center @strong{Zo, goed lieverd?} +@sp 1 +@center How's, this babe? +@center @emph{Flauto II} +@flushright +Opus 1. +@end flushright +@flushleft +@sc{Laid back} +@end flushleft +@lilypondfile{os-flute-2.ly} + + +Because we separated the music definitions from the @code{\score} +instantiations, we can easily define a second score from the music of +the second flute. This then is the part for the second flute player. +Of course, we make separate parts for all individual instruments. + +In this individual part the second flute has a whole staff for itself, +so we don't want to force stem or tie directions. +@example + \flautoII +@end example + +The @code{\header} definitions were also read from @file{os-music.ly}, +but we need to set the instrument for this particular score. +@example + \header @{ + instrument = "Flauto II"; + @} +@end example + +In the conductor's full score, all bars with rests are printed, but for +the individual parts, we want to contract pieces of consecutive empty +bars. +@example + skipBars = ##t +@end example + +@node Latex and texinfo integration +@section Latex and texinfo integration + + +@menu +* Songs with additional verses:: +@end menu + + +So what does this look like? Well, here is an example: +@lilypond[veryverbatim, intertext="produces this music:"] +\score{ + \notes\relative c'{ + \time 5/8; + [e16( g b c a g][e a b d] | )e2 d,8 | + [e16( g b c a g][e a b d] | )b2 [a16( f] | + [e a b d] )e4 c8 | [es16( bes a as g es][d c b! )g] | + [f( a b d b a][f a b d] | )e2 + } +} +@end lilypond +If you are lucky, the above example show a nice feature of LilyPond +and La@TeX{}. Since LilyPond can output the music as @TeX{} graphics, +La@TeX{} can insert pagebreaks between the lines of music. + +Notice that there is no @code{\paper} statement in the example +above. Lilypond-book will insert some code for you that defines the +linewidth and the font to use. If you don't want to change the default, +there is no need to put an empty @code{\paper@{@}} inside the @code{\score}. +In the example above, something like +this might be inserted before your code: +@example +\include "paper16.ly" +\paper@{ \paper_sixteen + linewidth = 390.\pt; + castingalgorithm = \Gourlay; +@} +@end example +The actual values for linewidth will differ depending on papersize and +number of columns. Also, if you use a different fontsize for the +music, another file than @code{paper16.ly} will be included. + +If you want to make the music not so wide, you can insert a +@code{\paper} statement that set the linewidth: + +@lilypond[veryverbatim, intertext="produces this music:"] +\score{ + \notes\relative c'{ + \time 5/8; + [e16( g b c a g][e a b d] | )e2 d,8 | + [e16( g b c a g][e a b d] | )b2 [a16( f] | + [e a b d] )e4 c8 | [es16( bes a as g es][d c b! )g] | + [f( a b d b a][f a b d] | )e2 + } + \paper{linewidth = 10.\cm;} +} +@end lilypond + +Very often, if you mix music and text, the music is often only a +few notes or at most a few bars. This music should be as short as +possible and not stretched to be aligned to the right margin. + +If you only write voice-contents in the lilypond block, @command{lilypond-book} +will set the @code{linewidth} variable to -1, so Lilypond +will make the music as short as possible but without breaking the +line. Here is a well know harmonic progression: +@lilypond[veryverbatim, intertext="produce a well known harmonic progression:"] + \context Voice { } +@end lilypond + +If you want to place music examples in the text, +@lilypond[eps] + \context Voice { } +@end lilypond +, you can use the @code{eps} option. This will create the music as +eps graphics and include it into the document with the +@code{\includegraphics} command. + +The code used look like this: +@example +@@lilypond[eps] + \context Voice @{ @} +@@end lilypond +@end example + +You can also use the @code{eps} option if the block is a complete +lilypond source. This 5 cm long empty line, +@lilypond[eps] +\score{ + \notes{s} + \paper{ linewidth = 5.\cm;} +} +@end lilypond +was created with this code: +@example +@@lilypond[eps] +\score@{ + \notes@{s@} + \paper@{ linewidth = 5.\cm;@} +@} +@@end lilypond +@end example + +To avoid that La@TeX{} places the music on a line of its one, there should +be no empty lines between the normal text and the lilypond +environment. + +You can also use @code{lilypondfile} (on a separate line, FIXME), to +include another file. + +@subsection Fontsize options + +You can use all lilypond fontsizes in @command{lilypond-book}. The +default 16pt fontsize is probably to big to be included in the middle of +the text, 11pt or 13pt is probably better. + +The code can look like this: +@example +@@lilypond[13pt, eps] + +@@end lilypond +@end example + +The following options set the fontsize: +@itemize +@item @code{11pt} +@lilypond[11pt, eps] + \relative c'{ + r16 [c d e][f d e c] [g'8 c][b-\prall c] | + [d16 g, a b][c a b g][d'8 g f-\prall g] + } +@end lilypond +@item @code{13pt} +@lilypond[13pt, eps] + \relative c'{ + r16 [c d e][f d e c] [g'8 c][b-\prall c] | + [d16 g, a b][c a b g][d'8 g f-\prall g] + } +@end lilypond +@item @code{16pt} +@lilypond[16pt, eps] + \relative c'{ + r16 [c d e][f d e c] [g'8 c][b-\prall c] | + [d16 g, a b][c a b g][d'8 g f-\prall g] + } +@end lilypond +@item @code{20pt} +@lilypond[20pt, eps] + \relative c'{ + r16 [c d e][f d e c] [g'8 c][b-\prall c] | + [d16 g, a b][c a b g][d'8 g f-\prall g] + } +@end lilypond +@item @code{26pt} +@lilypond[26pt, eps] + \relative c'{ + r16 [c d e][f d e c] [g'8 c][b-\prall c] | + } +@end lilypond +@end itemize + + +@subsection More options + +@itemize +@item The @code{singleline} option set @code{linewidth} to -1.0. +@item The @code{multiline} option set @code{linewidth} to a value letting +the music be aligned to the right margin. The music can span several +lines. +@end itemize + +@subsection Just in case... +The options @code{fragment} and @code{nofragment} will override +@command{lilypond-book} when it scans the lilypond code to see if it is voice +contents or complete code. This might be useful if @command{lilypond-book} choose +wrong. + +Since there is no finder's fee which doubles every year, there is no +need to wait for the price money to grow. So send a bug report today +if you need this one of these options. + +@subsection Examples + +This was all options to @code{\begin}. The rest of the lilypond +document will show some ways you can use lilypond in +La@TeX{} documents. It will also act as a simple test-suite for +lilypond-book. You can place @code{eps} lilypond in and marginspars just +as any other included eps graphics. + +@lilypond +\score{ + \notes\relative c'{ + \time 12/8; + r4-\fermata [b16-.( )b-.] [f'8-- dis16-.( )dis-. gis8--] + [f16-.( )f-. dis8-- gis16-.( )gis-.] cis4.-\fermata | + + r4.-\fermata [cis,16 cis g'8 f16 f b8][g16 g f8 b16 b] dis4.-\fermata + } + \paper{linewidth = 7.\cm;} +} +@end lilypond + + +To the right you can see some bars from the trumpet fanfara from the +beginning of the fantastic street opera ``Houdini the Great'', by the +Danish composer Andy Pape. The music is put inside a +@code{floatingfigure} environment, and the music will be aligned by +the right marging if you set floatingfigure width and lilypond linewidth +to the same value. The code looks like this: + +@lilypond[verbatim] +\score{ + \notes\relative c'{ + \time 12/8; + r4.-\fermata [b16-.( )b-.] [f'8-- dis16-.( )dis-. gis8--] + [f16-.( )f-. dis8-- gis16-.( )gis-.] cis8.-\fermata | + + r4.-\fermata [cis,16 cis g'8 f16 f b8] + [g16 g f8 b16 b] dis4.-\fermata + } + \paper{linewidth = 7.\cm;} +} +@end lilypond + +If you have a lot of small music examples like this in the middle of +your text, you might get a nicer look by using ``double'' line +spacing. Put the @code{\linespread@{1.6@}} command into the preamble of +your document. Then the line spacing will not be increased between the +lines where you have music printed with the smallest font size. + +Lilypond-book does know about @code{\onecolumn} and @code{\twocolumn}. +So the music will be adjusted to the new linewith: + +Verbatim environments will also ignore the page margins. That is +a feature of La@TeX{}. (But you usually put things inside a verbatim +environment when you don't want La@TeX{} to do any linebreaking) + +@node Songs with additional verses +@subsection Songs with additional verses + +With lilypond-book, you can typeset songs with additional verses. To +make lilypond-book print titles like ly2dvi, add + +@example +\input titledefs.tex +\def\preLilypondExample@{\def\mustmakelilypondtitle@{@}@} +@end example + +just before the music fragment. + +@c urg: can't show, won't work for .texi docs + +@example +% generate standard lilypond titles +\input titledefs.tex +\def\preLilypondExample@{\def\mustmakelilypondtitle@{@}@} + +\begin@{lilypond@} +\header @{ + title = "Title"; + subtitle = "Subtitle"; + subsubtitle = "Subsubtitle"; + opus = "Opus 1"; + piece = "Piece"; + composer = "Composer"; + enteredby = "JCN"; + instrument = "instrument"; +@} +\paper @{ linewidth = -1.; @} +\score @{ + \notes \relative c'' @{ a b c d @} +@} +\end@{lilypond@} + +\begin@{enumerate@} +\item Verse one. aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa +\item Verse two. bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb +\end@{enumerate@} +@end example -* Orchestral: demonstrate Hara-Kiri, part combining, part extraction, -scores, transposition, instrument names, -] @node end of tutorial @section The end That's all folks. From here, you can either try fiddling with input -files, or you can read the reference manual. +files, or you can read the reference manual. You can find more example +files in @file{input} and @file{input/test}. You can also look at Real +Music (TM), have a look at the @ref{Mutopia project}. + + + +[TODO figure out what to do with this: ] + + +@node Pre-cooked makefile +@section Pre-cooked makefile + +@c waar deze info? is uiteindelijk wel handig, schat ik. +[TODO: cut blabla] + +If you have a big music project, or just a lot of LilyPond input files, +all generated output from LilyPond, @TeX{} and metafont will clutter +your working directory. LilyPond comes with a one-size-fits-all +pre-cooked makefile that helps you manage producing ouptut. It will +produce all output in @file{out}, generate and track dependencies. +Also, it helps in preparing your submission to the @ref{Mutopia +project}. + +@file{make/ly.make} +@example +mkdir my-project +cd my-project +cp /usr/share/lilypond/make/ly.make GNUmakefile +cp /usr/share/doc/lilypond/examples/input/tutorial/menuet.ly . +make menuet +[..] +Generated out/menuet.ps for target menuet. +@end example + +Type @samp{make help} to see possible targets. + +[TODO] +@file{/usr/share/lilypond/doc/lilypond/examples/input/mutopia-header.ly} +