4 @node Converting from other formats
5 @chapter Converting from other formats
7 Music can be entered also by importing it from other formats. This
8 chapter documents the tools included in the distribution to do so.
9 There are other tools that produce LilyPond input, for example GUI
10 sequencers and XML converters. Refer to the
11 @uref{http://lilypond.org,website} for more details.
16 * Invoking convert-ly:: Older LilyPond versions.
17 * Invoking midi2ly:: Importing MIDI.
18 * Invoking etf2ly:: Importing Finale.
19 * Invoking abc2ly:: Importing ABC.
20 * Invoking mup2ly:: Importing MUP.
25 @node Invoking convert-ly
26 @section Invoking convert-ly
28 The syntax is regularly changed to simplify it or improve it in
29 different ways. A side effect of this, is that LilyPond often is not
30 compatible with older files. To remedy this, the program convert-ly
31 can be used to deal with most of the syntax changes.
33 It uses @code{\version} statements in the file to detect the old
34 version number. For example, to upgrade all LilyPond files in the
35 current directory and its subdirectories, enter the following on the
39 convert-ly -e --to=1.3.150 `find . -name '*.ly' -print`
42 The program is invoked as follows:
44 convert-ly [@var{option}]@dots{} @var{file}@dots{}
48 The following options can be given:
52 Do an inline edit of the input file. Overrides @code{--output}.
53 @item -f,--from=@var{from-patchlevel}
54 Set the level to convert from. If this is not set, convert-ly will
55 guess this, on the basis of @code{\version} strings in the file.
56 @item -o,--output=@var{file}
57 Set the output file to write.
59 Normally, convert-ly adds a @code{\version} indicator
60 to the output. Specifying this option suppresses this.
61 @item -s, --show-rules
62 Show all known conversions and exit.
63 @item --to=@var{to-patchlevel}
64 Set the goal version of the conversion. It defaults to the latest
74 Not all language changes are handled. Only one output option can be specified.
76 @node Invoking midi2ly
77 @section Invoking midi2ly
81 Midi2ly translates a Type 1 MIDI file to a LilyPond source file.
83 MIDI (Music Instrument Digital Interface) is a standard for digital
84 instruments: it specifies cabling, a serial protocol and a file
85 format. The MIDI file format is a de facto standard format for
86 exporting music from other programs, so this capability may come in
87 useful when importing files from a program that has convertor for a
90 Midi2ly will convert tracks into @internalsref{Staff} and
91 channels into @internalsref{Voice} contexts. Relative mode is used
92 for pitches, durations are only written when necessary.
94 It is possible to record a MIDI file using a digital keyboard, and
95 then convert it to @file{.ly}. However, human players are not
96 rhythmically exact enough to make a MIDI to LY conversion trivial.
97 When invoked with quantizing (@code{-s} and @code{-d} options) midi2ly
98 tries to compensate for these timing errors, but is not very good at
99 this. It is therefore not recommended to use midi2ly for
100 human-generated midi files.
103 It is invoked from the command-line as follows,
105 midi2ly [@var{option}]@dots{} @var{midi-file}
109 The following options are supported by midi2ly.
112 @item -a, --absolute-pitches
113 Print absolute pitches.
114 @item -d, --duration-quant=@var{DUR}
115 Quantize note durations on @var{DUR}.
116 @item -e, --explicit-durations
117 Print explicit durations.
119 Show summary of usage.
120 @item -k, --key=@var{acc}[:@var{minor}]
121 Set default key. @var{acc} > 0 sets number of sharps; @var{acc} < 0
122 sets number of flats. A minor key is indicated by ":1".
123 @item -o, --output=@var{file}
124 Write output to @var{file}.
125 @item -s, --start-quant=@var{DUR}
126 Quantize note starts on DUR.
127 @item -t, --allow-tuplet=@var{DUR}*@var{NUM}/@var{DEN}
128 Allow tuplet durations @var{DUR}*@var{NUM}/@var{DEN}.
132 Print version number.
134 Show warranty and copyright.
135 @item -x, --text-lyrics
136 Treat every text as a lyric.
142 Overlapping notes in an arpeggio will not be correctly rendered. The
143 first note will be read and the others will be ignored. Set them all
144 to a single duration and add phrase markings or pedal indicators.
147 @node Invoking etf2ly
148 @section Invoking etf2ly
153 @cindex Coda Technology
155 ETF (Enigma Transport Format) is a format used by Coda Music
156 Technology's Finale product. etf2ly will convert part of an ETF
157 file to a ready-to-use LilyPond file.
159 It is invoked from the command-line as follows.
161 etf2ly [@var{option}]@dots{} @var{etf-file}
164 The following options are supported by etf2ly:
168 @item -o,--output=FILE
169 set output filename to FILE
177 The list of articulation scripts is incomplete. Empty measures
178 confuse etf2ly. Sequences of grace notes are ended improperly.
181 @node Invoking abc2ly
182 @section Invoking abc2ly
186 ABC is a fairly simple ASCII based format. It is described at the ABC site:
188 @uref{http://www.gre.ac.uk/~c.walshaw/abc2mtex/abc.txt}.
190 abc2ly translates from ABC to LilyPond. It is invoked as follows:
193 abc2ly [@var{option}]@dots{} @var{abc-file}
196 The following options are supported by abc2ly:
201 @item -o,--output=@var{file}
202 set output filename to @var{file}.
204 print version information.
207 There is a rudimentary facility for adding LilyPond code to the ABC
208 source file. If you say:
211 %%LY voices \set autoBeaming = ##f
214 This will cause the text following the keyword ``voices'' to be inserted
215 into the current voice of the LilyPond output file.
220 %%LY slyrics more words
223 will cause the text following the ``slyrics'' keyword to be inserted
224 into the current line of lyrics.
229 The ABC standard is not very ``standard''. For extended features
230 (e.g. polyphonic music) different conventions exist.
232 Multiple tunes in one file cannot be converted.
234 ABC synchronizes words and notes at the beginning of a line; abc2ly does
237 abc2ly ignores the ABC beaming.
240 @node Invoking mup2ly
241 @section Invoking mup2ly
243 Mup (Music Publisher) is a shareware music notation program by Arkkra
244 Enterprises. Mup2ly will convert part of a Mup file to LilyPond
245 format. It is invoked as follows:
247 @cindex Music Publisher
251 It is invoked from the command-line as follows.
253 mup2ly [@var{option}]@dots{} @var{mup-file}
256 The following options are supported by mup2ly:
260 show what constructs are not converted, but skipped.
261 @item -D, --define=@var{name}[=@code{exp}]
262 define macro @var{name} with opt expansion @code{exp}
263 @item -E,--pre-process
264 only run the pre-processor
267 @item -o,--output=@var{file}
268 write output to @var{file}
272 print warranty and copyright.
278 Only plain notes (pitches, durations), voices, and staves are
283 @section Other formats
285 LilyPond itself does not come with support for other formats, but
286 there are also external tools that generate LilyPond files.
289 http://denemo.sourceforge.net/
292 @item @uref{http://www.nongnu.org/xml2ly/, xml2ly}, that imports
293 @uref{http://www.musicxml.com/,MusicXML}
295 @uref{http://rnvs.informatik.tu-chemnitz.de/~jan/noteedit/noteedit.html,NoteEdit}
296 which imports MusicXML
297 @item @uref{http://www.all-day-breakfast.com/rosegarden/,Rosegarden},