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