1 @c -*- coding: latin-1; 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.
15 * Invoking convert-ly:: Older LilyPond versions.
16 * Invoking midi2ly:: Importing MIDI.
17 * Invoking etf2ly:: Importing Finale.
18 * Invoking abc2ly:: Importing ABC.
19 * Invoking mup2ly:: Importing MUP.
24 @node Invoking convert-ly
25 @section Invoking @command{convert-ly}
27 The LilyPond input syntax is routinely changed to simplify it or improve
28 it in different ways. As a side effect of this, the LilyPond interpreter
29 often is no longer compatible with older input files. To remedy this,
30 the program @command{convert-ly} can be used to deal with most of the
31 syntax changes between LilyPond versions.
33 It uses @code{\version} statements in the input files to detect the old
34 version number. In most cases, to upgrade your input file it is sufficient
38 covert-ly -e myfile.ly
41 If there are no changes to myfile.ly and file called myfile.ly.NEW
42 is created, then myfile.ly is already updated.
44 To upgrade LilyPond fragments in texinfo files, use
47 convert-ly --from=... --to=... --no-version *.itely
50 In general, the program is invoked as follows:
53 convert-ly [@var{option}]@dots{} @var{file}@dots{}
57 The following options can be given:
61 Do an inline edit of the input file. Overrides @code{--output}.
63 @item -f,--from=@var{from-patchlevel}
64 Set the version to convert from. If this is not set, @command{convert-ly}
65 will guess this, on the basis of @code{\version} strings in the file.
67 @item -o,--output=@var{file}
68 Set the output file to write.
71 Normally, @command{convert-ly} adds a @code{\version} indicator
72 to the output. Specifying this option suppresses this.
74 @item -s, --show-rules
75 Show all known conversions and exit.
77 @item --to=@var{to-patchlevel}
78 Set the goal version of the conversion. It defaults to the latest
85 @command{convert-ly} always converts up to the last syntax change handled by
86 it. This means that the @code{\version} number left in the file is
87 usually lower than the version of @command{convert-ly} itself.
91 Not all language changes are handled. Only one output option can be
95 Copy and paste from CVS, last updated
98 http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/lilypond/lily-bugs/bugs/convert-ly.txt?rev=HEAD&content-type=text/plain
102 There are a few things that the convert-ly cannot handle. Here's a list of limitations
103 that the community has complained about.
105 This bug report structure has been chosen because convert-ly has a structure that doesn't
106 allow to smoothly implement all needed changes. Thus this is just a wishlist, placed
110 Doesn't always convert figured bass correctly, specifically things like {< >}. Mats' comment on working around this:
111 To be able to run convert-ly
112 on it, I first replaced all occurencies of '{<' to some dummy like '{#'
113 and similarly I replaced '>}' with '&}'. After the conversion, I could
114 then change back from '{ #' to '{ <' and from '& }' to '> }'.
115 Doesn't convert all text markup correctly. Only very simple cases are fixed.
117 Doesn't handle \partcombine
118 Doesn't do \addlyrics => \lyricsto, this breaks some scores with multiple stanzas.
120 \turnOff (used in \set Staff.VoltaBracket = \turnOff) is not properly converted.
124 @node Invoking midi2ly
125 @section Invoking @command{midi2ly}
129 @command{midi2ly} translates a Type@tie{}1 MIDI file to a LilyPond source
132 MIDI (Music Instrument Digital Interface) is a standard for digital
133 instruments: it specifies cabling, a serial protocol and a file
134 format. The MIDI file format is a de facto standard format for
135 exporting music from other programs, so this capability may come in
136 useful when importing files from a program that has a convertor for a
139 @command{midi2ly} converts tracks into @internalsref{Staff} and
140 channels into @internalsref{Voice} contexts. Relative mode is used
141 for pitches, durations are only written when necessary.
143 It is possible to record a MIDI file using a digital keyboard, and
144 then convert it to @file{.ly}. However, human players are not
145 rhythmically exact enough to make a MIDI to LY conversion trivial.
146 When invoked with quantizing (@code{-s} and @code{-d} options)
147 @command{midi2ly} tries to compensate for these timing errors, but is not
148 very good at this. It is therefore not recommended to use @command{midi2ly}
149 for human-generated midi files.
152 It is invoked from the command-line as follows,
154 midi2ly [@var{option}]@dots{} @var{midi-file}
158 The following options are supported by @command{midi2ly}.
161 @item -a, --absolute-pitches
162 Print absolute pitches.
164 @item -d, --duration-quant=@var{DUR}
165 Quantize note durations on @var{DUR}.
167 @item -e, --explicit-durations
168 Print explicit durations.
171 Show summary of usage.
173 @item -k, --key=@var{acc}[:@var{minor}]
174 Set default key. @math{@var{acc} > 0} sets number of sharps;
175 @math{@var{acc} < 0} sets number of flats. A minor key is indicated by
178 @item -o, --output=@var{file}
179 Write output to @var{file}.
181 @item -s, --start-quant=@var{DUR}
182 Quantize note starts on DUR.
184 @item -t, --allow-tuplet=@var{DUR}*@var{NUM}/@var{DEN}
185 Allow tuplet durations @var{DUR}*@var{NUM}/@var{DEN}.
191 Print version number.
194 Show warranty and copyright.
196 @item -x, --text-lyrics
197 Treat every text as a lyric.
203 Overlapping notes in an arpeggio will not be correctly rendered. The
204 first note will be read and the others will be ignored. Set them all
205 to a single duration and add phrase markings or pedal indicators.
208 @node Invoking etf2ly
209 @section Invoking @command{etf2ly}
214 @cindex Coda Technology
216 ETF (Enigma Transport Format) is a format used by Coda Music
217 Technology's Finale product. @command{etf2ly} will convert part of an ETF
218 file to a ready-to-use LilyPond file.
220 It is invoked from the command-line as follows.
223 etf2ly [@var{option}]@dots{} @var{etf-file}
226 The following options are supported by @command{etf2ly}:
231 @item -o,--output=FILE
232 set output filename to FILE
240 The list of articulation scripts is incomplete. Empty measures
241 confuse @command{etf2ly}. Sequences of grace notes are ended improperly.
244 @node Invoking abc2ly
245 @section Invoking @code{abc2ly}
249 ABC is a fairly simple ASCII based format. It is described at the ABC site:
252 @uref{http://@/www@/.gre@/.ac@/.uk/@/~c.walshaw/@/abc2mtex/@/abc@/.txt}.
255 @command{abc2ly} translates from ABC to LilyPond. It is invoked as follows:
258 abc2ly [@var{option}]@dots{} @var{abc-file}
261 The following options are supported by @command{abc2ly}:
266 @item -o,--output=@var{file}
267 set output filename to @var{file}.
269 print version information.
272 There is a rudimentary facility for adding LilyPond code to the ABC
273 source file. If you say:
276 %%LY voices \set autoBeaming = ##f
279 This will cause the text following the keyword ``voices'' to be inserted
280 into the current voice of the LilyPond output file.
285 %%LY slyrics more words
288 will cause the text following the ``slyrics'' keyword to be inserted
289 into the current line of lyrics.
294 The ABC standard is not very ``standard''. For extended features
295 (e.g., polyphonic music) different conventions exist.
297 Multiple tunes in one file cannot be converted.
299 ABC synchronizes words and notes at the beginning of a line;
300 @command{abc2ly} does not.
302 @command{abc2ly} ignores the ABC beaming.
305 @node Invoking mup2ly
306 @section Invoking @command{mup2ly}
308 Mup (Music Publisher) is a shareware music notation program by Arkkra
309 Enterprises. @command{mup2ly} will convert part of a Mup file to LilyPond
310 format. It is invoked from the command-line as follows:
312 @cindex Music Publisher
317 mup2ly [@var{option}]@dots{} @var{mup-file}
320 The following options are supported by @command{mup2ly}:
324 show what constructs are not converted, but skipped.
325 @item -D, --define=@var{name}[=@code{exp}]
326 define macro @var{name} with opt expansion @code{exp}
327 @item -E,--pre-process
328 only run the pre-processor
331 @item -o,--output=@var{file}
332 write output to @var{file}
336 print warranty and copyright.
342 Only plain notes (pitches, durations), voices, and staves are
347 @section Other formats
349 LilyPond itself does not come with support for other formats, but
350 there are some external tools that also generate LilyPond files.
356 @uref{http://@/denemo@/.sourceforge@/.net/,Denemo}.
358 @uref{http://@/www@/.nongnu@/.org/@/xml2ly/, xml2ly}, that imports
359 @uref{http://@/www@/.musicxml@/.com/,MusicXML}
361 @uref{http://@/rnvs@/.informatik@/.tu@/-chemnitz@/.de/@/~jan/@/noteedit/@/noteedit@/.html,NoteEdit}
362 which imports MusicXML
364 @uref{http://@/www@/.all@/-day@/-breakfast@/.com/@/rosegarden/,Rosegarden},