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.
12 @c A menu is needed before every deeper *section nesting of @node's; run
13 @c M-x texinfo-all-menus-update
14 @c to automatically fill in these menus before saving changes
16 @node Non-musical notation
17 @chapter Non-musical notation
19 This section deals with general LilyPond issues, rather than
34 MIDI (Musical Instrument Digital Interface) is a standard for
35 connecting and controlling digital instruments. A MIDI file is a
36 series of notes in a number of tracks. It is not an actual
37 sound file; you need special software to translate between the
38 series of notes and actual sounds.
40 Pieces of music can be converted to MIDI files, so you can listen to
41 what was entered. This is convenient for checking the music; octaves
42 that are off or accidentals that were mistyped stand out very much
43 when listening to the MIDI output.
47 Many musically interesting effects, such as swing, articulation,
48 slurring, etc., are not translated to midi.
50 The midi output allocates a channel for each staff, and one for global
51 settings. Therefore the midi file should not have more than 15 staves
52 (or 14 if you do not use drums). Other staves will remain silent.
54 Not all midi players correctly handle tempo changes in the midi
55 output. Players that are known to work include
56 @uref{http://@/timidity@/.sourceforge@/.net/,timidity}.
59 * Creating MIDI files::
61 * MIDI instrument names::
62 * What goes into the MIDI? FIXME::
65 @node Creating MIDI files
66 @subsection Creating MIDI files
68 To create a MIDI from a music piece of music, add a @code{\midi} block
69 to a score, for example,
77 tempoWholesPerMinute = #(ly:make-moment 72 4)
83 The tempo can be specified using the @code{\tempo} command within the
84 actual music, see @ref{Metronome marks}. An alternative, which does not
85 result in a metronome mark in the printed score, is shown in the example
86 above. In this example the tempo of quarter notes is set to 72 beats per
89 specification can not take dotted note lengths as an argument. In this
90 case, break the dotted notes into smaller units. For example, a tempo
91 of 90 dotted quarter notes per minute can be specified as 270 eighth
95 tempoWholesPerMinute = #(ly:make-moment 270 8)
98 If there is a @code{\midi} command in a @code{\score}, only MIDI will
99 be produced. When notation is needed too, a @code{\layout} block must
113 Ties, dynamics, and tempo changes are interpreted. Dynamic marks,
114 crescendi and decrescendi translate into MIDI volume levels. Dynamic
115 marks translate to a fixed fraction of the available MIDI volume
116 range, crescendi and decrescendi make the volume vary linearly between
117 their two extremes. The fractions can be adjusted by
118 @code{dynamicAbsoluteVolumeFunction} in @rinternals{Voice} context.
119 For each type of MIDI instrument, a volume range can be defined. This
120 gives a basic equalizer control, which can enhance the quality of
121 the MIDI output remarkably. The equalizer can be controlled by
122 setting @code{instrumentEqualizer}, or by setting
125 \set Staff.midiMinimumVolume = #0.2
126 \set Staff.midiMaximumVolume = #0.8
129 To remove dynamics from the MIDI output, insert the following lines
130 in the @code{\midi@{@}} section.
137 \remove "Dynamic_performer"
145 Unterminated (de)crescendos will not render properly in the midi file,
146 resulting in silent passages of music. The workaround is to explicitly
147 terminate the (de)crescendo. For example,
154 will not work properly but
164 MIDI output is only created when the @code{\midi} command is within
165 a @code{\score} block. If you put it within an explicitly instantiated
166 context ( i.e. @code{\new Score} ) the file will fail. To solve this,
167 enclose the @code{\new Score} and the @code{\midi} in a @code{\score} block.
171 \new Score @{ @dots{}notes@dots{} @}
178 @subsection MIDI block
182 The MIDI block is analogous to the layout block, but it is somewhat
183 simpler. The @code{\midi} block is similar to @code{\layout}. It can contain
187 @cindex context definition
189 Context definitions follow precisely the same syntax as within the
190 \layout block. Translation modules for sound are called performers.
191 The contexts for MIDI output are defined in @file{ly/@/performer@/-init@/.ly}.
194 @node MIDI instrument names
195 @subsection MIDI instrument names
197 @cindex instrument names
198 @funindex Staff.midiInstrument
200 The MIDI instrument name is set by the @code{Staff.midiInstrument}
201 property. The instrument name should be chosen from the list in
202 @ref{MIDI instruments}.
205 \set Staff.midiInstrument = "glockenspiel"
209 If the selected instrument does not exactly match an instrument from
210 the list of MIDI instruments, the Grand Piano (@code{"acoustic grand"})
214 @node What goes into the MIDI? FIXME
215 @subsection What goes into the MIDI? FIXME
221 @node Repeats and MIDI
222 @subsubsection Repeats and MIDI
224 @cindex expanding repeats
225 @funindex \unfoldRepeats
227 With a little bit of tweaking, all types of repeats can be present
228 in the MIDI output. This is achieved by applying the
229 @code{\unfoldRepeats} music function. This function changes all
230 repeats to unfold repeats.
232 @lilypond[quote,verbatim,fragment,line-width=8.0\cm]
234 \repeat tremolo 8 {c'32 e' }
235 \repeat percent 2 { c''8 d'' }
236 \repeat volta 2 {c'4 d' e' f'}
245 When creating a score file using @code{\unfoldRepeats} for MIDI,
246 it is necessary to make two @code{\score} blocks: one for MIDI
247 (with unfolded repeats) and one for notation (with volta, tremolo,
248 and percent repeats). For example,
256 \unfoldRepeats @var{..music..}
265 Micro tones are also exported to the MIDI file.
267 Figured bass has no effect on MIDI.