]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/global.itely
bd2596410da33547f5b726c5a883c625376d0a66
[lilypond.git] / Documentation / user / global.itely
1 @c -*- coding: utf-8; mode: texinfo; -*-
2 @c This file is part of lilypond.tely
3
4 @c A menu is needed before every deeper *section nesting of @node's; run
5 @c     M-x texinfo-all-menus-update
6 @c to automatically fill in these menus before saving changes
7
8 @node Non-musical notation
9 @chapter Non-musical notation
10
11 This section deals with general lilypond issues, rather than
12 specific notation.
13
14 @menu
15 * Input files::                 
16 * Titles and headers::          
17 * MIDI output::                 
18 * Displaying LilyPond notation::  
19 * Skipping corrected music::    
20 @end menu
21
22
23 @node Input files
24 @section Input files
25
26 The main format of input for LilyPond are text files.  By convention,
27 these files end with ``@code{.ly}''.
28
29 @menu
30 * File structure (introduction)::  
31 * Multiple scores in a book::   
32 * Extracting fragments of notation::  
33 * File structure::              
34 * A single music expression::   
35 * Including LilyPond files::    
36 * Text encoding::               
37 @end menu
38
39
40 @node File structure (introduction)
41 @subsection File structure (introduction)
42
43 A basic example of a lilypond input file is
44
45 @example
46 \version "2.9.13"
47 \score @{
48   @{ @}     % this is a single music expression;
49             % all the music goes in here.
50   \header @{ @}
51   \layout @{ @}
52   \midi @{ @}
53 @}
54 @end example
55
56 @noindent
57 There are many variations of this basic pattern, but this
58 example serves as a useful starting place.
59
60 The major part of this manual is concerned with entering various
61 forms of music in LilyPond.  However, many music expressions are not
62 valid input on their own, for example, a @code{.ly} file containing
63 only a note
64 @example
65 c'4
66 @end example
67
68 @noindent
69 will result in a parsing error.  Instead, music should be inside other
70 expressions, which may be put in a file by themselves.  Such
71 expressions are called toplevel expressions.  The next section enumerates
72 them all.
73
74
75 @node Multiple scores in a book
76 @subsection Multiple scores in a book
77
78 @funindex \book
79 @cindex movements, multiple
80
81 A document may contain multiple pieces of music and texts.  Examples
82 of these are an etude book, or an orchestral part with multiple
83 movements.  Each movement is entered with a @code{\score} block,
84
85 @example
86 \score @{
87   @var{..music..}
88 @}
89 @end example
90
91 and texts are entered with a @code{\markup} block,
92
93 @example
94 \markup @{
95   @var{..text..}
96 @}
97 @end example
98
99 @funindex \book
100
101 The movements and texts are combined together in a @code{\book} block,
102 like
103
104 @example
105 \book @{
106   \score @{
107     @var{..}
108   @}
109   \markup @{
110     @var{..}
111   @}
112   \score @{
113     @var{..}
114   @}
115 @}
116 @end example
117
118
119 The header for each piece of music can be put inside the @code{\score}
120 block.  The @code{piece} name from the header will be printed before
121 each movement.  The title for the entire book can be put inside the
122 @code{\book}, but if it is not present, the @code{\header} which is at
123 the top of the file is inserted.
124
125 @example
126 \book @{
127   \header @{
128     title = "Eight miniatures"
129     composer = "Igor Stravinsky"
130   @}
131   \score @{
132     @dots{}
133     \header @{ piece = "Romanze" @}
134   @}
135   \markup @{
136      ..text of second verse..
137   @}
138   \markup @{
139      ..text of third verse..
140   @}
141   \score @{
142     @dots{}
143     \header @{ piece = "Menuetto" @}
144   @}
145 @}
146 @end example
147
148 @node Extracting fragments of notation
149 @subsection Extracting fragments of notation
150
151 It is possible to quote small fragments of a large score directly from
152 the output. This can be compared to clipping a piece of a paper score
153 with scissors.
154
155 This is done by definining the measures that need to be cut out
156 separately. For example, including the following definition
157
158
159 @verbatim
160 \layout {
161   clip-regions
162   = #(list
163       (cons
164        (make-rhythmic-location 5 1 2)
165        (make-rhythmic-location 7 3 4)))
166 }       
167 @end verbatim
168
169 @noindent
170 will extract a fragment starting halfway the fifth measure, ending in
171 the seventh measure. The meaning of @code{5 1 2} is: after a 1/2 note
172 in measure 5, and @code{7 3 4} after 3 quarter notes in measure 7.
173
174 More clip regions can be defined by adding more pairs of
175 rhythmic-locations to the list. 
176
177 In order to use this feature, LilyPond must be invoked with
178 @code{-dclip-systems}. The clips are output as EPS files, and are
179 converted to PDF and PNG if these formats are switched on as well.
180
181 For more information on output formats, see @ref{Invoking lilypond}.
182
183 @seealso
184
185 Examples: @inputfileref{input/regression/,clip-systems.ly}
186
187
188 @node File structure
189 @subsection File structure
190
191 A @code{.ly} file contains any number of toplevel expressions, where a
192 toplevel expression is one of the following
193
194 @itemize @bullet
195 @item
196 An output definition, such as @code{\paper}, @code{\midi}, and
197 @code{\layout}.  Such a definition at the toplevel changes the default
198 settings for the block entered.
199
200 @item
201 A direct scheme expression, such as
202 @code{#(set-default-paper-size "a7" 'landscape)} or
203 @code{#(ly:set-option 'point-and-click #f)}.
204
205 @item
206 A @code{\header} block.  This sets the global header block.  This
207 is the block containing the definitions for book-wide settings, like
208 composer, title, etc.
209
210 @item
211 A @code{\score} block.  This score will be collected with other
212 toplevel scores, and combined as a single @code{\book}.
213
214 This behavior can be changed by setting the variable
215 @code{toplevel-score-handler} at toplevel.  The default handler is
216 defined in the init file @file{scm/@/lily@/.scm}.
217
218 The @code{\score} must begin with a music expression, and may
219 contain only one music expression.
220
221 @item
222 A @code{\book} block logically combines multiple movements
223 (i.e., multiple @code{\score} blocks) in one document.  If there are
224 a number of @code{\scores}, a single output file will be created
225 in which all movements are concatenated.
226
227 This behavior can be changed by setting the variable
228 @code{toplevel-book-handler} at toplevel.  The default handler is
229 defined in the init file @file{scm/@/lily@/.scm}.
230
231 @item
232 A compound music expression, such as
233 @example
234 @{ c'4 d' e'2 @}
235 @end example
236
237 This will add the piece in a @code{\score} and format it in a
238 single book together with all other toplevel @code{\score}s and music
239 expressions.  In other words, a file containing only the above
240 music expression will be translated into
241
242 @example
243 \book @{
244   \score @{
245     \new Staff @{
246       \new Voice @{
247         @{ c'4 d' e'2 @}
248       @}
249     @}
250   @}
251         \layout @{ @}
252         \header @{ @}
253 @}
254 @end example
255
256 This behavior can be changed by setting the variable
257 @code{toplevel-music-handler} at toplevel.  The default handler is
258 defined in the init file @file{scm/@/lily@/.scm}.
259
260 @item
261 A markup text, a verse for example
262 @example
263 \markup @{
264    2.  The first line verse two.
265 @}
266 @end example
267
268 Markup texts are rendered above, between or below the scores or music
269 expressions, wherever they appear.
270
271 @item
272 An identifier, such as
273 @example
274 foo = @{ c4 d e d @}
275 @end example
276
277 This can be used later on in the file by entering @code{\foo}.  The
278 name of an identifier should have alphabetic characters only; no
279 numbers, underscores or dashes.
280
281 @end itemize
282
283 The following example shows three things that may be entered at
284 toplevel
285
286 @example
287 \layout @{
288   % movements are non-justified by default
289   ragged-right = ##t
290 @}
291
292 \header @{
293    title = "Do-re-mi"
294 @}
295
296 @{ c'4 d' e2 @}
297 @end example
298
299
300 At any point in a file, any of the following lexical instructions can
301 be entered:
302
303 @itemize @bullet
304 @item @code{\version}
305 @item @code{\include}
306 @item @code{\sourcefilename}
307 @item @code{\sourcefileline}
308
309 @end itemize
310
311
312 @node A single music expression
313 @subsection A single music expression
314
315 A @code{\score} must contain a single music expression.  However,
316 this music expression may be of any size.  Recall that music
317 expressions may be included inside other expressions to form
318 larger expressions.  All of these examples are single music
319 expressions; note the curly braces @{ @} or angle brackets <<
320 >> at the beginning and ending of the music.
321
322 @example
323 @{ c'4 c' c' c' @}
324 @end example
325
326 @lilypond[ragged-right,verbatim,quote]
327 {
328   { c'4 c' c' c'}
329   { d'4 d' d' d'}
330 }
331 @end lilypond
332
333 @lilypond[ragged-right,verbatim,quote]
334 <<
335   \new Staff { c'4 c' c' c' }
336   \new Staff { d'4 d' d' d' }
337 >>
338 @end lilypond
339
340 @example
341 @{
342   \new GrandStaff <<
343     \new StaffGroup <<
344       \new Staff @{ \flute @}
345       \new Staff @{ \oboe @}
346     >>
347     \new StaffGroup <<
348       \new Staff @{ \violinI @}
349       \new Staff @{ \violinII @}
350     >>
351   >>
352 @}
353 @end example
354
355
356 @node Including LilyPond files
357 @subsection Including LilyPond files
358
359 @funindex \include
360 @cindex including files
361
362 A large project may be split up into separate files.  To refer to another
363 file, use
364
365 @example
366 \include "otherfile.ly"
367 @end example
368
369 The line @code{\include "file.ly"} is equivalent to pasting the contents
370 of file.ly into the current file at the place where you have the
371 \include.  For example, for a large project you might write separate files
372 for each instrument part and create a ``full score'' file which brings
373 together the individual instrument files.
374
375 The initialization of LilyPond is done in a number of files that are
376 included by default when you start the program, normally transparent to the
377 user.  Run lilypond --verbose to see a list of paths and files that Lily
378 finds.
379
380 Files placed in directory @file{PATH/TO/share/lilypond/VERSION/ly/} (where
381 VERSION is in the form ``2.6.1'') are on the path and available to
382 @code{\include}.  Files in the
383 current working directory are available to \include, but a file of the same
384 name in LilyPond's installation takes precedence.  Files are
385 available to \include from directories in the search path specified as an
386 option when invoking @code{lilypond --include=DIR} which adds DIR to the
387 search path.
388
389 The @code{\include} statement can use full path information, but with the Unix
390 convention @code{"/"} rather than the DOS/Windows @code{"\"}.  For example,
391 if @file{stuff.ly} is located one directory higher than the current working
392 directory, use
393
394 @example
395 \include "../stuff.ly"
396 @end example
397
398
399 @node Text encoding
400 @subsection Text encoding
401
402 LilyPond uses the Pango library to format multi-lingual texts, and
403 does not perform any input-encoding conversions.  This means that any
404 text, be it title, lyric text, or musical instruction containing
405 non-ASCII characters, must be utf-8.  The easiest way to enter such text is
406 by using a Unicode-aware editor and saving the file with utf-8 encoding.  Most
407 popular modern editors have utf-8 support, for example, vim, Emacs,
408 jEdit, and GEdit do.
409
410 @c  Currently not working
411 @ignore
412 Depending on the fonts installed, the following fragment shows Hebrew
413 and Cyrillic lyrics,
414
415 @cindex Cyrillic
416 @cindex Hebrew
417 @cindex ASCII, non
418
419 @li lypondfile[fontload]{utf-8.ly}
420
421 The @TeX{} backend does not handle encoding specially at all.  Strings
422 in the input are put in the output as-is.  Extents of text items in the
423 @TeX{} backend, are determined by reading a file created via the
424 @file{texstr} backend,
425
426 @example
427 lilypond -b texstr input/les-nereides.ly
428 latex les-nereides.texstr
429 @end example
430
431 The last command produces @file{les-nereides.textmetrics}, which is
432 read when you execute
433
434 @example
435 lilypond -b tex input/les-nereides.ly
436 @end example
437
438 Both @file{les-nereides.texstr} and @file{les-nereides.tex} need
439 suitable LaTeX wrappers to load appropriate La@TeX{} packages for
440 interpreting non-ASCII strings.
441
442 @end ignore
443
444 To use a Unicode escape sequence, use
445
446 @example
447 #(ly:export (ly:wide-char->utf-8 #x2014))
448 @end example
449
450
451 @seealso
452
453 @inputfileref{input/regression,utf-8.ly}
454
455
456
457 @node Titles and headers
458 @section Titles and headers
459
460 Almost all printed music includes a title and the composer's name;
461 some pieces include a lot more information.
462
463 @menu
464 * Creating titles::             
465 * Custom titles::               
466 @end menu
467
468
469 @node Creating titles
470 @subsection Creating titles
471
472 Titles are created for each @code{\score} block, and over a
473 @code{\book}.
474
475 The contents of the titles are taken from the @code{\header} blocks.
476 The header block for a book supports the following
477
478
479 @table @code
480 @funindex dedication
481 @item dedication
482 The dedicatee of the music, centered at the top of the first page.
483
484 @funindex title
485 @item title
486 The title of the music, centered just below the dedication.
487
488 @funindex subtitle
489 @item subtitle
490 Subtitle, centered below the title.
491
492 @funindex subsubtitle
493 @item subsubtitle
494 Subsubtitle, centered below the subtitle.
495
496 @funindex poet
497 @item poet
498 Name of the poet, flush-left below the subtitle.
499
500 @funindex composer
501 @item composer
502 Name of the composer, flush-right below the subtitle.
503
504 @funindex meter
505 @item meter
506 Meter string, flush-left below the poet.
507
508 @funindex opus
509 @item opus
510 Name of the opus, flush-right below the composer.
511
512 @funindex arranger
513 @item arranger
514 Name of the arranger, flush-right below the opus.
515
516 @funindex instrument
517 @item instrument
518 Name of the instrument, centered below the arranger.  Also
519 centered at the top of pages (other than the first page).
520
521 @funindex piece
522 @item piece
523 Name of the piece, flush-left below the instrument.
524
525 @cindex page breaks, forcing
526 @funindex breakbefore
527 @item breakbefore
528 This forces the title to start on a new page (set to ##t or ##f).
529
530 @funindex copyright
531 @item copyright
532 Copyright notice, centered at the bottom of the first page.  To
533 insert the copyright symbol, see @ref{Text encoding}.
534
535 @funindex tagline
536 @item tagline
537 Centered at the bottom of the last page.
538
539 @end table
540
541 Here is a demonstration of the fields available.  Note that you
542 may use any @ref{Text markup} commands in the header.
543
544 @lilypond[quote,verbatim,line-width=11.0\cm]
545 \paper {
546   line-width = 9.0\cm
547   paper-height = 10.0\cm
548 }
549
550 \book {
551   \header {
552     dedication = "dedicated to me"
553     title = \markup \center-align { "Title first line" "Title second line,
554 longer" }
555     subtitle = "the subtitle,"
556     subsubtitle = #(string-append "subsubtitle LilyPond version "
557 (lilypond-version))
558     poet = "Poet"
559     composer =  \markup \center-align { "composer" \small "(1847-1973)" }
560     texttranslator = "Text Translator"
561     meter = \markup { \teeny "m" \tiny "e" \normalsize "t" \large "e" \huge
562 "r" }
563     arranger = \markup { \fontsize #8.5 "a" \fontsize #2.5 "r" \fontsize
564 #-2.5 "r" \fontsize #-5.3 "a" \fontsize #7.5 "nger" }
565     instrument = \markup \bold \italic "instrument"
566     piece = "Piece"
567   }
568
569   \score {
570     { c'1 }
571     \header {
572       piece = "piece1"
573       opus = "opus1"
574     }
575   }
576   \markup {
577       and now...
578   }
579   \score {
580     { c'1 }
581     \header {
582       piece = "piece2"
583       opus = "opus2"
584     }
585   }
586 }
587 @end lilypond
588
589 As demonstrated before, you can use multiple @code{\header} blocks.
590 When same fields appear in different blocks, the latter is used.
591 Here is a short example.
592
593 @example
594 \header @{
595   composer = "Composer"
596 @}
597 \header @{
598   piece = "Piece"
599 @}
600 \score @{
601   \new Staff @{ c'4 @}
602   \header @{
603     piece = "New piece"  % overwrite previous one
604   @}
605 @}
606 @end example
607
608 If you define the @code{\header} inside the @code{\score} block, then
609 normally only the @code{piece} and @code{opus} headers will be printed.
610 Note that the music expression must come before the @code{\header}.
611
612 @lilypond[quote,verbatim,line-width=11.0\cm]
613 \score {
614   { c'4 }
615   \header {
616     title = "title"  % not printed
617     piece = "piece"
618     opus = "opus"
619   }
620 }
621 @end lilypond
622
623 @funindex printallheaders
624 @noindent
625 You may change this behavior (and print all the headers when defining
626 @code{\header} inside @code{\score}) by using
627
628 @example
629 \paper@{
630   printallheaders=##t
631 @}
632 @end example
633
634 @cindex copyright
635 @cindex tagline
636
637 The default footer is empty, except for the first page, where the
638 @code{copyright} field from @code{\header} is inserted, and the last
639 page, where @code{tagline} from @code{\header} is added.  The default
640 tagline is ``Music engraving by LilyPond (@var{version})''.@footnote{Nicely
641 printed parts are good PR for us, so please leave the tagline if you
642 can.}
643
644 Headers may be completely removed by setting them to false.
645
646 @example
647 \header @{
648   tagline = ##f
649   composer = ##f
650 @}
651 @end example
652
653
654 @node Custom titles
655 @subsection Custom titles
656
657 A more advanced option is to change the definitions of the following
658 variables in the @code{\paper} block.  The init file
659 @file{ly/titling-init.ly} lists the default layout.
660
661 @table @code
662 @funindex bookTitleMarkup
663 @item bookTitleMarkup
664   This is the title put over an entire @code{\book} block.  Typically,
665   it has the composer and the title of the piece
666
667 @funindex scoreTitleMarkup
668 @item scoreTitleMarkup
669   This is the title put over a @code{\score} block within a
670 @code{\book}.  Typically, it has the name of the movement (@code{piece}
671 field).
672
673 @funindex oddHeaderMarkup
674 @item oddHeaderMarkup
675   This is the page header for odd-numbered pages.
676
677 @funindex evenHeaderMarkup
678 @item evenHeaderMarkup
679   This is the page header for even-numbered pages.  If unspecified,
680   the odd header is used instead.
681
682   By default, headers are defined such that the page number is on the
683   outside edge, and the instrument is centered.
684
685 @funindex oddFooterMarkup
686 @item oddFooterMarkup
687   This is the page footer for odd-numbered pages.
688
689 @funindex evenFotterMarkup
690 @item evenFooterMarkup
691   This is the page footer for even-numbered pages.  If unspecified,
692   the odd header is used instead.
693
694   By default, the footer has the copyright notice on the first, and
695   the tagline on the last page.
696 @end table
697
698
699 @cindex \paper
700 @cindex header
701 @cindex footer
702 @cindex page layout
703 @cindex titles
704
705 The following definition will put the title flush left, and the
706 composer flush right on a single line.
707
708 @verbatim
709 \paper {
710   bookTitleMarkup = \markup {
711    \fill-line {
712      \fromproperty #'header:title
713      \fromproperty #'header:composer
714    }
715   }
716 }
717 @end verbatim
718
719
720
721 @node MIDI output
722 @section MIDI output
723
724 @cindex Sound
725 @cindex MIDI
726
727 MIDI (Musical Instrument Digital Interface) is a standard for
728 connecting and controlling digital instruments.  A MIDI file is a
729 series of notes in a number of tracks.  It is not an actual
730 sound file; you need special software to translate between the
731 series of notes and actual sounds.
732
733 Pieces of music can be converted to MIDI files, so you can listen to
734 what was entered.  This is convenient for checking the music; octaves
735 that are off or accidentals that were mistyped stand out very much
736 when listening to the MIDI output.
737
738 @refbugs
739
740 Many musically interesting effects, such as swing, articulation,
741 slurring, etc., are not translated to midi.
742
743 The midi output allocates a channel for each staff, and one for global
744 settings.  Therefore the midi file should not have more than 15 staves
745 (or 14 if you do not use drums).  Other staves will remain silent.
746
747 Not all midi players correctly handle tempo changes in the midi
748 output.  Players that are known to work include
749 @uref{http://@/timidity@/.sourceforge@/.net/,timidity}.
750
751 @menu
752 * Creating MIDI files::         
753 * MIDI block::                  
754 * MIDI instrument names::       
755 @end menu
756
757 @node Creating MIDI files
758 @subsection Creating MIDI files
759
760 To create a MIDI from a music piece of music, add a @code{\midi} block
761 to a score, for example,
762
763 @example
764 \score @{
765   @var{...music...}
766   \midi @{  @}
767 @}
768 @end example
769
770 FIXME
771
772 The tempo is specified using the @code{\tempo} command.  In this
773 example the tempo of quarter notes is set to 72 beats per minute.
774
775
776 If there is a @code{\midi} command in a @code{\score}, only MIDI will
777 be produced.  When notation is needed too, a @code{\layout} block must
778 be added
779
780 @example
781 \score @{
782   @var{...music...}
783   \midi @{ @}
784   \layout @{ @}
785 @}
786 @end example
787 @cindex layout block
788
789
790
791 Ties, dynamics, and tempo changes are interpreted.  Dynamic marks,
792 crescendi and decrescendi translate into MIDI volume levels.  Dynamic
793 marks translate to a fixed fraction of the available MIDI volume
794 range, crescendi and decrescendi make the volume vary linearly between
795 their two extremes.  The fractions can be adjusted by
796 @code{dynamicAbsoluteVolumeFunction} in @internalsref{Voice} context.
797 For each type of MIDI instrument, a volume range can be defined.  This
798 gives a basic equalizer control, which can enhance the quality of
799 the MIDI output remarkably.  The equalizer can be controlled by
800 setting @code{instrumentEqualizer}, or by setting
801
802 @example
803 \set Staff.midiMinimumVolume = #0.2
804 \set Staff.midiMaximumVolume = #0.8
805 @end example
806
807 To remove dynamics from the MIDI output, insert the following lines
808 in the @code{\midi@{@}} section.
809
810 @example
811 \midi @{
812   ...
813   \context @{
814     \Voice
815     \remove "Dynamic_performer"
816     \remove "Span_dynamic_performer"
817   @}
818 @}
819 @end example
820
821
822 @refbugs
823
824 Unterminated (de)crescendos will not render properly in the midi file,
825 resulting in silent passages of music.  The workaround is to explicitly
826 terminate the (de)crescendo.  For example,
827
828 @example
829 @{ a\< b c d\f @}
830 @end example
831
832 @noindent
833 will not work properly but
834
835 @example
836 @{ a\< b c d\!\f @}
837 @end example
838
839 @noindent
840 will.
841
842
843 @node MIDI block
844 @subsection MIDI block
845 @cindex MIDI block
846
847
848 The MIDI block is analogous to the layout block, but it is somewhat
849 simpler.  The @code{\midi} block is similar to @code{\layout}. It can contain
850 context definitions.
851
852
853 @cindex context definition
854
855 Context definitions follow precisely the same syntax as within the
856 \layout block.  Translation modules for sound are called performers.
857 The contexts for MIDI output are defined in @file{ly/@/performer@/-init@/.ly}.
858
859
860 @node MIDI instrument names
861 @subsection MIDI instrument names
862
863 @cindex instrument names
864 @funindex Staff.midiInstrument
865
866 The MIDI instrument name is set by the @code{Staff.midiInstrument}
867 property.  The instrument name should be chosen from the list in
868 @ref{MIDI instruments}.
869
870 @example
871 \set Staff.midiInstrument = "glockenspiel"
872 @var{...notes...}
873 @end example
874
875 If the selected instrument does not exactly match an instrument from
876 the list of MIDI instruments, the Grand Piano (@code{"acoustic grand"})
877 instrument is used.
878
879
880 @c  Yes, this is a cop-out; this info doesn't belong in the Scheme
881 @c  chapter, but I'm not certain where to stick it.
882 @c  I think I'll eventually split this chapter into a "paper/layout"
883 @c  chapter and a "misc issues" chapter.  -gp
884 @node Displaying LilyPond notation
885 @section Displaying LilyPond notation
886
887 @funindex \displayLilyMusc
888 Displaying a music expression in LilyPond notation can be
889 done using the music function @code{\displayLilyMusic}.  For example,
890
891 @example
892 @{
893   \displayLilyMusic \transpose c a, @{ c e g a bes @}
894 @}
895 @end example
896
897 will display
898
899 @example
900 @{ a, cis e fis g @}
901 @end example
902
903 By default, LilyPond will print these messages to the console along
904 with all the other messages.  To split up these messages and save
905 the results of @code{\display@{STUFF@}}, redirect the output to
906 a file.
907
908 @example
909 lilypond file.ly >display.txt
910 @end example
911
912
913 @node Skipping corrected music
914 @section Skipping corrected music
915
916
917 @funindex skipTypesetting
918 @funindex showLastLength
919
920 When entering or copying music, usually only the music near the end (where
921 you
922 are adding notes) is interesting to view and correct.  To speed up
923 this correction process, it is possible to skip typesetting of all but
924 the last few measures. This is achieved by putting
925
926 @verbatim
927 showLastLength = R1*5
928 \score { ... }
929 @end verbatim
930
931 @noindent
932 in your source file. This will render only the last 5 measures
933 (assuming 4/4 time signature) of every @code{\score} in the input
934 file. For longer pieces, rendering only a small part is often an order
935 of magnitude quicker than rendering it completely
936
937 Skipping parts of a score can be controlled in a more fine-grained
938 fashion with the property @code{Score.skipTypesetting}.  When it is
939 set, no typesetting is performed at all.
940
941 This property is also used to control output to the MIDI file. Note that
942 it skips all events, including tempo and instrument changes. You have
943 been warned.
944
945 @lilypond[quote,fragment,ragged-right,verbatim]
946 \relative c'' {
947   c8 d
948   \set Score.skipTypesetting = ##t
949   e e e e e e e e
950   \set Score.skipTypesetting = ##f
951   c d b bes a g c2 }
952 @end lilypond
953
954 In polyphonic music, @code{Score.skipTypesetting} will affect all
955 voices and staves, saving even more time.
956
957
958