1 @c -*- coding: utf-8; mode: texinfo; -*-
2 @c This file is part of lilypond.tely
4 Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
6 When revising a translation, copy the HEAD committish of the
7 version that you are working on. See TRANSLATION for details.
15 This section deals with general LilyPond input syntax issues,
16 rather than specific notation.
18 FIXME: don't complain about anything in this chapter. It's still
19 under heavy development.
23 * Titles and headers::
24 * Working with input files::
25 * Controlling output::
31 @section Input structure
33 The main format of input for LilyPond are text files. By convention,
34 these files end with @code{.ly}.
37 * Structure of a score::
38 * Multiple scores in a book::
43 @node Structure of a score
44 @subsection Structure of a score
48 A @code{\score} block must contain a single music expression
49 delimited by curly brackets:
57 @warning{There must be @strong{only one} outer music expression in
58 a @code{\score} block, and it @strong{must} be surrounded by
61 This single music expression may be of any size, and may contain
62 other music expressions to any complexity. All of these examples
63 are music expressions:
69 @lilypond[verbatim,quote]
76 @lilypond[verbatim,quote]
78 \new Staff { c'4 c' c' c' }
79 \new Staff { d'4 d' d' d' }
87 \new Staff @{ \flute @}
88 \new Staff @{ \oboe @}
91 \new Staff @{ \violinI @}
92 \new Staff @{ \violinII @}
98 Comments are one exception to this general rule. (For others see
99 @ref{File structure}.) Both single-line comments and comments
100 delimited by @code{%@{ .. %@}} may be placed anywhere within an
101 input file. They may be placed inside or outside a @code{\score}
102 block, and inside or outside the single music expression within a
109 @rlearning{Working on input files},
110 @rlearning{Music expressions explained},
111 @rlearning{Score is a (single) compound musical expression}.
114 @node Multiple scores in a book
115 @subsection Multiple scores in a book
118 @cindex movements, multiple
120 A document may contain multiple pieces of music and text. Examples
121 of these are an etude book, or an orchestral part with multiple
122 movements. Each movement is entered with a @code{\score} block,
130 and texts are entered with a @code{\markup} block,
140 All the movements and texts which appear in the same @code{.ly} file
141 will normally be typeset in the form of a single output file.
155 However, if you want multiple output files from the same @code{.ly}
156 file, then you can add multiple @code{\book} blocks, where each such
157 @code{\book} block will result in a separate output. If you do not
158 specify any @code{\book} block in the file, LilyPond will implicitly
159 treat the full file as a single @code{\book} block, see @ref{File
160 structure}. One important exception is within lilypond-book documents,
161 where you explicitly have to add a @code{\book} block, otherwise only
162 the first @code{\score} or @code{\markup} will appear in the output.
164 The header for each piece of music can be put inside the @code{\score}
165 block. The @code{piece} name from the header will be printed before
166 each movement. The title for the entire book can be put inside the
167 @code{\book}, but if it is not present, the @code{\header} which is at
168 the top of the file is inserted.
172 title = "Eight miniatures"
173 composer = "Igor Stravinsky"
177 \header @{ piece = "Romanze" @}
180 ..text of second verse..
183 ..text of third verse..
187 \header @{ piece = "Menuetto" @}
192 @subsection File structure
201 A @code{.ly} file may contain any number of toplevel expressions, where a
202 toplevel expression is one of the following:
206 An output definition, such as @code{\paper}, @code{\midi}, and
207 @code{\layout}. Such a definition at the toplevel changes the default
208 book-wide settings. If more than one such definition of
209 the same type is entered at the top level any definitions in the later
210 expressions have precedence.
213 A direct scheme expression, such as
214 @code{#(set-default-paper-size "a7" 'landscape)} or
215 @code{#(ly:set-option 'point-and-click #f)}.
218 A @code{\header} block. This sets the global header block. This
219 is the block containing the definitions for book-wide settings, like
220 composer, title, etc.
223 A @code{\score} block. This score will be collected with other
224 toplevel scores, and combined as a single @code{\book}.
225 This behavior can be changed by setting the variable
226 @code{toplevel-score-handler} at toplevel. The default handler is
227 defined in the init file @file{scm/@/lily@/.scm}.
230 A @code{\book} block logically combines multiple movements
231 (i.e., multiple @code{\score} blocks) in one document. If there
232 are a number of @code{\score}s, one output file will be created
233 for each @code{\book} block, in which all corresponding movements
234 are concatenated. The only reason to explicitly specify
235 @code{\book} blocks in a @code{.ly} file is if you wish to create
236 multiple output files from a single input file. One exception is
237 within lilypond-book documents, where you explicitly have to add
238 a @code{\book} block if you want more than a single @code{\score}
239 or @code{\markup} in the same example. This behavior can be
240 changed by setting the variable @code{toplevel-book-handler} at
241 toplevel. The default handler is defined in the init file
242 @file{scm/@/lily@/.scm}.
245 A compound music expression, such as
250 This will add the piece in a @code{\score} and format it in a
251 single book together with all other toplevel @code{\score}s and music
252 expressions. In other words, a file containing only the above
253 music expression will be translated into
269 This behavior can be changed by setting the variable
270 @code{toplevel-music-handler} at toplevel. The default handler is
271 defined in the init file @file{scm/@/lily@/.scm}.
274 A markup text, a verse for example
277 2. The first line verse two.
281 Markup texts are rendered above, between or below the scores or music
282 expressions, wherever they appear.
292 This can be used later on in the file by entering @code{\foo}. The
293 name of an variable should have alphabetic characters only; no
294 numbers, underscores or dashes.
298 The following example shows three things that may be entered at
303 % Don't justify the output
315 At any point in a file, any of the following lexical instructions can
319 @item @code{\version}
320 @item @code{\include}
321 @item @code{\sourcefilename}
322 @item @code{\sourcefileline}
324 A single-line comment, introduced by a leading @code{%} sign.
327 A multi-line comment delimited by @code{%@{ .. %@}}.
334 @rlearning{How LilyPond input files work}.
336 @node Titles and headers
337 @section Titles and headers
339 Almost all printed music includes a title and the composer's name;
340 some pieces include a lot more information.
345 * Reference to page numbers::
346 * Table of contents::
350 @node Creating titles
351 @subsection Creating titles
353 Titles are created for each @code{\score} block, as well as for the full
354 input file (or @code{\book} block).
356 The contents of the titles are taken from the @code{\header} blocks.
357 The header block for a book supports the following
363 The dedicatee of the music, centered at the top of the first page.
367 The title of the music, centered just below the dedication.
371 Subtitle, centered below the title.
373 @funindex subsubtitle
375 Subsubtitle, centered below the subtitle.
379 Name of the poet, flush-left below the subtitle.
383 Name of the composer, flush-right below the subtitle.
387 Meter string, flush-left below the poet.
391 Name of the opus, flush-right below the composer.
395 Name of the arranger, flush-right below the opus.
399 Name of the instrument, centered below the arranger. Also
400 centered at the top of pages (other than the first page).
404 Name of the piece, flush-left below the instrument.
406 @cindex page breaks, forcing
407 @funindex breakbefore
409 This forces the title to start on a new page (set to ##t or ##f).
413 Copyright notice, centered at the bottom of the first page. To
414 insert the copyright symbol, see @ref{Text encoding}.
418 Centered at the bottom of the last page.
422 Here is a demonstration of the fields available. Note that you
423 may use any @ref{Formatting text}, commands in the header.
425 @lilypond[quote,verbatim,line-width=11.0\cm]
428 paper-height = 10.0\cm
433 dedication = "dedicated to me"
434 title = \markup \center-align { "Title first line" "Title second line,
436 subtitle = "the subtitle,"
437 subsubtitle = #(string-append "subsubtitle LilyPond version "
440 composer = \markup \center-align { "composer" \small "(1847-1973)" }
441 texttranslator = "Text Translator"
442 meter = \markup { \teeny "m" \tiny "e" \normalsize "t" \large "e" \huge
444 arranger = \markup { \fontsize #8.5 "a" \fontsize #2.5 "r" \fontsize
445 #-2.5 "r" \fontsize #-5.3 "a" \fontsize #7.5 "nger" }
446 instrument = \markup \bold \italic "instrument"
470 As demonstrated before, you can use multiple @code{\header} blocks.
471 When same fields appear in different blocks, the latter is used.
472 Here is a short example.
476 composer = "Composer"
484 piece = "New piece" % overwrite previous one
489 If you define the @code{\header} inside the @code{\score} block, then
490 normally only the @code{piece} and @code{opus} headers will be printed.
491 Note that the music expression must come before the @code{\header}.
493 @lilypond[quote,verbatim,line-width=11.0\cm]
497 title = "title" % not printed
504 @funindex printallheaders
506 You may change this behavior (and print all the headers when defining
507 @code{\header} inside @code{\score}) by using
518 The default footer is empty, except for the first page, where the
519 @code{copyright} field from @code{\header} is inserted, and the last
520 page, where @code{tagline} from @code{\header} is added. The default
521 tagline is @qq{Music engraving by LilyPond (@var{version})}.@footnote{Nicely
522 printed parts are good PR for us, so please leave the tagline if you
525 Headers may be completely removed by setting them to false.
536 @subsection Custom titles
538 A more advanced option is to change the definitions of the following
539 variables in the @code{\paper} block. The init file
540 @file{ly/titling-init.ly} lists the default layout.
543 @funindex bookTitleMarkup
544 @item bookTitleMarkup
545 This is the title added at the top of the entire output document.
546 Typically, it has the composer and the title of the piece
548 @funindex scoreTitleMarkup
549 @item scoreTitleMarkup
550 This is the title put over a @code{\score} block. Typically, it has
551 the name of the movement (@code{piece} field).
553 @funindex oddHeaderMarkup
554 @item oddHeaderMarkup
555 This is the page header for odd-numbered pages.
557 @funindex evenHeaderMarkup
558 @item evenHeaderMarkup
559 This is the page header for even-numbered pages. If unspecified,
560 the odd header is used instead.
562 By default, headers are defined such that the page number is on the
563 outside edge, and the instrument is centered.
565 @funindex oddFooterMarkup
566 @item oddFooterMarkup
567 This is the page footer for odd-numbered pages.
569 @funindex evenFooterMarkup
570 @item evenFooterMarkup
571 This is the page footer for even-numbered pages. If unspecified,
572 the odd header is used instead.
574 By default, the footer has the copyright notice on the first, and
575 the tagline on the last page.
585 The following definition will put the title flush left, and the
586 composer flush right on a single line.
590 bookTitleMarkup = \markup {
592 \fromproperty #'header:title
593 \fromproperty #'header:composer
599 @node Reference to page numbers
600 @subsection Reference to page numbers
602 A particular place of a score can be marked using the @code{\label}
603 command, either at top-level or inside music. This label can then be
604 referred to in a markup, to get the number of the page where the marked
605 point is placed, using the @code{\page-ref} markup command.
607 @lilypond[verbatim,line-width=11.0\cm]
608 \header { tagline = ##f }
614 \pageBreak \mark A \label #'markA
619 \markup { The first score begins on page \page-ref #'firstScore "0" "?" }
620 \markup { Mark A is on page \page-ref #'markA "0" "?" }
624 The @code{\page-ref} markup command takes three arguments:
626 @item the label, a scheme symbol, eg. @code{#'firstScore};
627 @item a markup that will be used as a gauge to estimate the dimensions
629 @item a markup that will be used in place of the page number if the label
633 The reason why a gauge is needed is that, at the time markups are
634 interpreted, the page breaking has not yet occurred, so the page numbers
635 are not yet known. To work around this issue, the actual markup
636 interpretation is delayed to a later time; however, the dimensions of
637 the markup have to be known before, so a gauge is used to decide these
638 dimensions. If the book has between 10 and 99 pages, it may be "00",
639 ie. a two digit number.
648 @node Table of contents
649 @subsection Table of contents
650 A table of contents is included using the @code{\markuplines \table-of-contents}
651 command. The elements which should appear in the table of contents are
652 entered with the @code{\tocItem} command, which may be used either at
653 top-level, or inside a music expression.
656 \markuplines \table-of-contents
659 \tocItem \markup "First score"
663 \tocItem \markup "Some particular point in the first score"
668 \tocItem \markup "Second score"
676 The markups which are used to format the table of contents are defined
677 in the @code{\paper} block. The default ones are @code{tocTitleMarkup},
678 for formatting the title of the table, and @code{tocItemMarkup}, for
679 formatting the toc elements, composed of the element title and page
680 number. These variables may be changed by the user:
684 %% Translate the toc title into French:
685 tocTitleMarkup = \markup \huge \column {
686 \fill-line { \null "Table des matières" \null }
689 %% use larger font size
690 tocItemMarkup = \markup \large \fill-line {
691 \fromproperty #'toc:text \fromproperty #'toc:page
696 Note how the toc element text and page number are referred to in
697 the @code{tocItemMarkup} definition.
699 New commands and markups may also be defined to build more elaborated
702 @item first, define a new markup variable in the @code{\paper} block
703 @item then, define a music function which aims at adding a toc element
704 using this markup paper variable.
707 In the following example, a new style is defined for entering act names
708 in the table of contents of an opera:
712 tocActMarkup = \markup \large \column {
714 \fill-line { \null \italic \fromproperty #'toc:text \null }
720 #(define-music-function (parser location text) (markup?)
721 (add-toc-item! 'tocActMarkup text))
724 @lilypond[line-width=11.0\cm]
725 \header { tagline = ##f }
727 tocActMarkup = \markup \large \column {
729 \fill-line { \null \italic \fromproperty #'toc:text \null }
735 #(define-music-function (parser location text) (markup?)
736 (add-toc-item! 'tocActMarkup text))
739 \markuplines \table-of-contents
740 \tocAct \markup { Atto Primo }
741 \tocItem \markup { Coro. Viva il nostro Alcide }
742 \tocItem \markup { Cesare. Presti omai l'Egizzia terra }
743 \tocAct \markup { Atto Secondo }
744 \tocItem \markup { Sinfonia }
745 \tocItem \markup { Cleopatra. V'adoro, pupille, saette d'Amore }
752 Init files: @file{ly/@/toc@/-init@/.ly}.
756 @funindex \table-of-contents
757 @code{\table-of-contents}
762 @node Working with input files
763 @section Working with input files
766 * Including LilyPond files::
767 * Different editions from one source::
769 * Displaying LilyPond notation::
773 @node Including LilyPond files
774 @subsection Including LilyPond files
777 @cindex including files
779 A large project may be split up into separate files. To refer to another
783 \include "otherfile.ly"
786 The line @code{\include "file.ly"} is equivalent to pasting the contents
787 of file.ly into the current file at the place where you have the
788 \include. For example, for a large project you might write separate files
789 for each instrument part and create a @q{full score} file which brings
790 together the individual instrument files.
792 The initialization of LilyPond is done in a number of files that are
793 included by default when you start the program, normally transparent to the
794 user. Run @code{lilypond --verbose} to see a list of paths and files that Lily
797 Files placed in directory @file{PATH/TO/share/lilypond/VERSION/ly/} (where
798 VERSION is in the form @q{2.6.1}) are on the path and available to
799 @code{\include}. Files in the
800 current working directory are available to \include, but a file of the same
801 name in LilyPond's installation takes precedence. Files are
802 available to \include from directories in the search path specified as an
803 option when invoking @code{lilypond --include=DIR} which adds DIR to the
806 The @code{\include} statement can use full path information, but with the UNIX
807 convention @code{/} rather than the DOS/Windows @code{\}. For example,
808 if @file{stuff.ly} is located one directory higher than the current working
812 \include "../stuff.ly"
816 @node Different editions from one source
817 @subsection Different editions from one source
822 The @code{\tag} command marks music expressions with a name. These
823 tagged expressions can be filtered out later. With this mechanism it
824 is possible to make different versions of the same music source.
826 In the following example, we see two versions of a piece of music, one
827 for the full score, and one with cue notes for the instrumental part
843 The same can be applied to articulations, texts, etc.: they are
846 -\tag #@var{your-tag}
848 to an articulation, for example,
853 This defines a note with a conditional fingering indication.
856 @cindex removeWithTag
857 By applying the @code{\keepWithTag} and @code{\removeWithTag}
858 commands, tagged expressions can be filtered. For example,
862 \keepWithTag #'score @var{the music}
863 \keepWithTag #'part @var{the music}
869 @c @lilypondfile[ragged-right,quote]{tag-filter.ly}
871 The arguments of the @code{\tag} command should be a symbol
872 (such as @code{#'score} or @code{#'part}), followed by a
873 music expression. It is possible to put multiple tags on
874 a piece of music with multiple @code{\tag} entries,
877 \tag #'original-part \tag #'transposed-part @dots{}
883 Multiple rests are not merged if you create the score with both tagged
888 @subsection Text encoding
890 LilyPond uses the Pango library to format multi-lingual texts, and
891 does not perform any input-encoding conversions. This means that any
892 text, be it title, lyric text, or musical instruction containing
893 non-ASCII characters, must be utf-8. The easiest way to enter such text is
894 by using a Unicode-aware editor and saving the file with utf-8 encoding. Most
895 popular modern editors have utf-8 support, for example, vim, Emacs,
898 @c Currently not working
900 Depending on the fonts installed, the following fragment shows Hebrew
907 @li lypondfile[fontload]{utf-8.ly}
909 The @TeX{} backend does not handle encoding specially at all. Strings
910 in the input are put in the output as-is. Extents of text items in the
911 @TeX{} backend, are determined by reading a file created via the
912 @file{texstr} backend,
915 lilypond -dbackend=texstr input/les-nereides.ly
916 latex les-nereides.texstr
919 The last command produces @file{les-nereides.textmetrics}, which is
920 read when you execute
923 lilypond -dbackend=tex input/les-nereides.ly
926 Both @file{les-nereides.texstr} and @file{les-nereides.tex} need
927 suitable LaTeX wrappers to load appropriate La@TeX{} packages for
928 interpreting non-ASCII strings.
932 To use a Unicode escape sequence, use
935 #(ly:export (ly:wide-char->utf-8 #x2014))
939 @node Displaying LilyPond notation
940 @subsection Displaying LilyPond notation
942 @funindex \displayLilyMusic
943 Displaying a music expression in LilyPond notation can be
944 done using the music function @code{\displayLilyMusic}. For example,
948 \displayLilyMusic \transpose c a, @{ c e g a bes @}
958 By default, LilyPond will print these messages to the console along
959 with all the other messages. To split up these messages and save
960 the results of @code{\display@{STUFF@}}, redirect the output to
964 lilypond file.ly >display.txt
969 @node Controlling output
970 @section Controlling output
973 * Extracting fragments of music::
974 * Skipping corrected music::
977 @node Extracting fragments of music
978 @subsection Extracting fragments of music
980 It is possible to quote small fragments of a large score directly from
981 the output. This can be compared to clipping a piece of a paper score
984 This is done by defining the measures that need to be cut out
985 separately. For example, including the following definition
993 (make-rhythmic-location 5 1 2)
994 (make-rhythmic-location 7 3 4)))
999 will extract a fragment starting halfway the fifth measure, ending in
1000 the seventh measure. The meaning of @code{5 1 2} is: after a 1/2 note
1001 in measure 5, and @code{7 3 4} after 3 quarter notes in measure 7.
1003 More clip regions can be defined by adding more pairs of
1004 rhythmic-locations to the list.
1006 In order to use this feature, LilyPond must be invoked with
1007 @code{-dclip-systems}. The clips are output as EPS files, and are
1008 converted to PDF and PNG if these formats are switched on as well.
1010 For more information on output formats, see @rprogram{Invoking lilypond}.
1012 @node Skipping corrected music
1013 @subsection Skipping corrected music
1016 @funindex skipTypesetting
1017 @funindex showLastLength
1019 When entering or copying music, usually only the music near the end (where
1021 are adding notes) is interesting to view and correct. To speed up
1022 this correction process, it is possible to skip typesetting of all but
1023 the last few measures. This is achieved by putting
1026 showLastLength = R1*5
1031 in your source file. This will render only the last 5 measures
1032 (assuming 4/4 time signature) of every @code{\score} in the input
1033 file. For longer pieces, rendering only a small part is often an order
1034 of magnitude quicker than rendering it completely
1036 Skipping parts of a score can be controlled in a more fine-grained
1037 fashion with the property @code{Score.skipTypesetting}. When it is
1038 set, no typesetting is performed at all.
1040 This property is also used to control output to the MIDI file. Note that
1041 it skips all events, including tempo and instrument changes. You have
1044 @lilypond[quote,fragment,ragged-right,verbatim]
1047 \set Score.skipTypesetting = ##t
1049 \set Score.skipTypesetting = ##f
1053 In polyphonic music, @code{Score.skipTypesetting} will affect all
1054 voices and staves, saving even more time.
1059 @section MIDI output
1064 MIDI (Musical Instrument Digital Interface) is a standard for
1065 connecting and controlling digital instruments. A MIDI file is a
1066 series of notes in a number of tracks. It is not an actual
1067 sound file; you need special software to translate between the
1068 series of notes and actual sounds.
1070 Pieces of music can be converted to MIDI files, so you can listen to
1071 what was entered. This is convenient for checking the music; octaves
1072 that are off or accidentals that were mistyped stand out very much
1073 when listening to the MIDI output.
1077 Many musically interesting effects, such as swing, articulation,
1078 slurring, etc., are not translated to midi.
1080 The midi output allocates a channel for each staff, and one for global
1081 settings. Therefore the midi file should not have more than 15 staves
1082 (or 14 if you do not use drums). Other staves will remain silent.
1084 Not all midi players correctly handle tempo changes in the midi
1085 output. Players that are known to work include
1086 @uref{http://@/timidity@/.sourceforge@/.net/,timidity}.
1089 * Creating MIDI files::
1091 * MIDI instrument names::
1092 * What goes into the MIDI? FIXME::
1096 @node Creating MIDI files
1097 @subsection Creating MIDI files
1099 To create a MIDI from a music piece of music, add a @code{\midi} block
1100 to a score, for example,
1108 tempoWholesPerMinute = #(ly:make-moment 72 4)
1114 The tempo can be specified using the @code{\tempo} command within the
1115 actual music, see @ref{Metronome marks}. An alternative, which does not
1116 result in a metronome mark in the printed score, is shown in the example
1117 above. In this example the tempo of quarter notes is set to 72 beats per
1120 specification can not take dotted note lengths as an argument. In this
1121 case, break the dotted notes into smaller units. For example, a tempo
1122 of 90 dotted quarter notes per minute can be specified as 270 eighth
1126 tempoWholesPerMinute = #(ly:make-moment 270 8)
1129 If there is a @code{\midi} command in a @code{\score}, only MIDI will
1130 be produced. When notation is needed too, a @code{\layout} block must
1140 @cindex layout block
1144 Ties, dynamics, and tempo changes are interpreted. Dynamic marks,
1145 crescendi and decrescendi translate into MIDI volume levels. Dynamic
1146 marks translate to a fixed fraction of the available MIDI volume
1147 range, crescendi and decrescendi make the volume vary linearly between
1148 their two extremes. The fractions can be adjusted by
1149 @code{dynamicAbsoluteVolumeFunction} in @rinternals{Voice} context.
1150 For each type of MIDI instrument, a volume range can be defined. This
1151 gives a basic equalizer control, which can enhance the quality of
1152 the MIDI output remarkably. The equalizer can be controlled by
1153 setting @code{instrumentEqualizer}, or by setting
1156 \set Staff.midiMinimumVolume = #0.2
1157 \set Staff.midiMaximumVolume = #0.8
1160 To remove dynamics from the MIDI output, insert the following lines
1161 in the @code{\midi@{@}} section.
1168 \remove "Dynamic_performer"
1176 Unterminated (de)crescendos will not render properly in the midi file,
1177 resulting in silent passages of music. The workaround is to explicitly
1178 terminate the (de)crescendo. For example,
1185 will not work properly but
1195 MIDI output is only created when the @code{\midi} command is within
1196 a @code{\score} block. If you put it within an explicitly instantiated
1197 context ( i.e. @code{\new Score} ) the file will fail. To solve this,
1198 enclose the @code{\new Score} and the @code{\midi} in a @code{\score} block.
1202 \new Score @{ @dots{}notes@dots{} @}
1209 @subsection MIDI block
1213 The MIDI block is analogous to the layout block, but it is somewhat
1214 simpler. The @code{\midi} block is similar to @code{\layout}. It can contain
1215 context definitions.
1218 @cindex context definition
1220 Context definitions follow precisely the same syntax as within the
1221 \layout block. Translation modules for sound are called performers.
1222 The contexts for MIDI output are defined in @file{ly/@/performer@/-init@/.ly}.
1225 @node MIDI instrument names
1226 @subsection MIDI instrument names
1228 @cindex instrument names
1229 @funindex Staff.midiInstrument
1231 The MIDI instrument name is set by the @code{Staff.midiInstrument}
1232 property. The instrument name should be chosen from the list in
1233 @ref{MIDI instruments}.
1236 \set Staff.midiInstrument = "glockenspiel"
1240 If the selected instrument does not exactly match an instrument from
1241 the list of MIDI instruments, the Grand Piano (@code{"acoustic grand"})
1245 @node What goes into the MIDI? FIXME
1246 @subsection What goes into the MIDI? FIXME
1249 * Repeats and MIDI::
1252 @node Repeats and MIDI
1253 @subsubsection Repeats and MIDI
1255 @cindex expanding repeats
1256 @funindex \unfoldRepeats
1258 With a little bit of tweaking, all types of repeats can be present
1259 in the MIDI output. This is achieved by applying the
1260 @code{\unfoldRepeats} music function. This function changes all
1261 repeats to unfold repeats.
1263 @lilypond[quote,verbatim,fragment,line-width=8.0\cm]
1265 \repeat tremolo 8 {c'32 e' }
1266 \repeat percent 2 { c''8 d'' }
1267 \repeat volta 2 {c'4 d' e' f'}
1276 When creating a score file using @code{\unfoldRepeats} for MIDI,
1277 it is necessary to make two @code{\score} blocks: one for MIDI
1278 (with unfolded repeats) and one for notation (with volta, tremolo,
1279 and percent repeats). For example,
1287 \unfoldRepeats @var{..music..}
1294 @subsection other midi
1296 Micro tones are also exported to the MIDI file.
1298 Figured bass has no effect on MIDI.