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 * Generating LilyPond files::
37 @node Invoking midi2ly
38 @section Invoking @command{midi2ly}
42 @command{midi2ly} translates a Type@tie{}1 MIDI file to a LilyPond source
45 MIDI (Music Instrument Digital Interface) is a standard for digital
46 instruments: it specifies cabling, a serial protocol and a file
47 format. The MIDI file format is a de facto standard format for
48 exporting music from other programs, so this capability may come in
49 useful when importing files from a program that has a convertor for a
52 @command{midi2ly} converts tracks into @internalsref{Staff} and
53 channels into @internalsref{Voice} contexts. Relative mode is used
54 for pitches, durations are only written when necessary.
56 It is possible to record a MIDI file using a digital keyboard, and
57 then convert it to @file{.ly}. However, human players are not
58 rhythmically exact enough to make a MIDI to LY conversion trivial.
59 When invoked with quantizing (@code{-s} and @code{-d} options)
60 @command{midi2ly} tries to compensate for these timing errors, but is not
61 very good at this. It is therefore not recommended to use @command{midi2ly}
62 for human-generated midi files.
65 It is invoked from the command-line as follows,
67 midi2ly [@var{option}]@dots{} @var{midi-file}
70 Note that by ``command-line'', we mean the command line of the
71 operating system. See @ref{Converting from other formats} for
72 more information about this.
74 The following options are supported by @command{midi2ly}.
77 @item -a, --absolute-pitches
78 Print absolute pitches.
80 @item -d, --duration-quant=@var{DUR}
81 Quantize note durations on @var{DUR}.
83 @item -e, --explicit-durations
84 Print explicit durations.
87 Show summary of usage.
89 @item -k, --key=@var{acc}[:@var{minor}]
90 Set default key. @math{@var{acc} > 0} sets number of sharps;
91 @math{@var{acc} < 0} sets number of flats. A minor key is indicated by
94 @item -o, --output=@var{file}
95 Write output to @var{file}.
97 @item -s, --start-quant=@var{DUR}
98 Quantize note starts on DUR.
100 @item -t, --allow-tuplet=@var{DUR}*@var{NUM}/@var{DEN}
101 Allow tuplet durations @var{DUR}*@var{NUM}/@var{DEN}.
107 Print version number.
110 Show warranty and copyright.
112 @item -x, --text-lyrics
113 Treat every text as a lyric.
119 Overlapping notes in an arpeggio will not be correctly rendered. The
120 first note will be read and the others will be ignored. Set them all
121 to a single duration and add phrase markings or pedal indicators.
124 @node Invoking etf2ly
125 @section Invoking @command{etf2ly}
130 @cindex Coda Technology
132 ETF (Enigma Transport Format) is a format used by Coda Music
133 Technology's Finale product. @command{etf2ly} will convert part of an ETF
134 file to a ready-to-use LilyPond file.
136 It is invoked from the command-line as follows.
139 etf2ly [@var{option}]@dots{} @var{etf-file}
142 Note that by ``command-line'', we mean the command line of the
143 operating system. See @ref{Converting from other formats} for
144 more information about this.
146 The following options are supported by @command{etf2ly}:
151 @item -o,--output=FILE
152 set output filename to FILE
160 The list of articulation scripts is incomplete. Empty measures
161 confuse @command{etf2ly}. Sequences of grace notes are ended improperly.
163 @node Invoking musicxml2ly
164 @section Invoking @code{musicxml2ly}
166 @uref{http://@/www.@/recordarde@/.com/xml@/.html,MusicXML} is an XML dialect
167 for representing music notation.
169 @command{musicxml2ly} extracts the notes from part-wise MusicXML
170 files, and writes it to a .ly file. It is invoked from the command-line.
172 Note that by ``command-line'', we mean the command line of the
173 operating system. See @ref{Converting from other formats} for
174 more information about this.
176 The following options are supported by @command{musicxml2ly}:
180 print usage and option summary.
181 @item -o,--output=@var{file}
182 set output filename to @var{file}. (default: print to stdout)
184 print version information.
187 @node Invoking abc2ly
188 @section Invoking @code{abc2ly}
192 ABC is a fairly simple ASCII based format. It is described at the ABC site:
195 @uref{http://@/www@/.gre@/.ac@/.uk/@/~c.walshaw/@/abc2mtex/@/abc@/.txt}.
198 @command{abc2ly} translates from ABC to LilyPond. It is invoked as follows:
201 abc2ly [@var{option}]@dots{} @var{abc-file}
204 The following options are supported by @command{abc2ly}:
209 @item -o,--output=@var{file}
210 set output filename to @var{file}.
212 print version information.
215 There is a rudimentary facility for adding LilyPond code to the ABC
216 source file. If you say:
219 %%LY voices \set autoBeaming = ##f
222 This will cause the text following the keyword ``voices'' to be inserted
223 into the current voice of the LilyPond output file.
228 %%LY slyrics more words
231 will cause the text following the ``slyrics'' keyword to be inserted
232 into the current line of lyrics.
237 The ABC standard is not very ``standard''. For extended features
238 (e.g., polyphonic music) different conventions exist.
240 Multiple tunes in one file cannot be converted.
242 ABC synchronizes words and notes at the beginning of a line;
243 @command{abc2ly} does not.
245 @command{abc2ly} ignores the ABC beaming.
249 @node Generating LilyPond files
250 @section Generating LilyPond files
252 @cindex External programs, generating LilyPond files
254 LilyPond itself does not come with support for any other formats, but
255 there are some external tools that also generate LilyPond files.
261 @uref{http://@/denemo@/.sourceforge@/.net/,Denemo}, a graphical score editor.
263 @uref{http://www@/.volny@/.cz/smilauer/rumor/rumor@/.html,Rumor}, a realtime
264 monophonic MIDI to LilyPond converter.
266 @uref{http://nicolas@/.sceaux@/.free@/.fr/lilypond/lyqi@/.html,lyqi}, an
269 @uref{http://@/www@/.nongnu@/.org/@/xml2ly/, xml2ly}, which imports
270 @uref{http://@/www@/.musicxml@/.com/xml@/.html,MusicXML}
272 @uref{http://@/noteedit@/.berlios@/.de,NoteEdit}
273 which imports @uref{http://@/www@/.musicxml@/.com/xml@/.html,MusicXML}
275 @uref{http://@/www@/.rosegardenmusic@/.com,Rosegarden},
278 @uref{http://@/common-lisp@/.net/project/fomus/,FOMUS},
279 a LISP library to generate music notation