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{website,http://lilypond.org} for more details.
15 * Invoking convert-ly:: Older LilyPond versions.
16 * Invoking midi2ly:: Importing MIDI.
17 * Invoking etf2ly:: Importing Finale.
18 * Invoking abc2ly:: Importing ABC.
19 * Invoking pmx2ly:: Importing PMX.
20 * Invoking musedata2ly:: Importing Musedata.
21 * Invoking mup2ly:: Importing MUP.
25 @node Invoking convert-ly
26 @section Invoking convert-ly
28 Convert-ly sequentially applies different conversions to upgrade a
29 Lilypond input file. It uses @code{\version} statements in the file to
30 detect the old version number. For example, to upgrade all lilypond
31 files in the current directory and its subdirectories, use
33 convert-ly -e --to=1.3.150 `find . -name '*.ly' -print`
36 The program is invoked as follows:
38 convert-ly [@var{option}]@dots{} @var{file}@dots{}
42 The following options can be given:
46 Do an inline edit of the input file. Overrides @code{--output}.
47 @item -f,--from=@var{from-patchlevel}
48 Set the level to convert from. If this is not set, convert-ly will
49 guess this, on the basis of @code{\version} strings in the file.
50 @item -o,--output=@var{file}
51 Set the output file to write.
53 Normally, convert-ly adds a @code{\version} indicator
54 to the output. Specifying this option suppresses this.
55 @item -s, --show-rules
56 Show all known conversions and exit.
57 @item --to=@var{to-patchlevel}
58 Set the goal version of the conversion. It defaults to the latest
68 Not all language changes are handled. Only one output option can be specified.
70 @node Invoking midi2ly
71 @section Invoking midi2ly
75 Midi2ly translates a MIDI input file to a LilyPond source file. MIDI
76 (Music Instrument Digital Interface) is a standard for digital
77 instruments: it specifies cabling, a serial protocol and a file format.
79 The MIDI file format is a de facto standard format for exporting music
80 from other programs, so this capability may come in useful when you want
81 to import files from a program that has no converter for its native
84 @file{midi2ly} will convert tracks into @internalsref{Staff} and
85 channels into @internalsref{Voice} contexts.
87 It is possible to record a MIDI file using a digital keyboard, and then
88 convert it to @file{.ly}. However, human players are not rhythmically
89 exact enough to make a MIDI to LY conversion trivial. midi2ly tries to
90 compensate for these timing errors, but is not very good at this. It is
91 therefore not recommended to use midi2ly for human-generated midi files.
93 Hackers who know about signal processing are invited to write a more
94 robust midi2ly. midi2ly is written in Python, using a module written in
95 C to parse the MIDI files.
97 It is invoked as follows:
99 midi2ly [@var{option}]@dots{} @var{midi-file}
102 The following options are supported by midi2ly:
105 @item -b, --no-quantify,
106 Write exact durations, e.g.: `a4*385/384'.
108 Print lots of debugging stuff.
110 Show a summary of usage.
111 @item -I, --include=@var{dir},
112 Add @var{dir} to search path.
113 @item -k, --key=@var{acc}[:@var{minor}],
114 Set default key. @var{acc} > 0 sets number of sharps; @var{acc} < 0
116 of flats. A minor key is indicated by ":1".
117 @item -n, --no-silly,
118 Assume no plets or double dots, assume smallest (reciprocal) duration 16.
119 @item -o, --output=@var{file},
120 Set @var{file} as default output.
121 @item -p, --no-plets,
125 @item -s, --smallest=N,
126 Assume no shorter (reciprocal) durations than N.
129 @item -w, --warranty,
130 Show the warranty with which midi2ly comes. (It comes with @strong{NO WARRANTY}!)
131 @item -x, --no-double-dots,
132 Assume no double dotted notes.
136 @node Invoking etf2ly
137 @section Invoking etf2ly
142 @cindex Coda Technology
144 ETF (Enigma Transport Format) is a format used by Coda Music
145 Technology's Finale product. etf2ly will convert part of an ETF
146 file to a ready-to-use LilyPond file.
148 It is invoked as follows:
150 etf2ly [@var{option}]@dots{} @var{etf-file}
153 The following options are supported by etf2ly.
157 @item -o,--output=FILE
158 set output filename to FILE
166 The list of articulation scripts is incomplete. Empty measures confuse
170 @node Invoking abc2ly
171 @section Invoking abc2ly
175 ABC is a fairly simple ASCII based format. It is described at the abc site:
177 @uref{http://www.gre.ac.uk/~c.walshaw/abc2mtex/abc.txt}
179 abc2ly translates from ABC to LilyPond. It is invoked as follows:
182 abc2ly [@var{option}]@dots{} @var{abc-file}
185 The following options are supported by abc2ly:
190 @item -o,--output=@var{file}
191 set output filename to @var{file}.
193 print version information.
196 There is a rudimentary facility for adding lilypond code to the ABC
197 source file. If you say:
200 %%LY voices \property Voice.autoBeaming=##f
203 This will cause the text following the keyword ``voices'' to be inserted
204 into the current voice of the lilypond output file.
209 %%LY slyrics more words
212 will cause the text following the ``slyrics'' keyword to be inserted
213 into the current line of lyrics.
218 The ABC standard is not very ``standard''. For extended features
219 (eg. polyphonic music) different conventions exist.
221 Multiple tunes in one file cannot be converted.
223 ABC synchronizes words and notes at the beginning of a line; abc2ly does
226 abc2ly ignores the ABC beaming.
228 @node Invoking pmx2ly
229 @section Invoking pmx2ly
231 PMX is a MusiXTeX preprocessor written by Don Simons. More information
232 on PMX is available from the following site:
235 @uref{http://icking-music-archive.sunsite.dk/Misc/Music/musixtex/software/pmx/}.
241 pmx2ly converts from PMX to LilyPond input. The program is invoked as
245 pmx2ly [@var{option}]@dots{} @var{pmx-file}
248 The following options are supported by pmx2ly:
253 @item -o,--output=FILE
254 set output filename to FILE
261 This script was updated last in September 2000, and then successfully
262 converted the @file{barsant.pmx} example from the PMX
263 distribution. pmx2ly cannot parse more recent PMX files.
266 @node Invoking musedata2ly
267 @section Invoking musedata2ly
272 Musedata (@uref{http://www.musedata.org/}) is an electronic library of
273 classical music scores, currently comprising about 800 composition
274 dating from 1700 to 1825. The music is encoded in so-called Musedata
275 format. musedata2ly converts a set of musedata files to one .ly file,
276 and will include a @code{\header} field if a @file{.ref} file is
277 supplied. It is invoked as follows:
280 musedata2ly [@var{option}]@dots{} @var{musedata-files}
283 The following options are supported by musedata2ly:
288 @item -o,--output=@var{file}
289 set output filename to @var{file}
292 @item -r,--ref=@var{reffile}
293 read background information from ref-file
299 musedata2ly converts only a small subset musedata.
301 @node Invoking mup2ly
302 @section Invoking mup2ly
304 MUP (Music Publisher) is a shareware music notation program by Arkkra
305 Enterprises. Mup2ly will convert part of a Mup file to LilyPond
306 format. It is invoked as follows:
308 @cindex Music Publisher
313 mup2ly [@var{option}]@dots{} @var{mup-file}
316 The following options are supported by mup2ly:
320 show what constructs are not converted, but skipped.
321 @item -D, --define=@var{name}[=@code{exp}]
322 define macro @var{name} with opt expansion @code{exp}
323 @item -E,--pre-process
324 only run the pre-processor
327 @item -o,--output=@var{file}
328 write output to @var{file}
332 print warranty and copyright.
338 Currently, only plain notes (pitches, durations), voices and staves are