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.
23 @node Invoking convert-ly
24 @section Invoking convert-ly
26 The syntax is regularly changed to simplify it or improve it in
27 different ways. A side effect of this, is that LilyPond often is not
28 compatible with older files. To remedy this, the program convert-ly
29 can be used to deal with most of the syntax changes.
31 It uses @code{\version} statements in the file to detect the old
32 version number. For example, to upgrade all LilyPond files in the
33 current directory and its subdirectories, enter the following on the
37 convert-ly -e --to=1.3.150 `find . -name '*.ly' -print`
40 The program is invoked as follows:
42 convert-ly [@var{option}]@dots{} @var{file}@dots{}
46 The following options can be given:
50 Do an inline edit of the input file. Overrides @code{--output}.
51 @item -f,--from=@var{from-patchlevel}
52 Set the level to convert from. If this is not set, convert-ly will
53 guess this, on the basis of @code{\version} strings in the file.
54 @item -o,--output=@var{file}
55 Set the output file to write.
57 Normally, convert-ly adds a @code{\version} indicator
58 to the output. Specifying this option suppresses this.
59 @item -s, --show-rules
60 Show all known conversions and exit.
61 @item --to=@var{to-patchlevel}
62 Set the goal version of the conversion. It defaults to the latest
72 Not all language changes are handled. Only one output option can be specified.
74 @node Invoking midi2ly
75 @section Invoking midi2ly
79 Midi2ly translates a Type 1 MIDI file to a LilyPond source file.
81 MIDI (Music Instrument Digital Interface) is a standard for digital
82 instruments: it specifies cabling, a serial protocol and a file
83 format. The MIDI file format is a de facto standard format for
84 exporting music from other programs, so this capability may come in
85 useful when importing files from a program that has convertor for a
88 Midi2ly will convert tracks into @internalsref{Staff} and
89 channels into @internalsref{Voice} contexts. Relative mode is used
90 for pitches, durations are only written when necessary.
92 It is possible to record a MIDI file using a digital keyboard, and
93 then convert it to @file{.ly}. However, human players are not
94 rhythmically exact enough to make a MIDI to LY conversion trivial.
95 When invoked with quantizing (@code{-s} and @code{-d} options) midi2ly
96 tries to compensate for these timing errors, but is not very good at
97 this. It is therefore not recommended to use midi2ly for
98 human-generated midi files.
101 It is invoked as follows:
103 midi2ly [@var{option}]@dots{} @var{midi-file}
106 The following options are supported by midi2ly:
109 @item -a, --absolute-pitches
110 Print absolute pitches.
111 @item -d, --duration-quant=@var{DUR}
112 Quantize note durations on @var{DUR}.
113 @item -e, --explicit-durations
114 Print explicit durations.
116 Show summary of usage.
117 @item -k, --key=@var{acc}[:@var{minor}]
118 Set default key. @var{acc} > 0 sets number of sharps; @var{acc} < 0
119 sets number of flats. A minor key is indicated by ":1".
120 @item -o, --output=@var{file}
121 Write output to @var{file}.
122 @item -s, --start-quant=@var{DUR}
123 Quantize note starts on DUR.
124 @item -t, --allow-tuplet=@var{DUR}*@var{NUM}/@var{DEN}
125 Allow tuplet durations @var{DUR}*@var{NUM}/@var{DEN}.
129 Print version number.
131 Show warranty and copyright.
132 @item -x, --text-lyrics
133 Treat every text as a lyric.
139 Overlapping notes in an arpeggio will not be correctly rendered. The
140 first note will be read and the others will be ignored. Set them all
141 to a single duration and add phrase markings or pedal indicators.
144 @node Invoking etf2ly
145 @section Invoking etf2ly
150 @cindex Coda Technology
152 ETF (Enigma Transport Format) is a format used by Coda Music
153 Technology's Finale product. etf2ly will convert part of an ETF
154 file to a ready-to-use LilyPond file.
156 It is invoked as follows:
158 etf2ly [@var{option}]@dots{} @var{etf-file}
161 The following options are supported by etf2ly:
165 @item -o,--output=FILE
166 set output filename to FILE
174 The list of articulation scripts is incomplete. Empty measures
175 confuse etf2ly. Sequences of grace notes are ended improperly.
178 @node Invoking abc2ly
179 @section Invoking abc2ly
183 ABC is a fairly simple ASCII based format. It is described at the ABC site:
185 @uref{http://www.gre.ac.uk/~c.walshaw/abc2mtex/abc.txt}.
187 abc2ly translates from ABC to LilyPond. It is invoked as follows:
190 abc2ly [@var{option}]@dots{} @var{abc-file}
193 The following options are supported by abc2ly:
198 @item -o,--output=@var{file}
199 set output filename to @var{file}.
201 print version information.
204 There is a rudimentary facility for adding LilyPond code to the ABC
205 source file. If you say:
208 %%LY voices \set autoBeaming = ##f
211 This will cause the text following the keyword ``voices'' to be inserted
212 into the current voice of the LilyPond output file.
217 %%LY slyrics more words
220 will cause the text following the ``slyrics'' keyword to be inserted
221 into the current line of lyrics.
226 The ABC standard is not very ``standard''. For extended features
227 (e.g. polyphonic music) different conventions exist.
229 Multiple tunes in one file cannot be converted.
231 ABC synchronizes words and notes at the beginning of a line; abc2ly does
234 abc2ly ignores the ABC beaming.
237 @node Invoking mup2ly
238 @section Invoking mup2ly
240 Mup (Music Publisher) is a shareware music notation program by Arkkra
241 Enterprises. Mup2ly will convert part of a Mup file to LilyPond
242 format. It is invoked as follows:
244 @cindex Music Publisher
249 mup2ly [@var{option}]@dots{} @var{mup-file}
252 The following options are supported by mup2ly:
256 show what constructs are not converted, but skipped.
257 @item -D, --define=@var{name}[=@code{exp}]
258 define macro @var{name} with opt expansion @code{exp}
259 @item -E,--pre-process
260 only run the pre-processor
263 @item -o,--output=@var{file}
264 write output to @var{file}
268 print warranty and copyright.
274 Only plain notes (pitches, durations), voices, and staves are