1 @c -*- coding: utf-8; mode: texinfo; -*-
2 @c This file is part of lilypond.tely
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
9 @chapter Output formats
11 This is a placeholder until I can write a nice intro for this chapter.
22 The global paper layout is determined by three factors: the page layout, the
23 line breaks, and the spacing. These all influence each other. The
24 choice of spacing determines how densely each system of music is set.
25 This influences where line breaks are chosen, and thus ultimately, how
26 many pages a piece of music takes.
28 Globally spoken, this procedure happens in three steps: first,
29 flexible distances (``springs'') are chosen, based on durations. All
30 possible line breaking combinations are tried, and the one with the
31 best results -- a layout that has uniform density and requires as
32 little stretching or cramping as possible -- is chosen.
34 After spacing and linebreaking, the systems are distributed across
35 pages, taking into account the size of the page, and the size of the
41 * Setting global staff size::
42 * Selecting notation font size::
47 * Vertical spacing of piano staves::
48 * Horizontal spacing::
52 * Multiple movements::
57 @node Setting global staff size
58 @subsection Setting global staff size
60 @cindex font size, setting
61 @cindex staff size, setting
62 @cindex @code{layout} file
64 To set the global staff size, use @code{set-global-staff-size}.
67 #(set-global-staff-size 14)
71 This sets the global default size to 14pt staff height and scales all
74 The Feta font provides musical symbols at eight different
75 sizes. Each font is tuned for a different staff size: at a smaller size
76 the font becomes heavier, to match the relatively heavier staff lines.
77 The recommended font sizes are listed in the following table:
80 @multitable @columnfractions .15 .2 .22 .2
83 @tab @b{staff height (pt)}
84 @tab @b{staff height (mm)}
126 @c modern rental material?
131 These fonts are available in any sizes. The context property
132 @code{fontSize} and the layout property @code{staff-space} (in
133 @internalsref{StaffSymbol}) can be used to tune the size for individual
134 staves. The sizes of individual staves are relative to the global size.
142 This manual: @ref{Selecting notation font size}.
145 @node Selecting notation font size
146 @subsection Selecting notation font size
148 The easiest method of setting the font size of any context, is by
149 setting the @code{fontSize} property.
151 @lilypond[quote,fragment,relative=1,verbatim]
160 It does not change the size of variable symbols, such as beams or
163 Internally, the @code{fontSize} context property will cause the
164 @code{font-size} property to be set in all layout objects. The value
165 of @code{font-size} is a number indicating the size relative to the
166 standard size for the current staff height. Each step up is an
167 increase of approximately 12% of the font size. Six steps is exactly a
168 factor two. The Scheme function @code{magstep} converts a
169 @code{font-size} number to a scaling factor.
171 @lilypond[quote,fragment,relative=1,verbatim]
173 \override NoteHead #'font-size = #-4
175 \override NoteHead #'font-size = #3
179 LilyPond has fonts in different design sizes. The music fonts for
180 smaller sizes are chubbier, while the text fonts are relatively wider.
181 Font size changes are achieved by scaling the design size that is
182 closest to the desired size. The standard font size (for
183 @code{font-size} equals 0), depends on the standard staff height. For
184 a 20pt staff, a 10pt font is selected.
186 The @code{font-size} property can only be set on layout objects that
187 use fonts. These are the ones supporting the
188 @internalsref{font-interface} layout interface.
192 The following commands set @code{fontSize} for the current voice:
196 @cindex @code{\small}
198 @cindex @code{\normalsize}
203 @subsection Paper size
207 @cindex @code{papersize}
209 To change the paper size, there are two commands,
211 #(set-default-paper-size "a4")
213 #(set-paper-size "a4")
217 The first command sets the size of all pages. The second command sets the size
218 of the pages that the @code{\paper} block applies to -- if the @code{\paper}
219 block is at the top of the file, then it will apply to all pages. If the
220 @code{\paper} block is inside a @code{\book}, then the paper size will only
223 Support for the following paper sizes are included by default,
224 @code{a6}, @code{a5}, @code{a4}, @code{a3}, @code{legal}, @code{letter},
225 @code{11x17} (also known as tabloid).
227 Extra sizes may be added by editing the definition for
228 @code{paper-alist} in the initialization file @file{scm/paper.scm}.
233 If the symbol @code{landscape} is supplied as an argument to
234 @code{set-default-paper-size}, the pages will be rotated by 90 degrees,
235 and wider line widths will be set correspondingly.
238 #(set-default-paper-size "a6" 'landscape)
242 @node Page formatting
243 @subsection Page formatting
245 @cindex page formatting
250 LilyPond will do page layout, set margins, and add headers and
251 footers to each page.
253 The default layout responds to the following settings in the
256 @cindex @code{\paper}
260 @cindex @code{firstpagenumber}
261 @item firstpagenumber
262 The value of the page number of the first page. Default is@tie{}1.
264 @cindex @code{printfirstpagenumber}
265 @item printfirstpagenumber
266 If set to true, will print the page number in the first page. Default is
269 @cindex @code{printpagenumber}
270 @item printpagenumber
271 If set to false, page numbers will not be printed.
275 The width of the page.
279 The height of the page.
281 @cindex @code{topmargin}
283 Margin between header and top of the page.
285 @cindex @code{bottommargin}
287 Margin between footer and bottom of the page.
289 @cindex @code{leftmargin}
291 Margin between the left side of the page and the beginning of the music.
293 @cindex @code{linewidth}
295 The length of the systems.
297 @cindex @code{headsep}
299 Distance between the top-most music system and the page header.
301 @cindex @code{footsep}
303 Distance between the bottom-most music system and the page footer.
305 @cindex @code{pagetopspace}
306 Distance from the top of the printable area to the center of the first
307 staff. This only works for staves which are vertically small. Big staves
308 are set with the top of their bounding box aligned to the top of the
311 @cindex @code{raggedbottom}
313 If set to true, systems will not be spread across the page.
315 This should be set false for pieces that have only two or three
316 systems per page, for example orchestral scores.
318 @cindex @code{raggedlastbottom}
319 @item raggedlastbottom
320 If set to false, systems will be spread to fill the last page.
322 Pieces that amply fill two pages or more should have this set to
325 @cindex @code{betweensystemspace}
326 @item betweensystemspace
327 This dimensions determines the distance between systems. It is the
328 ideal distance between the center of the bottom staff of one system
329 and the center of the top staff of the next system.
331 Increasing this will provide a more even appearance of the page at the
332 cost of using more vertical space.
334 @cindex @code{betweensystempadding}
335 @item betweensystempadding
336 This dimension is the minimum amount of white space that will always
337 be present between the bottom-most symbol of one system, and the
338 top-most of the next system.
340 Increasing this will put systems whose bounding boxes almost touch
344 @cindex @code{horizontalshift}
345 @item horizontalshift
346 All systems (including titles and system separators) are shifted by
347 this amount to the right. Page markup, such as headers and footers are
348 not affected by this. The purpose of this variable is to make space
349 for instrument names at the left.
351 @cindex @code{aftertitlespace}
352 @item aftertitlespace
353 Amount of space between the title and the first system.
355 @cindex @code{aftertitlespace}
356 @item beforetitlespace
357 Amount of space between the last system of the previous piece and the
360 @cindex @code{betweentitlespace}
361 @item betweentitlespace
362 Amount of space between consecutive titles (e.g., the title of the
363 book and the title of a piece).
365 @cindex @code{printallheaders}
366 @item printallheaders
367 Setting this to #t will print all headers for each \score in a
368 \book. Normally only the piece and opus \headers are printed.
370 @cindex @code{systemSeparatorMarkup}
371 @item systemSeparatorMarkup
372 This contains a markup object, which will be inserted between
373 systems. This is often used for orchestral scores.
375 The markup command @code{\slashSeparator} is provided as a sensible
378 @lilypond[raggedright]
380 systemSeparatorMarkup = \slashSeparator
383 \relative { c1 \break c1 }
397 raggedlastbottom = ##t
401 You can also define these values in Scheme. In that case @code{mm},
402 @code{in}, @code{pt}, and @code{cm} are variables defined in
403 @file{paper-defaults.ly} with values in millimeters. That's why the
404 value has to be multiplied in the example
408 #(define bottommargin (* 2 cm))
415 The default footer is empty, except for the first page, where the
416 @code{copyright} field from @code{\header} is inserted, and the last
417 page, where @code{tagline} from @code{\header} is added. The default
418 tagline is ``Music engraving by LilyPond (@var{version})''.@footnote{Nicely
419 printed parts are good PR for us, so please leave the tagline if you
422 The header and footer are created by the functions @code{make-footer}
423 and @code{make-header}, defined in @code{\paper}. The default
424 implementations are in @file{scm/@/page@/-layout@/.scm}.
426 The page layout itself is done by two functions in the
427 @code{\paper} block, @code{page-music-height} and
428 @code{page-make-stencil}. The former tells the line-breaking algorithm
429 how much space can be spent on a page, the latter creates the actual
430 page given the system to put on it.
435 The option rightmargin is defined but doesn't set the right margin
436 yet. The value for the right margin has to be defined adjusting the
437 values of the leftmargin and linewidth.
439 The default page header puts the page number and the @code{instrument}
440 field from the @code{\header} block on a line.
444 @subsection Score layout
446 @cindex @code{\layout}
448 While @code{\paper} contains settings that relate to the page formatting
449 of the whole document, @code{\layout} contains settings for score-specific
456 minimumVerticalExtent = #'(-6 . 6
459 \override TextScript #'padding = #1.0
460 \override Glissando #'thickness = #3
468 This manual: @ref{Changing context default settings}
471 @node Vertical spacing
472 @subsection Vertical spacing
474 @cindex vertical spacing
475 @cindex distance between staves
476 @cindex staff distance
477 @cindex between staves, distance
478 @cindex staves per page
479 @cindex space between staves
481 The height of each system is determined automatically. To prevent
482 systems from bumping into each other, some minimum distances are set.
483 By changing these, you can put staves closer together, and thus put
484 more systems onto one page.
486 @c TODO: junk explanation of minimumVerticalExtent
488 Normally staves are stacked vertically. To make staves maintain a
489 distance, their vertical size is padded. This is done with the
490 property @code{minimumVerticalExtent}. It takes a pair of numbers, so
491 if you want to make it smaller than its default @code{#'(-4 . 4)},
495 \set Staff.minimumVerticalExtent = #'(-3 . 3)
499 This sets the vertical size of the current staff to 3 staff spaces on
500 either side of the center staff line. The argument of
501 @code{minimumVerticalExtent} is interpreted as an interval, where the
502 center line is the 0, so the first number is generally negative. The
503 staff can be made larger at the bottom by setting it to @code{(-6 . 4)}.
505 The spacing of staves in a system may also be tuned per system. This is
506 done with the command
510 #"Score.NonMusicalPaperColumn"
511 #'line-break-system-details
512 #'((alignment-extra-space . 15))
516 at the line break before the system to be changed. The distance
517 @code{15} is distributed over all staves that have a fixed distance
518 alignment. For example,
520 @lilypond[raggedright, fragment, relative=2, staffsize=13]
526 #"Score.NonMusicalPaperColumn"
527 #'line-break-system-details
528 #'((fixed-alignment-extra-space . 15))
536 The distance for @code{alignment-extra-space} may also be negative.
539 To change the amount of space between systems, use
540 @code{betweensystemspace}. A score with only one staff is still
541 considered to have systems, so setting @code{betweensystemspace}
542 will be much more useful than changing @code{minimumVerticalExtent}.
546 betweensystemspace = 10\mm
550 If you simply want to tell LilyPond ``fit as much as possible onto
551 these pages, then expand to fill any available space on the pages,''
552 then use the following
556 betweensystempadding = #1
563 @c let's wait for a some comments before writing more.
565 The vertical spacing on a page can also be changed for each system individually.
566 Some examples are found in the example file
567 @inputfileref{input/regression/,page-spacing.ly}.
569 When setting @code{annotatespacing} in the @code{\paper} block LilyPond
570 will graphically indicate the dimensions of properties that may be set
574 #(set-default-paper-size "a7" 'landscape)
575 \paper { annotatespacing = ##t }
583 Internals: Vertical alignment of staves is handled by the
584 @internalsref{VerticalAlignment} object. The context parameters
585 specifying the vertical extent are described in connection with
586 the @internalsref{Axis_group_engraver}.
588 Example files: @inputfileref{input/regression/,page-spacing.ly}.
593 @code{minimumVerticalExtent} is syntactic sugar for setting
594 @code{minimum-Y-extent} of the @internalsref{VerticalAxisGroup} of the
595 current context. It can only be changed score wide.
600 @node Vertical spacing of piano staves
601 @subsection Vertical spacing of piano staves
603 The distance between staves of a @internalsref{PianoStaff} cannot be
604 computed during formatting. Rather, to make cross-staff beaming work
605 correctly, that distance has to be fixed beforehand.
607 The distance of staves in a @code{PianoStaff} is set with the
608 @code{forced-distance} property of the
609 @internalsref{VerticalAlignment} object, created in
610 @internalsref{PianoStaff}.
612 It can be adjusted as follows
614 \new PianoStaff \with @{
615 \override VerticalAlignment #'forced-distance = #7
622 This would bring the staves together at a distance of 7 staff spaces,
623 measured from the center line of each staff.
625 The difference is demonstrated in the following example,
626 @lilypond[quote,verbatim]
628 \new PianoStaff \with {
629 \override VerticalAlignment #'forced-distance = #7
642 It is also possible to change the distance between for each system
643 individually. This is done by including the command
647 #"Score.NonMusicalPaperColumn"
648 #'line-break-system-details
649 #'((fixed-alignment-extra-space . 15))
653 at the line break before the system to be changed. The distance
654 @code{15} is distributed over all staves that have a fixed distance
655 alignment. For example,
657 @lilypond[raggedright, fragment, relative=2, staffsize=13]
663 #"Score.NonMusicalPaperColumn"
664 #'line-break-system-details
665 #'((fixed-alignment-extra-space . 15))
673 The distance for @code{fixed-alignment-extra-space} may also be
677 @node Horizontal spacing
678 @subsection Horizontal Spacing
680 The spacing engine translates differences in durations into stretchable
681 distances (``springs'') of differring lengths. Longer durations get
682 more space, shorter durations get less. The shortest durations get a
683 fixed amount of space (which is controlled by
684 @code{shortest-duration-space} in the @internalsref{SpacingSpanner}
685 object). The longer the duration, the more space it gets: doubling a
686 duration adds a fixed amount (this amount is controlled by
687 @code{spacing-increment}) of space to the note.
689 For example, the following piece contains lots of half, quarter, and
690 8th notes; the eighth note is followed by 1 note head width (NHW).
691 The quarter note is followed by 2 NHW, the half by 3 NHW, etc.
693 @lilypond[quote,fragment,verbatim,relative=1]
694 c2 c4. c8 c4. c8 c4. c8 c8
698 Normally, @code{spacing-increment} is set to 1.2 staff space, which is
699 approximately the width of a note head, and
700 @code{shortest-duration-space} is set to 2.0, meaning that the
701 shortest note gets 2.4 staff space (2.0 times the
702 @code{spacing-increment}) of horizontal space. This space is counted
703 from the left edge of the symbol, so the shortest notes are generally
704 followed by one NHW of space.
706 If one would follow the above procedure exactly, then adding a single
707 32nd note to a score that uses 8th and 16th notes, would widen up the
708 entire score a lot. The shortest note is no longer a 16th, but a 32nd,
709 thus adding 1 NHW to every note. To prevent this, the shortest
710 duration for spacing is not the shortest note in the score, but rather
711 the one which occurs most frequently.
714 The most common shortest duration is determined as follows: in every
715 measure, the shortest duration is determined. The most common shortest
716 duration is taken as the basis for the spacing, with the stipulation
717 that this shortest duration should always be equal to or shorter than
718 an 8th note. The shortest duration is printed when you run
719 @code{lilypond} with the @code{--verbose} option.
721 These durations may also be customized. If you set the
722 @code{common-shortest-duration} in @internalsref{SpacingSpanner}, then
723 this sets the base duration for spacing. The maximum duration for this
724 base (normally an 8th), is set through @code{base-shortest-duration}.
726 @cindex @code{common-shortest-duration}
727 @cindex @code{base-shortest-duration}
728 @cindex @code{stem-spacing-correction}
729 @cindex @code{spacing}
731 Notes that are even shorter than the common shortest note are
732 followed by a space that is proportional to their duration relative to
733 the common shortest note. So if we were to add only a few 16th notes
734 to the example above, they would be followed by half a NHW:
736 @lilypond[quote,fragment,verbatim,relative=2]
737 c2 c4. c8 c4. c16[ c] c4. c8 c8 c8 c4 c4 c4
741 In the introduction (see @ref{Engraving}), it was explained that stem
742 directions influence spacing. This is controlled with the
743 @code{stem-spacing-correction} property in the
744 @internalsref{NoteSpacing}, object. These are generated for every
745 @internalsref{Voice} context. The @code{StaffSpacing} object
746 (generated in @internalsref{Staff} context) contains the same property
747 for controlling the stem/bar line spacing. The following example shows
748 these corrections, once with default settings, and once with
749 exaggerated corrections:
751 @lilypond[quote,raggedright]
755 \override Staff.NoteSpacing #'stem-spacing-correction = #1.5
756 \override Staff.StaffSpacing #'stem-spacing-correction = #1.5
765 Internals: @internalsref{SpacingSpanner}, @internalsref{NoteSpacing},
766 @internalsref{StaffSpacing}, @internalsref{SeparationItem}, and
767 @internalsref{SeparatingGroupSpanner}.
771 Spacing is determined on a score wide basis. If you have a score that
772 changes its character (measured in durations) halfway during the
773 score, the part containing the longer durations will be spaced too
776 There is no convenient mechanism to manually override spacing. The
777 following work-around may be used to insert extra space into a score.
779 \once \override Score.SeparationItem #'padding = #1
782 No work-around exists for decreasing the amount of space.
786 @subsection Line length
789 @cindex breaking pages
791 @cindex @code{indent}
792 @cindex @code{linewidth}
793 @cindex @code{raggedright}
795 @c Although linewidth can be set in \layout, it should be set in paper
796 @c block, to get page layout right.
797 @c Setting indent in \paper block makes not much sense, but it works.
799 @c Bit verbose and vague, use examples?
800 The most basic settings influencing the spacing are @code{indent} and
801 @code{linewidth}. They are set in the @code{\layout} block. They
802 control the indentation of the first line of music, and the lengths of
805 If @code{raggedright} is set to true in the @code{\layout} block, then
806 the lines are justified at their natural length. This is useful for
807 short fragments, and for checking how tight the natural spacing is.
810 @cindex vertical spacing
812 The option @code{raggedlast} is similar to @code{raggedright}, but
813 only affects the last line of the piece. No restrictions are put on
814 that line. The result is similar to formatting text paragraphs. In a
815 paragraph, the last line simply takes its natural length.
816 @c Note that for text there are several options for the last line.
817 @c While Knuth TeX uses natural length, lead typesetters use the same
818 @c stretch as the previous line. eTeX uses \lastlinefit to
819 @c interpolate between both these solutions.
823 @subsection Line breaking
826 @cindex breaking lines
828 Line breaks are normally computed automatically. They are chosen so
829 that lines look neither cramped nor loose, and that consecutive lines
830 have similar density.
832 Occasionally you might want to override the automatic breaks; you can
833 do this by specifying @code{\break}. This will force a line break at
834 this point. Line breaks can only occur at places where there are bar
835 lines. If you want to have a line break where there is no bar line,
836 you can force an invisible bar line by entering @code{\bar
837 ""}. Similarly, @code{\noBreak} forbids a line break at a
841 @cindex regular line breaks
842 @cindex four bar music.
844 For line breaks at regular intervals use @code{\break} separated by
845 skips and repeated with @code{\repeat}:
847 << \repeat unfold 7 @{
848 s1 \noBreak s1 \noBreak
849 s1 \noBreak s1 \break @}
850 @emph{the real music}
855 This makes the following 28 measures (assuming 4/4 time) be broken every
856 4 measures, and only there.
860 @code{\break}, and @code{\noBreak}.
861 @cindex @code{\break}
862 @cindex @code{\noBreak}
866 Internals: @internalsref{BreakEvent}.
870 @subsection Page breaking
872 The default page breaking may be overriden by inserting
873 @code{\pageBreak} or @code{\noPageBreak} commands. These commands are
874 analogous to @code{\break} and @code{\noBreak}. They should be
875 inserted at a bar line. These commands force and forbid a page-break
876 from happening. Of course, the @code{\pageBreak} command also forces
879 Page breaks are computed by the @code{page-breaking} function in the
882 To force a new page for a new piece (in a collection of pieces or a
883 piece in several movements), use @code{breakbefore} in the header.
893 @cindex @code{\pageBreak}
895 @cindex @code{\noPageBreak}
899 @node Multiple movements
900 @subsection Multiple movements
902 @cindex bibliographic information
905 @cindex Music engraving by LilyPond
907 A document may contain multiple pieces of music and texts. Examples
908 of these are an etude book, or an orchestral part with multiple
909 movements. Each movement is entered with a @code{\score} block,
917 and texts are entered with a @code{\markup} block,
927 The movements and texts are combined together in a @code{\book} block,
945 The header for each piece of music can be put inside the @code{\score}
946 block. The @code{piece} name from the header will be printed before
947 each movement. The title for the entire book can be put inside the
948 @code{\book}, but if it is not present, the @code{\header} which is at
949 the top of the file is inserted.
951 @cindex Engraved by LilyPond
952 @cindex signature line
957 title = "Eight miniatures"
958 composer = "Igor Stravinsky"
962 \header @{ piece = "Romanze" @}
965 ..text of second verse..
968 ..text of third verse..
972 \header @{ piece = "Menuetto" @}
978 @node Creating titles
979 @subsection Creating titles
981 Titles are created for each @code{\score} block, and over a
984 The contents of the titles are taken from the @code{\header} blocks.
985 The header block for a book supports the following
988 The dedicatee of the music, centered at the top of the first page.
991 The title of the music, centered just below the dedication.
994 Subtitle, centered below the title.
997 Subsubtitle, centered below the subtitle.
1000 Name of the poet, flush-left below the subtitle.
1003 Name of the composer, flush-right below the subtitle.
1006 Meter string, flush-left below the poet.
1009 Name of the opus, flush-right below the composer.
1012 Name of the arranger, flush-right below the opus.
1015 Name of the instrument, centered below the arranger. Also
1016 centered at the top of pages (other than the first page).
1019 Name of the piece, flush-left below the instrument.
1021 @cindex page breaks, forcing
1023 This forces the title to start on a new page (set to ##t or ##f).
1026 Copyright notice, centered at the bottom of the first page. To
1027 insert the copyright symbol, see @ref{Text encoding}.
1030 Centered at the bottom of the last page.
1034 Here is a demonstration of the fields available. Note that you
1035 may use any @ref{Text markup} commands in the header.
1037 @lilypond[quote,verbatim,linewidth=11.0\cm]
1045 dedication = "dedicated to me"
1046 title = \markup \center-align { "Title first line" "Title second line, longer" }
1047 subtitle = "the subtitle,"
1048 subsubtitle = #(string-append "subsubtitle LilyPond version " (lilypond-version))
1050 composer = \markup \center-align { "composer" \small "(1847-1973)" }
1051 texttranslator = "Text Translator"
1052 meter = \markup { \teeny "m" \tiny "e" \normalsize "t" \large "e" \huge "r" }
1053 arranger = \markup { \fontsize #8.5 "a" \fontsize #2.5 "r" \fontsize #-2.5 "r" \fontsize #-5.3 "a" \fontsize #7.5 "nger" }
1054 instrument = \markup \bold \italic "instrument"
1078 As demonstrated before, you can use multiple @code{\header} blocks.
1079 When same fields appear in different blocks, the latter is used.
1080 Here is a short example.
1084 composer = "Composer"
1090 \new Staff @{ c'4 @}
1092 title = "New title" % overwrite previous one
1097 If you define the @code{\header} inside the @code{\score} block, then
1098 normally only the @code{piece} and @code{opus} headers will be printed.
1100 @lilypond[quote,verbatim,linewidth=11.0\cm]
1104 title = "title" % not printed
1111 @cindex @code{printallheaders}
1113 You may change this behavior (and print all the headers when defining
1114 @code{\header} inside @code{\score}) by using
1125 A more advanced option is to change the definitions of the following
1126 variables in the @code{\paper} block. The init file
1127 @file{ly/titling-init.ly} lists the default layout.
1130 @cindex @code{bookTitleMarkup}
1131 @item bookTitleMarkup
1132 This is the title put over an entire @code{\book} block. Typically,
1133 it has the composer and the title of the piece
1135 @cindex @code{scoreTitleMarkup}
1136 @item scoreTitleMarkup
1137 This is the title put over a @code{\score} block within a
1138 @code{\book}. Typically, it has the name of the movement (@code{piece}
1141 @cindex @code{oddHeaderMarkup}
1142 @item oddHeaderMarkup
1143 This is the page header for odd-numbered pages.
1145 @cindex @code{evenHeaderMarkup}
1146 @item evenHeaderMarkup
1147 This is the page header for even-numbered pages. If unspecified,
1148 the odd header is used instead.
1150 By default, headers are defined such that the page number is on the
1151 outside edge, and the instrument is centered.
1153 @cindex @code{oddFooterMarkup}
1154 @item oddFooterMarkup
1155 This is the page footer for odd-numbered pages.
1157 @cindex @code{evenFotterMarkup}
1158 @item evenFooterMarkup
1159 This is the page footer for even-numbered pages. If unspecified,
1160 the odd header is used instead.
1162 By default, the footer has the copyright notice on the first, and
1163 the tagline on the last page.
1173 The following definition will put the title flush left, and the
1174 composer flush right on a single line.
1178 bookTitleMarkup = \markup {
1180 \fromproperty #'header:title
1181 \fromproperty #'header:composer
1190 @section Sound output
1195 MIDI (Musical Instrument Digital Interface) is a standard for
1196 connecting and controlling digital instruments. A MIDI file is a
1197 series of notes in a number of tracks. It is not an actual
1198 sound file; you need special software to translate between the
1199 series of notes and actual sounds.
1201 Pieces of music can be converted to MIDI files, so you can listen to
1202 what was entered. This is convenient for checking the music; octaves
1203 that are off or accidentals that were mistyped stand out very much
1204 when listening to the MIDI output.
1208 Many musically interesting effects, such as swing, articulation,
1209 slurring, etc., are not translated to midi.
1211 The midi output allocates a channel for each staff, and one for global
1212 settings. Therefore the midi file should not have more than 15 staves
1213 (or 14 if you do not use drums). Other staves will remain silent.
1215 Not all midi players correctly handle tempo changes in the midi
1216 output. Players that are known to work include
1217 @uref{http://@/timidity@/.sourceforge@/.net/,timidity}.
1220 * Creating MIDI files::
1222 * MIDI instrument names::
1225 @node Creating MIDI files
1226 @subsection Creating MIDI files
1228 To create a MIDI from a music piece of music, add a @code{\midi} block
1229 to a score, for example,
1234 \midi @{ \tempo 4=72 @}
1238 The tempo is specified using the @code{\tempo} command. In this
1239 example the tempo of quarter notes is set to 72 beats per minute.
1242 If there is a @code{\midi} command in a @code{\score}, only MIDI will
1243 be produced. When notation is needed too, a @code{\layout} block must
1249 \midi @{ \tempo 4=72 @}
1253 @cindex layout block
1257 Ties, dynamics, and tempo changes are interpreted. Dynamic marks,
1258 crescendi and decrescendi translate into MIDI volume levels. Dynamic
1259 marks translate to a fixed fraction of the available MIDI volume
1260 range, crescendi and decrescendi make the volume vary linearly between
1261 their two extremes. The fractions can be adjusted by
1262 @code{dynamicAbsoluteVolumeFunction} in @internalsref{Voice} context.
1263 For each type of MIDI instrument, a volume range can be defined. This
1264 gives a basic equalizer control, which can enhance the quality of
1265 the MIDI output remarkably. The equalizer can be controlled by
1266 setting @code{instrumentEqualizer}.
1270 @subsection MIDI block
1274 The MIDI block is analogous to the layout block, but it is somewhat
1275 simpler. The @code{\midi} block can contain
1279 @item a @code{\tempo} definition, and
1280 @item context definitions.
1283 A number followed by a period is interpreted as a real number, so
1284 for setting the tempo for dotted notes, an extra space should be
1285 inserted, for example
1288 \midi @{ \tempo 4 . = 120 @}
1292 @cindex context definition
1294 Context definitions follow precisely the same syntax as within the
1295 \layout block. Translation modules for sound are called performers.
1296 The contexts for MIDI output are defined in @file{ly/@/performer@/-init@/.ly}.
1299 @node MIDI instrument names
1300 @subsection MIDI instrument names
1302 @cindex instrument names
1303 @cindex @code{Staff.midiInstrument}
1305 The MIDI instrument name is set by the @code{Staff.midiInstrument}
1306 property. The instrument name should be chosen from the list in
1307 @ref{MIDI instruments}.
1310 \set Staff.midiInstrument = "glockenspiel"
1314 If the selected instrument does not exactly match an instrument from
1315 the list of MIDI instruments, the Grand Piano (@code{"acoustic grand"})