1 @c -*- coding: utf-8; mode: texinfo; -*-
4 Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
6 When revising a translation, copy the HEAD committish of the
7 version that you are working on. See TRANSLATION for details.
12 @node External programs
13 @chapter External programs
20 * Text editor support::
21 * Converting from other formats::
22 * LilyPond output in other programs::
27 @section Point and click
29 @cindex point and click
31 Point and click lets you find notes in the input by clicking on them
32 in the PDF viewer. This makes it easier to find input that causes
33 some error in the sheet music.
35 When this functionality is active, LilyPond adds hyperlinks to the PDF
36 file. These hyperlinks are sent to the web-browser, which opens a
37 text-editor with the cursor in the right place.
39 To make this chain work, you should configure your PDF viewer to
40 follow hyperlinks using the @file{lilypond-invoke-editor} script
41 supplied with LilyPond.
43 For Xpdf on UNIX, the following should be present in
44 @file{xpdfrc}@footnote{On UNIX, this file is found either in
45 @file{/etc/xpdfrc} or as @file{.xpdfrc} in your home directory.}
48 urlCommand "lilypond-invoke-editor %s"
51 The program @file{lilypond-invoke-editor} is a small helper
52 program. It will invoke an editor for the special @code{textedit}
53 URIs, and run a web browser for others. It tests the environment
54 variable @code{EDITOR} for the following patterns,
60 emacsclient --no-wait +@var{line}:@var{column} @var{file}
65 gvim --remote +:@var{line}:norm@var{column} @var{file}
71 nc -noask +@var{line} @var{file}'
75 The environment variable @code{LYEDITOR} is used to override this. It
76 contains the command line to start the editor, where @code{%(file)s},
77 @code{%(column)s}, @code{%(line)s} is replaced with the file, column
78 and line respectively. The setting
81 emacsclient --no-wait +%(line)s:%(column)s %(file)s
85 for @code{LYEDITOR} is equivalent to the standard emacsclient
89 @cindex file size, output
91 The point and click links enlarge the output files significantly. For
92 reducing the size of PDF and PS files, point and click may be switched
100 in a @file{.ly} file. Point and click may be explicitly enabled with
106 Alternately, you may disable point and click with a command-line
110 lilypond -dno-point-and-click file.ly
113 @warning{You should always turn off point and click in any LilyPond
114 files to be distributed to avoid including path information about
115 your computer in the .pdf file, which can pose a security risk.}
116 @node Text editor support
117 @section Text editor support
122 @cindex modes, editor
123 @cindex syntax coloring
124 @cindex coloring, syntax
126 There is support for different text editors for LilyPond.
135 @unnumberedsubsec Emacs mode
137 Emacs has a @file{lilypond-mode}, which provides keyword
138 autocompletion, indentation, LilyPond specific parenthesis matching
139 and syntax coloring, handy compile short-cuts and reading LilyPond
140 manuals using Info. If @file{lilypond-mode} is not installed on your
143 An Emacs mode for entering music and running LilyPond is contained in
144 the source archive in the @file{elisp} directory. Do @command{make
145 install} to install it to @var{elispdir}. The file @file{lilypond-init.el}
146 should be placed to @var{load-path}@file{/site-start.d/} or appended
147 to your @file{~/.emacs} or @file{~/.emacs.el}.
149 As a user, you may want add your source path (e.g. @file{~/site-lisp/}) to
150 your @var{load-path} by appending the following line (as modified) to your
153 @c any reason we do not advise: (push "~/site-lisp" load-path)
155 (setq load-path (append (list (expand-file-name "~/site-lisp")) load-path))
160 @unnumberedsubsec Vim mode
162 For @uref{http://@/www@/.vim@/.org,VIM}, a @file{vimrc} is supplied,
163 along with syntax coloring tools. A Vim mode for entering music and
164 running LilyPond is contained in the source archive in @code{$VIM}
167 The LilyPond file type is detected if the file
168 @file{~/.vim/filetype.vim} has the following content
171 if exists("did_load_filetypes")
174 augroup filetypedetect
175 au! BufNewFile,BufRead *.ly,*.ily setf lilypond
179 Please include this path by appending the following line to your
183 set runtimepath+=/usr/local/share/lilypond/$@{LILYPOND_VERSION@}/vim/
187 where $@{LILYPOND_VERSION@} is your LilyPond version. If LilyPond was not
188 installed in @file{/usr/local/}, then change this path accordingly.
189 The path may differ significantly. In Fedora the path leads to the
190 current version of Vim instead of Lilypond:
193 set runtimepath+=/usr/share/vim/vim72/
198 @unnumberedsubsec Other editors
200 Other editors (both text and graphical) support LilyPond, but
201 their special configuration files are not distributed with
202 LilyPond. Consult their documentation for more information. Such
203 editors are listed in @rweb{Alternate editors}.
206 @node Converting from other formats
207 @section Converting from other formats
209 Music can be entered also by importing it from other formats. This
210 chapter documents the tools included in the distribution to do so.
211 There are other tools that produce LilyPond input, for example GUI
212 sequencers and XML converters. Refer to the
213 @uref{http://@/lilypond@/.org,website} for more details.
215 These are separate programs from @command{lilypond} itself, and are
216 run on the command line; see @ref{Command-line usage} for more
217 information. If you have MacOS 10.3 or 10.4 and you have trouble
218 running some of these scripts, e.g. @code{convert-ly}, see
223 We unfortunately do not have the resources to maintain these
224 programs; please consider them @qq{as-is}. Patches are appreciated, but
225 bug reports will almost certainly not be resolved.
228 * Invoking midi2ly:: Importing MIDI.
229 * Invoking musicxml2ly:: Importing MusicXML.
230 * Invoking abc2ly:: Importing ABC.
231 * Invoking etf2ly:: Importing Finale.
237 @node Invoking midi2ly
238 @subsection Invoking @command{midi2ly}
242 @command{midi2ly} translates a Type@tie{}1 MIDI file to a LilyPond source
245 MIDI (Music Instrument Digital Interface) is a standard for digital
246 instruments: it specifies cabling, a serial protocol and a file
247 format. The MIDI file format is a de facto standard format for
248 exporting music from other programs, so this capability may come in
249 useful when importing files from a program that has a converter for a
252 @command{midi2ly} converts tracks into @rinternals{Staff} and
253 channels into @rinternals{Voice} contexts. Relative mode is used
254 for pitches, durations are only written when necessary.
256 It is possible to record a MIDI file using a digital keyboard, and
257 then convert it to @file{.ly}. However, human players are not
258 rhythmically exact enough to make a MIDI to LY conversion trivial.
259 When invoked with quantizing (@code{-s} and @code{-d} options)
260 @command{midi2ly} tries to compensate for these timing errors, but is not
261 very good at this. It is therefore not recommended to use @command{midi2ly}
262 for human-generated midi files.
265 It is invoked from the command-line as follows,
267 midi2ly [@var{option}]@dots{} @var{midi-file}
270 Note that by @q{command-line}, we mean the command line of the
271 operating system. See @ref{Converting from other formats}, for
272 more information about this.
274 The following options are supported by @command{midi2ly}.
277 @item -a, --absolute-pitches
278 Print absolute pitches.
280 @item -d, --duration-quant=@var{DUR}
281 Quantize note durations on @var{DUR}.
283 @item -e, --explicit-durations
284 Print explicit durations.
287 Show summary of usage.
289 @item -k, --key=@var{acc}[:@var{minor}]
290 Set default key. @math{@var{acc} > 0} sets number of sharps;
291 @math{@var{acc} < 0} sets number of flats. A minor key is indicated by
294 @item -o, --output=@var{file}
295 Write output to @var{file}.
297 @item -s, --start-quant=@var{DUR}
298 Quantize note starts on @var{DUR}.
300 @item -t, --allow-tuplet=@var{DUR}*@var{NUM}/@var{DEN}
301 Allow tuplet durations @var{DUR}*@var{NUM}/@var{DEN}.
307 Print version number.
310 Show warranty and copyright.
312 @item -x, --text-lyrics
313 Treat every text as a lyric.
319 Overlapping notes in an arpeggio will not be correctly rendered. The
320 first note will be read and the others will be ignored. Set them all
321 to a single duration and add phrase markings or pedal indicators.
324 @node Invoking musicxml2ly
325 @subsection Invoking @code{musicxml2ly}
329 @uref{http://@/www.@/musicxml@/.org/,MusicXML} is an XML dialect
330 for representing music notation.
332 @command{musicxml2ly} extracts the notes, articulations, score structure,
333 lyrics, etc. from part-wise MusicXML files, and writes them to a .ly
334 file. It is invoked from the command-line.
337 It is invoked from the command-line as follows,
339 musicxml2ly [@var{option}]@dots{} @var{xml-file}
342 Note that by @q{command-line}, we mean the command line of the
343 operating system. See @ref{Converting from other formats}, for
344 more information about this.
346 If the given filename is @file{-}, @command{musicxml2ly} reads input
347 from the command line.
349 The following options are supported by @command{musicxml2ly}:
353 convert pitches in absolute mode.
356 print usage and option summary.
358 @item -l, --language=LANG
359 use a different language file 'LANG.ly' and corresponding pitch names,
360 e.g. 'deutsch' for deutsch.ly and German note names.
363 use the lxml.etree Python package for XML-parsing; uses less memory and cpu time.
365 @item --nd --no-articulation-directions
366 do not convert directions (@code{^}, @code{_} or @code{-}) for
367 articulations, dynamics, etc.
370 do not convert beaming information, use LilyPond's automatic
373 @item -o,--output=@var{file}
374 set output filename to @var{file}. If @var{file} is @file{-}, the output
375 will be printed on stdout. If not given, @var{xml-file}@file{.ly} will
379 convert pitches in relative mode (default).
385 print version information.
387 @item -z,--compressed
388 input file is a zip-compressed MusicXML file.
392 @node Invoking abc2ly
393 @subsection Invoking @code{abc2ly}
395 @warning{This program is not supported, and may be remove from
396 future versions of LilyPond.}
400 ABC is a fairly simple ASCII based format. It is described at the ABC site:
403 @uref{http://@/www@/.walshaw@/.plus@/.com/@/abc/@/learn@/.html}.
406 @command{abc2ly} translates from ABC to LilyPond. It is invoked as follows:
409 abc2ly [@var{option}]@dots{} @var{abc-file}
412 The following options are supported by @command{abc2ly}:
415 @item -b,--beams=None
416 preserve ABC's notion of beams
419 @item -o,--output=@var{file}
420 set output filename to @var{file}.
422 be strict about success
424 print version information.
427 There is a rudimentary facility for adding LilyPond code to the ABC
428 source file. If you say:
431 %%LY voices \set autoBeaming = ##f
434 This will cause the text following the keyword @q{voices} to be inserted
435 into the current voice of the LilyPond output file.
440 %%LY slyrics more words
443 will cause the text following the @q{slyrics} keyword to be inserted
444 into the current line of lyrics.
449 The ABC standard is not very @q{standard}. For extended features
450 (e.g., polyphonic music) different conventions exist.
452 Multiple tunes in one file cannot be converted.
454 ABC synchronizes words and notes at the beginning of a line;
455 @command{abc2ly} does not.
457 @command{abc2ly} ignores the ABC beaming.
460 @node Invoking etf2ly
461 @subsection Invoking @command{etf2ly}
463 @warning{This program is not supported, and may be remove from
464 future versions of LilyPond.}
469 @cindex Coda Technology
471 ETF (Enigma Transport Format) is a format used by Coda Music
472 Technology's Finale product. @command{etf2ly} will convert part of an ETF
473 file to a ready-to-use LilyPond file.
475 It is invoked from the command-line as follows.
478 etf2ly [@var{option}]@dots{} @var{etf-file}
481 Note that by @q{command-line}, we mean the command line of the
482 operating system. See @ref{Converting from other formats}, for
483 more information about this.
485 The following options are supported by @command{etf2ly}:
490 @item -o,--output=@var{FILE}
491 set output filename to @var{FILE}
499 The list of articulation scripts is incomplete. Empty measures
500 confuse @command{etf2ly}. Sequences of grace notes are ended improperly.
504 @subsection Other formats
506 @cindex External programs, generating LilyPond files
508 LilyPond itself does not come with support for any other formats,
509 but some external tools can also generate LilyPond files. These
510 are listed in @rweb{Alternate editors}.
514 @node LilyPond output in other programs
515 @section LilyPond output in other programs
517 This section shows methods to integrate text and music, different than
518 the automated method with @command{lilypond-book}.
521 * Many quotes from a large score::
522 * Inserting LilyPond output into OpenOffice.org::
523 * Inserting LilyPond output into other programs::
526 @node Many quotes from a large score
527 @unnumberedsubsec Many quotes from a large score
529 If you need to quote many fragments from a large score, you can also use
530 the clip systems feature, see @ruser{Extracting fragments of music}.
533 @node Inserting LilyPond output into OpenOffice.org
534 @unnumberedsubsec Inserting LilyPond output into OpenOffice.org
536 @cindex OpenOffice.org
538 LilyPond notation can be added to OpenOffice.org with
539 @uref{http://@/ooolilypond@/.sourceforge@/.net@/,OOoLilyPond}.
542 @node Inserting LilyPond output into other programs
543 @unnumberedsubsec Inserting LilyPond output into other programs
545 To insert LilyPond output in other programs, use @code{lilypond}
546 instead of @code{lilypond-book}. Each example must be created
547 individually and added to the document; consult the documentation for
548 that program. Most programs will be able to insert LilyPond output in
549 @file{PNG}, @file{EPS}, or @file{PDF} formats.
551 To reduce the white space around your LilyPond score, use
552 the following options
560 bookTitleMarkup = ##f
561 scoreTitleMarkup = ##f
567 To produce a useful @file{EPS} file, use
570 lilypond -dbackend=eps -dno-gs-load-fonts -dinclude-eps-fonts myfile.ly
573 lilypond -dbackend=eps -dno-gs-load-fonts -dinclude-eps-fonts --png myfile.ly