1 @c -*- coding: utf-8; mode: texinfo; -*-
3 @node Converting from other formats
4 @chapter Converting from other formats
6 Music can be entered also by importing it from other formats. This
7 chapter documents the tools included in the distribution to do so.
8 There are other tools that produce LilyPond input, for example GUI
9 sequencers and XML converters. Refer to the
10 @uref{http://@/lilypond@/.org,website} for more details.
12 These are separate programs from lilypond itself, and are run
13 on the command-line. By ``command-line'', we mean the command
14 line in the operating system. Windows users
15 might be more familiar with the terms ``DOS shell'' or
16 ``command shell''; OSX users might be more familiar with the
17 terms ``terminal'' or ``console''. OSX users should also
18 consult @ref{Notes for the MacOS X app}.
21 this part of an operating system is outside the scope of this
22 manual; please consult other documentation on this topic if
23 you are unfamiliar with the command-line.
28 * Invoking midi2ly:: Importing MIDI.
29 * Invoking etf2ly:: Importing Finale.
30 * Invoking musicxml2ly::
31 * Invoking abc2ly:: Importing ABC.
32 * Invoking mup2ly:: Importing MUP.
33 * Generating LilyPond files::
38 @node Invoking midi2ly
39 @section Invoking @command{midi2ly}
43 @command{midi2ly} translates a Type@tie{}1 MIDI file to a LilyPond source
46 MIDI (Music Instrument Digital Interface) is a standard for digital
47 instruments: it specifies cabling, a serial protocol and a file
48 format. The MIDI file format is a de facto standard format for
49 exporting music from other programs, so this capability may come in
50 useful when importing files from a program that has a convertor for a
53 @command{midi2ly} converts tracks into @internalsref{Staff} and
54 channels into @internalsref{Voice} contexts. Relative mode is used
55 for pitches, durations are only written when necessary.
57 It is possible to record a MIDI file using a digital keyboard, and
58 then convert it to @file{.ly}. However, human players are not
59 rhythmically exact enough to make a MIDI to LY conversion trivial.
60 When invoked with quantizing (@code{-s} and @code{-d} options)
61 @command{midi2ly} tries to compensate for these timing errors, but is not
62 very good at this. It is therefore not recommended to use @command{midi2ly}
63 for human-generated midi files.
66 It is invoked from the command-line as follows,
68 midi2ly [@var{option}]@dots{} @var{midi-file}
71 Note that by ``command-line'', we mean the command line of the
72 operating system. See @ref{Converting from other formats} for
73 more information about this.
75 The following options are supported by @command{midi2ly}.
78 @item -a, --absolute-pitches
79 Print absolute pitches.
81 @item -d, --duration-quant=@var{DUR}
82 Quantize note durations on @var{DUR}.
84 @item -e, --explicit-durations
85 Print explicit durations.
88 Show summary of usage.
90 @item -k, --key=@var{acc}[:@var{minor}]
91 Set default key. @math{@var{acc} > 0} sets number of sharps;
92 @math{@var{acc} < 0} sets number of flats. A minor key is indicated by
95 @item -o, --output=@var{file}
96 Write output to @var{file}.
98 @item -s, --start-quant=@var{DUR}
99 Quantize note starts on DUR.
101 @item -t, --allow-tuplet=@var{DUR}*@var{NUM}/@var{DEN}
102 Allow tuplet durations @var{DUR}*@var{NUM}/@var{DEN}.
108 Print version number.
111 Show warranty and copyright.
113 @item -x, --text-lyrics
114 Treat every text as a lyric.
120 Overlapping notes in an arpeggio will not be correctly rendered. The
121 first note will be read and the others will be ignored. Set them all
122 to a single duration and add phrase markings or pedal indicators.
125 @node Invoking etf2ly
126 @section Invoking @command{etf2ly}
131 @cindex Coda Technology
133 ETF (Enigma Transport Format) is a format used by Coda Music
134 Technology's Finale product. @command{etf2ly} will convert part of an ETF
135 file to a ready-to-use LilyPond file.
137 It is invoked from the command-line as follows.
140 etf2ly [@var{option}]@dots{} @var{etf-file}
143 Note that by ``command-line'', we mean the command line of the
144 operating system. See @ref{Converting from other formats} for
145 more information about this.
147 The following options are supported by @command{etf2ly}:
152 @item -o,--output=FILE
153 set output filename to FILE
161 The list of articulation scripts is incomplete. Empty measures
162 confuse @command{etf2ly}. Sequences of grace notes are ended improperly.
164 @node Invoking musicxml2ly
165 @section Invoking @code{musicxml2ly}
167 @uref{http://@/www.@/recordarde@/.com/xml@/.html,MusicXML} is an XML dialect
168 for representing music notation.
170 @command{musicxml2ly} extracts the notes from part-wise MusicXML
171 files, and writes it to a .ly file. It is invoked from the command-line.
173 Note that by ``command-line'', we mean the command line of the
174 operating system. See @ref{Converting from other formats} for
175 more information about this.
177 The following options are supported by @command{musicxml2ly}:
181 print usage and option summary.
182 @item -o,--output=@var{file}
183 set output filename to @var{file}. (default: print to stdout)
185 print version information.
188 @node Invoking abc2ly
189 @section Invoking @code{abc2ly}
193 ABC is a fairly simple ASCII based format. It is described at the ABC site:
196 @uref{http://@/www@/.gre@/.ac@/.uk/@/~c.walshaw/@/abc2mtex/@/abc@/.txt}.
199 @command{abc2ly} translates from ABC to LilyPond. It is invoked as follows:
202 abc2ly [@var{option}]@dots{} @var{abc-file}
205 The following options are supported by @command{abc2ly}:
210 @item -o,--output=@var{file}
211 set output filename to @var{file}.
213 print version information.
216 There is a rudimentary facility for adding LilyPond code to the ABC
217 source file. If you say:
220 %%LY voices \set autoBeaming = ##f
223 This will cause the text following the keyword ``voices'' to be inserted
224 into the current voice of the LilyPond output file.
229 %%LY slyrics more words
232 will cause the text following the ``slyrics'' keyword to be inserted
233 into the current line of lyrics.
238 The ABC standard is not very ``standard''. For extended features
239 (e.g., polyphonic music) different conventions exist.
241 Multiple tunes in one file cannot be converted.
243 ABC synchronizes words and notes at the beginning of a line;
244 @command{abc2ly} does not.
246 @command{abc2ly} ignores the ABC beaming.
249 @node Invoking mup2ly
250 @section Invoking @command{mup2ly}
252 Mup (Music Publisher) is a shareware music notation program by Arkkra
253 Enterprises. @command{mup2ly} will convert part of a Mup file to LilyPond
254 format. It is invoked from the command-line as follows:
256 @cindex Music Publisher
261 mup2ly [@var{option}]@dots{} @var{mup-file}
264 The following options are supported by @command{mup2ly}:
268 show what constructs are not converted, but skipped.
269 @item -D, --define=@var{name}[=@code{exp}]
270 define macro @var{name} with opt expansion @code{exp}
271 @item -E,--pre-process
272 only run the pre-processor
275 @item -o,--output=@var{file}
276 write output to @var{file}
280 print warranty and copyright.
286 Only plain notes (pitches, durations), voices, and staves are
290 @node Generating LilyPond files
291 @section Generating LilyPond files
293 @cindex External programs, generating LilyPond files
295 LilyPond itself does not come with support for any other formats, but
296 there are some external tools that also generate LilyPond files.
302 @uref{http://@/denemo@/.sourceforge@/.net/,Denemo}, a graphical score editor.
304 @uref{http://www@/.volny@/.cz/smilauer/rumor/rumor@/.html,Rumor}, a realtime
305 monophonic MIDI to LilyPond converter.
307 @uref{http://nicolas@/.sceaux@/.free@/.fr/lilypond/lyqi@/.html,lyqi}, an
310 @uref{http://@/www@/.nongnu@/.org/@/xml2ly/, xml2ly}, which imports
311 @uref{http://@/www@/.musicxml@/.com/xml@/.html,MusicXML}
313 @uref{http://@/noteedit@/.berlios@/.de,NoteEdit}
314 which imports @uref{http://@/www@/.musicxml@/.com/xml@/.html,MusicXML}
316 @uref{http://@/www@/.rosegardenmusic@/.com,Rosegarden},