]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/usage/external.itely
Merge branch 'lilypond/translation' of ssh://git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / Documentation / usage / external.itely
1 @c -*- coding: utf-8; mode: texinfo; -*-
2
3 @ignore
4     Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
5
6     When revising a translation, copy the HEAD committish of the
7     version that you are working on.  For details, see the Contributors'
8     Guide, node Updating translation committishes..
9 @end ignore
10
11 @c \version "2.12.0"
12
13 @node External programs
14 @chapter External programs
15
16 FIXME: blah blah
17
18
19 @menu
20 * Point and click::
21 * Text editor support::
22 * Converting from other formats::
23 * LilyPond output in other programs::
24 * Independent includes::
25 @end menu
26
27
28 @node Point and click
29 @section Point and click
30
31 @cindex point and click
32
33 Point and click lets you find notes in the input by clicking on them
34 in the PDF viewer.  This makes it easier to find input that causes
35 some error in the sheet music.
36
37 When this functionality is active, LilyPond adds hyperlinks to the PDF
38 file.  These hyperlinks are sent to the web-browser, which opens a
39 text-editor with the cursor in the right place.
40
41 To make this chain work, you should configure your PDF viewer to
42 follow hyperlinks using the @file{lilypond-invoke-editor} script
43 supplied with LilyPond.
44
45 For Xpdf on UNIX, the following should be present in
46 @file{xpdfrc}@footnote{On UNIX, this file is found either in
47 @file{/etc/xpdfrc} or as @file{.xpdfrc} in your home directory.}
48
49 @example
50 urlCommand     "lilypond-invoke-editor %s"
51 @end example
52
53 The program @file{lilypond-invoke-editor} is a small helper
54 program.  It will invoke an editor for the special @code{textedit}
55 URIs, and run a web browser for others.  It tests the environment
56 variable @code{EDITOR} for the following patterns,
57
58 @table @code
59 @item emacs
60   this will invoke
61 @example
62 emacsclient --no-wait +@var{line}:@var{column} @var{file}
63 @end example
64 @item gvim
65   this will invoke
66 @example
67 gvim --remote +:@var{line}:norm@var{column} @var{file}
68 @end example
69
70 @item nedit
71 this will invoke
72 @example
73   nc -noask +@var{line} @var{file}'
74 @end example
75 @end table
76
77 The environment variable @code{LYEDITOR} is used to override this.  It
78 contains the command line to start the editor, where @code{%(file)s},
79 @code{%(column)s}, @code{%(line)s} is replaced with the file, column
80 and line respectively.  The  setting
81
82 @example
83 emacsclient --no-wait +%(line)s:%(column)s %(file)s
84 @end example
85
86 @noindent
87 for @code{LYEDITOR} is equivalent to the standard emacsclient
88 invocation.
89
90
91 @cindex file size, output
92
93 The point and click links enlarge the output files significantly.  For
94 reducing the size of PDF and PS files, point and click may be switched
95 off by issuing
96
97 @example
98 \pointAndClickOff
99 @end example
100
101 @noindent
102 in a @file{.ly} file.  Point and click may be explicitly enabled with
103
104 @example
105 \pointAndClickOn
106 @end example
107
108 Alternately, you may disable point and click with a command-line
109 option:
110
111 @example
112 lilypond -dno-point-and-click file.ly
113 @end example
114
115 @warning{You should always turn off point and click in any LilyPond
116 files to be distributed to avoid including path information about
117 your computer in the .pdf file, which can pose a security risk.}
118 @node Text editor support
119 @section Text editor support
120
121 @cindex editors
122 @cindex vim
123 @cindex emacs
124 @cindex modes, editor
125 @cindex syntax coloring
126 @cindex coloring, syntax
127
128 There is support for different text editors for LilyPond.
129
130 @menu
131 * Emacs mode::
132 * Vim mode::
133 * Other editors::
134 @end menu
135
136 @node Emacs mode
137 @unnumberedsubsec Emacs mode
138
139 Emacs has a @file{lilypond-mode}, which provides keyword
140 autocompletion, indentation, LilyPond specific parenthesis matching
141 and syntax coloring, handy compile short-cuts and reading LilyPond
142 manuals using Info.  If @file{lilypond-mode} is not installed on your
143 platform, see below.
144
145 An Emacs mode for entering music and running LilyPond is contained in
146 the source archive in the @file{elisp} directory.  Do @command{make
147 install} to install it to @var{elispdir}.  The file @file{lilypond-init.el}
148 should be placed to @var{load-path}@file{/site-start.d/} or appended
149 to your @file{~/.emacs} or @file{~/.emacs.el}.
150
151 As a user, you may want add your source path (e.g. @file{~/site-lisp/}) to
152 your @var{load-path} by appending the following line (as modified) to your
153 @file{~/.emacs}
154
155 @c any reason we do not advise:  (push "~/site-lisp" load-path)
156 @example
157 (setq load-path (append (list (expand-file-name "~/site-lisp")) load-path))
158 @end example
159
160
161 @node Vim mode
162 @unnumberedsubsec Vim mode
163
164 For @uref{http://@/www@/.vim@/.org,VIM}, a @file{vimrc} is supplied,
165 along with syntax coloring tools.  A Vim mode for entering music and
166 running LilyPond is contained in the source archive in @code{$VIM}
167 directory.
168
169 The LilyPond file type is detected if the file
170 @file{~/.vim/filetype.vim} has the following content
171
172 @example
173 if exists("did_load_filetypes")
174   finish
175 endif
176 augroup filetypedetect
177   au! BufNewFile,BufRead *.ly,*.ily           setf lilypond
178 augroup END
179 @end example
180
181 Please include this path by appending the following line to your
182 @file{~/.vimrc}
183
184 @example
185 set runtimepath+=/usr/local/share/lilypond/$@{LILYPOND_VERSION@}/vim/
186 @end example
187
188 @noindent
189 where $@{LILYPOND_VERSION@} is your LilyPond version.  If LilyPond was not
190 installed in @file{/usr/local/}, then change this path accordingly.
191 The path may differ significantly. In Fedora the path leads to the
192 current version of Vim instead of Lilypond:
193
194 @example
195 set runtimepath+=/usr/share/vim/vim72/
196 @end example
197
198
199 @node Other editors
200 @unnumberedsubsec Other editors
201
202 Other editors (both text and graphical) support LilyPond, but
203 their special configuration files are not distributed with
204 LilyPond.  Consult their documentation for more information.  Such
205 editors are listed in @rweb{Alternate editors}.
206
207
208 @node Converting from other formats
209 @section Converting from other formats
210
211 Music can be entered also by importing it from other formats.  This
212 chapter documents the tools included in the distribution to do so.
213 There are other tools that produce LilyPond input, for example GUI
214 sequencers and XML converters.  Refer to the
215 @uref{http://@/lilypond@/.org,website} for more details.
216
217 These are separate programs from @command{lilypond} itself, and are
218 run on the command line; see @ref{Command-line usage} for more
219 information.  If you have MacOS 10.3 or 10.4 and you have trouble
220 running some of these scripts, e.g. @code{convert-ly}, see
221 @rweb{MacOS X}.
222
223
224 @knownissues
225 We unfortunately do not have the resources to maintain these
226 programs; please consider them @qq{as-is}.  Patches are appreciated, but
227 bug reports will almost certainly not be resolved.
228
229 @menu
230 * Invoking midi2ly::            Importing MIDI.
231 * Invoking musicxml2ly::        Importing MusicXML.
232 * Invoking abc2ly::             Importing ABC.
233 * Invoking etf2ly::             Importing Finale.
234 * Other formats::
235 @end menu
236
237
238
239 @node Invoking midi2ly
240 @subsection Invoking @command{midi2ly}
241
242 @cindex MIDI
243
244 @command{midi2ly} translates a Type@tie{}1 MIDI file to a LilyPond source
245 file.
246
247 MIDI (Music Instrument Digital Interface) is a standard for digital
248 instruments: it specifies cabling, a serial protocol and a file
249 format.  The MIDI file format is a de facto standard format for
250 exporting music from other programs, so this capability may come in
251 useful when importing files from a program that has a converter for a
252 direct format.
253
254 @command{midi2ly} converts tracks into @rinternals{Staff} and
255 channels into @rinternals{Voice} contexts.  Relative mode is used
256 for pitches, durations are only written when necessary.
257
258 It is possible to record a MIDI file using a digital keyboard, and
259 then convert it to @file{.ly}.  However, human players are not
260 rhythmically exact enough to make a MIDI to LY conversion trivial.
261 When invoked with quantizing (@code{-s} and @code{-d} options)
262 @command{midi2ly} tries to compensate for these timing errors, but is not
263 very good at this.  It is therefore not recommended to use @command{midi2ly}
264 for human-generated midi files.
265
266
267 It is invoked from the command-line as follows,
268 @example
269 midi2ly [@var{option}]@dots{} @var{midi-file}
270 @end example
271
272 Note that by @q{command-line}, we mean the command line of the
273 operating system.  See @ref{Converting from other formats}, for
274 more information about this.
275
276 The following options are supported by @command{midi2ly}.
277
278 @table @code
279 @item -a, --absolute-pitches
280 Print absolute pitches.
281
282 @item -d, --duration-quant=@var{DUR}
283 Quantize note durations on @var{DUR}.
284
285 @item -e, --explicit-durations
286 Print explicit durations.
287
288 @item -h,--help
289 Show summary of usage.
290
291 @item -k, --key=@var{acc}[:@var{minor}]
292 Set default key.  @math{@var{acc} > 0} sets number of sharps;
293 @math{@var{acc} < 0} sets number of flats.  A minor key is indicated by
294 @code{:1}.
295
296 @item -o, --output=@var{file}
297 Write output to @var{file}.
298
299 @item -s, --start-quant=@var{DUR}
300 Quantize note starts on @var{DUR}.
301
302 @item -t, --allow-tuplet=@var{DUR}*@var{NUM}/@var{DEN}
303 Allow tuplet durations @var{DUR}*@var{NUM}/@var{DEN}.
304
305 @item -v, --verbose
306 Be verbose.
307
308 @item -V, --version
309 Print version number.
310
311 @item -w, --warranty
312 Show warranty and copyright.
313
314 @item -x, --text-lyrics
315 Treat every text as a lyric.
316 @end table
317
318
319 @knownissues
320
321 Overlapping notes in an arpeggio will not be correctly rendered.  The
322 first note will be read and the others will be ignored.  Set them all
323 to a single duration and add phrase markings or pedal indicators.
324
325
326 @node Invoking musicxml2ly
327 @subsection Invoking @code{musicxml2ly}
328
329 @cindex MusicXML
330
331 @uref{http://@/www.@/musicxml@/.org/,MusicXML} is an XML dialect
332 for representing music notation.
333
334 @command{musicxml2ly} extracts the notes, articulations, score structure,
335 lyrics, etc. from part-wise MusicXML files, and writes them to a .ly
336 file.  It is invoked from the command-line.
337
338
339 It is invoked from the command-line as follows,
340 @example
341 musicxml2ly [@var{option}]@dots{} @var{xml-file}
342 @end example
343
344 Note that by @q{command-line}, we mean the command line of the
345 operating system.  See @ref{Converting from other formats}, for
346 more information about this.
347
348 If the given filename is @file{-}, @command{musicxml2ly} reads input
349 from the command line.
350
351 The following options are supported by @command{musicxml2ly}:
352
353 @table @code
354 @item -a, --absolute
355 convert pitches in absolute mode.
356
357 @item -h,--help
358 print usage and option summary.
359
360 @item -l, --language=LANG
361 use a different language file 'LANG.ly' and corresponding pitch names,
362 e.g. 'deutsch' for deutsch.ly and German note names.
363
364 @item --lxml
365 use the lxml.etree Python package for XML-parsing; uses less memory and cpu time.
366
367 @item --nd --no-articulation-directions
368 do not convert directions (@code{^}, @code{_} or @code{-}) for
369 articulations, dynamics, etc.
370
371 @item --no-beaming
372 do not convert beaming information, use LilyPond's automatic
373 beaming instead.
374
375 @item -o,--output=@var{file}
376 set output filename to @var{file}.  If @var{file} is @file{-}, the output
377 will be printed on stdout.  If not given, @var{xml-file}@file{.ly} will
378 be used.
379
380 @item -r,--relative
381 convert pitches in relative mode (default).
382
383 @item -v,--verbose
384 be verbose.
385
386 @item --version
387 print version information.
388
389 @item -z,--compressed
390 input file is a zip-compressed MusicXML file.
391 @end table
392
393
394 @node Invoking abc2ly
395 @subsection Invoking @code{abc2ly}
396
397 @warning{This program is not supported, and may be remove from
398 future versions of LilyPond.}
399
400 @cindex ABC
401
402 ABC is a fairly simple ASCII based format.  It is described at the ABC site:
403
404 @quotation
405 @uref{http://@/www@/.walshaw@/.plus@/.com/@/abc/@/learn@/.html}.
406 @end quotation
407
408 @command{abc2ly} translates from ABC to LilyPond.  It is invoked as follows:
409
410 @example
411 abc2ly [@var{option}]@dots{} @var{abc-file}
412 @end example
413
414 The following options are supported by @command{abc2ly}:
415
416 @table @code
417 @item -b,--beams=None
418 preserve ABC's notion of beams
419 @item -h,--help
420 this help
421 @item -o,--output=@var{file}
422 set output filename to @var{file}.
423 @item -s,--strict
424 be strict about success
425 @item --version
426 print version information.
427 @end table
428
429 There is a rudimentary facility for adding LilyPond code to the ABC
430 source file.  If you say:
431
432 @example
433 %%LY voices \set autoBeaming = ##f
434 @end example
435
436 This will cause the text following the keyword @q{voices} to be inserted
437 into the current voice of the LilyPond output file.
438
439 Similarly,
440
441 @example
442 %%LY slyrics more words
443 @end example
444
445 will cause the text following the @q{slyrics} keyword to be inserted
446 into the current line of lyrics.
447
448
449 @knownissues
450
451 The ABC standard is not very @q{standard}.  For extended features
452 (e.g., polyphonic music) different conventions exist.
453
454 Multiple tunes in one file cannot be converted.
455
456 ABC synchronizes words and notes at the beginning of a line;
457 @command{abc2ly} does not.
458
459 @command{abc2ly} ignores the ABC beaming.
460
461
462 @node Invoking etf2ly
463 @subsection Invoking @command{etf2ly}
464
465 @warning{This program is not supported, and may be remove from
466 future versions of LilyPond.}
467
468 @cindex ETF
469 @cindex enigma
470 @cindex Finale
471 @cindex Coda Technology
472
473 ETF (Enigma Transport Format) is a format used by Coda Music
474 Technology's Finale product.  @command{etf2ly} will convert part of an ETF
475 file to a ready-to-use LilyPond file.
476
477 It is invoked from the command-line as follows.
478
479 @example
480 etf2ly [@var{option}]@dots{} @var{etf-file}
481 @end example
482
483 Note that by @q{command-line}, we mean the command line of the
484 operating system.  See @ref{Converting from other formats}, for
485 more information about this.
486
487 The following options are supported by @command{etf2ly}:
488
489 @table @code
490 @item -h,--help
491 this help
492 @item -o,--output=@var{FILE}
493 set output filename to @var{FILE}
494 @item --version
495 version information
496 @end table
497
498
499 @knownissues
500
501 The list of articulation scripts is incomplete.  Empty measures
502 confuse @command{etf2ly}.  Sequences of grace notes are ended improperly.
503
504
505 @node Other formats
506 @subsection Other formats
507
508 @cindex External programs, generating LilyPond files
509
510 LilyPond itself does not come with support for any other formats,
511 but some external tools can also generate LilyPond files.  These
512 are listed in @rweb{Alternate editors}.
513
514
515
516 @node LilyPond output in other programs
517 @section LilyPond output in other programs
518
519 This section shows methods to integrate text and music, different than
520 the automated method with @command{lilypond-book}.
521
522 @menu
523 * Many quotes from a large score::
524 * Inserting LilyPond output into OpenOffice.org::
525 * Inserting LilyPond output into other programs::
526 @end menu
527
528 @node Many quotes from a large score
529 @unnumberedsubsec Many quotes from a large score
530
531 If you need to quote many fragments from a large score, you can also use
532 the clip systems feature, see @ruser{Extracting fragments of music}.
533
534
535 @node Inserting LilyPond output into OpenOffice.org
536 @unnumberedsubsec Inserting LilyPond output into OpenOffice.org
537
538 @cindex OpenOffice.org
539
540 LilyPond notation can be added to OpenOffice.org with
541 @uref{http://@/ooolilypond@/.sourceforge@/.net@/,OOoLilyPond}.
542
543
544 @node Inserting LilyPond output into other programs
545 @unnumberedsubsec Inserting LilyPond output into other programs
546
547 To insert LilyPond output in other programs, use @code{lilypond}
548 instead of @code{lilypond-book}.  Each example must be created
549 individually and added to the document; consult the documentation for
550 that program.  Most programs will be able to insert LilyPond output in
551 @file{PNG}, @file{EPS}, or @file{PDF} formats.
552
553 To reduce the white space around your LilyPond score, use
554 the following options
555
556 @example
557 \paper@{
558   indent=0\mm
559   line-width=120\mm
560   oddFooterMarkup=##f
561   oddHeaderMarkup=##f
562   bookTitleMarkup = ##f
563   scoreTitleMarkup = ##f
564 @}
565
566 @{ c1 @}
567 @end example
568
569 To produce a useful @file{EPS} file, use
570
571 @example
572 lilypond -dbackend=eps -dno-gs-load-fonts -dinclude-eps-fonts   myfile.ly
573
574 @file{PNG}:
575 lilypond -dbackend=eps -dno-gs-load-fonts -dinclude-eps-fonts --png myfile.ly
576 @end example
577
578
579 @node Independent includes
580 @section Independent @code{include}s
581
582 FIXME: blah blah
583
584 @menu
585 * MIDI articulation::
586 @end menu
587
588
589 @node MIDI articulation
590 @subsection MIDI articulation
591
592 stub for info about Dr. Peter Chubb's @file{articulate.ly}
593
594