GNU LilyPond — アプリケーション使用方法

このドキュメントは PDF 形式複数のページにインデックス化された形式 でも利用可能です。

このファイルは GNU LilyPond プログラムの使用方法についてのドキュメントです。

Copyright © 1999–2010 著作者一同

The translation of the following copyright notice is provided for courtesy to non-English speakers, but only the notice in English legally counts.

以下は英語を話さない人々のための著作権についての注意書きです。しかしながら、英語で書かれた注意書きだけが法的に有効です。

GNU フリー文書利用許諾契約書バージョン 1.1 またはフリー ソフトウェア財団によって発行されたその後のバージョンの約定に従う限り、このドキュメントを複製、変更する許可を与えます。変更不可部分はありません。この利用許諾契約書のコピーは 「GNU フリー文書利用許諾契約書」 という章に含まれています。

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections. A copy of the license is included in the section entitled “GNU Free Documentation License”.

これは GNU LilyPond バージョン 2.13.45 のためのアプリケーション使用方法マニュアルです。このドキュメントと他のドキュメントとの関係についての更なる情報は、FIXME FIXME FIXME を参照してください。

http://www.lilypond.org/ で更なる情報を見つけることができます。このウェブ サイトにはこのドキュメントと他のドキュメントのオンライン コピーがあります。

我々はこのプログラムを音楽を通じて出会ったすべての友人達に捧げたいと思います。

Han-Wen と Jan

用する


1. lilypond を実行する

この章では LilyPond を実行するための細かな規定について詳述します。


1.1 通常の使用方法

たいていのユーザは GUI から LilyPond を実行します。FIXME FIXME FIXME をまだ読んでいないのなら、それを読んでください。


1.2 コマンド ラインの使用方法

この節にはコマンド ラインで LilyPond を使用するための追加情報が含まれます。これにはプログラムに追加オプションを渡す必要があるかもしれません。さらに、いくつかの特別なプログラム (midi2ly など) はコマンド ラインからしか利用できません。

ここで ‘コマンド ライン’ とは、OS の中にあるコマンド ラインを意味します。Windows ユーザは ‘DOS シェル’ という言葉の方が馴染みがあるかもしれません。MaxOS X ユーザは ‘ターミナル’ や ‘コンソール’ という言葉の方が馴染みがあるかもしれません。MaxOS X ユーザは FIXME も読んでおくべきです。

OS のコマンド ラインの使用方法についての説明はこのマニュアルが扱う範囲ではありません。コマンド ラインに馴染みがない場合は、その内容を扱っている他のドキュメントをあたってください。


1.2.1 lilypond を呼び出す

lilypond 実行可能形式ファイルはコマンド ラインから以下のように呼び出されます。

lilypond [option]… file

拡張子を持たないファイル名で呼び出された場合、‘.ly’ が最初に試されます。sudin から入力を読み込む場合には、file に対してダッシュ (-) を使用します。

filename.ly’ が処理されると、lilypond は出力として ‘filename.ps’ と ‘filename.pdf’ を作り出します。いくつかのファイルを指定することもできます。その場合、それらのファイルは個々に処理されます。1

filename.ly’ が複数の \score を含んでいる場合、2 つ目以降の score は ‘filename-1.pdf’ から始まる番号付きのファイルに出力されます。さらに、output-suffix がベース名と番号の間に挿入されます。以下の内容を含んでいる入力ファイルは

#(define output-suffix "violin")
\book { … }
#(define output-suffix "cello")
\book { … }

base-violin.pdf’ と base-cello-1.pdf’ を出力します。


1.2.2 lilypond のコマンド ライン オプション

以下のオプションがサポートされます:

-e,--evaluate=expr

.ly’ ファイルを解析する前に Scheme expr を評価します。複数の -e オプションが与えられた場合、それらは順番に評価されます。

表記は guile-user モジュールの中で評価されます。そのため、expr の中で definition を使いたいのならば、.ly ファイルに以下をインクルードして:

#(use-modules (guile-user))

コマンド ラインで以下を使用します:

lilypond -e '(define-public a 42)'
-f,--format=format

フォーマットを指定します。format には svg, ps, pdf, png を選択します。

例: lilypond -fpng filename.ly

-d,--define-default=var=val

これは内部プログラム オプション var に Scheme 値 val をセットします。val が提供されていない場合、#t が使用されます。オプションを OFF にするには、var の接頭辞として no- を付けます。つまり、

-dno-point-and-click

-dpoint-and-click='#f'

と同じです。

ここで興味深いオプションをいくつか挙げます。

help

lilypond -dhelp を実行すると使用可能な -d オプションがすべて表示されます。

paper-size

このオプションはデフォルトの用紙サイズをセットします。

-dpaper-size=\"letter\"

文字列はエスケーブされたクォート ( \" ) で囲まれていなければならないということに注意してください。

safe

.ly 入力を信用してはいけません。

Web サーバを通じて LilyPond フォーマットが利用可能な場合、--safe オプションか --jail オプションのどちらかを渡さなければなりません--safe オプションは以下のようなインライン Scheme コードが大混乱をもたらすことを防ぎます:

#(system "rm -rf /")
{
  c4^#(ly:export (ly:gulp-file "/etc/passwd"))
}

訳者: #(system "rm -rf /") はルート ディレクトリ以下を削除し、export (ly:gulp-file "/etc/passwd") はパスワード ファイルをエクスポートします。

-dsafe オプションはインライン Scheme 表記を特別なセーフ モジュールの中で評価します。このセーフ モジュールは GUILE ‘safe-r5rs’ モジュールから派生したものですが、LilyPond API 関数をいくつか追加しています。これらの関数は ‘scm/safe-lily.scm’ でリスト アップされています。

さらに、セーフ モードは \include 指示を却下し、TeX 文字列の中にあるバックスラッシュを無効にします。

セーフ モードでは、LilyPond 変数を Scheme にインポートすることはできません。

-dsafe はリソースの乱用を検出しません。例えば循環データ構造体をバックエンドに食わせることで、プログラムをハングさせることは可能です。そのため、パブリックにアクセス可能な Web サーバ上で LilyPond を使用する場合、そのプロセスの CPU とメモリの両方の使用は制限されるべきです。

セーフ モードは多くの有用な LilyPond 断片がコンパイルされることを妨げます。--jail はより安全な代替オプションですが、セット アップにより多くの作業を必要とします。

backend

バックエンドに対して使用する出力フォーマットを指定します。format の選択肢には以下があります:

ps

PostScript

Postscript ファイルは TTF, Type1, OTF フォントを含んでいます。これらのフォントのサブセット化 (訳者: フォント セットを使用するフォントに限定すること) は行われません。東洋の文字セットを使用する場合、巨大なファイルになる可能性があります。

eps

縮約された PostScript (EPS)。これは各ページ (システム) をフォントを持たない個別の ‘EPS’ ファイルとして吐き出し、フォントを含めたすべてのページ (システム) を持つ ‘EPS’ ファイルを 1 つ吐き出します。

このモードは lilypond-book でデフォルトで使用されます。

svg

SVG (Scalable Vector Graphics)。これは各ページをフォントを埋め込まれた個別の ‘SVG’ ファイルとして吐き出します。埋め込みフォントをサポートする SVG ビューアか埋め込みフォントを OTF フォントに置き換える機能を持つ SVG ビューアが必要になります。UNIX では、Inkscape (バージョン 0.42 以降) を使うことになるかもしれません。使用前に、OTF フォントを LilyPond ディレクトリ (一般には ‘/usr/share/lilypond/VERSION/fonts/otf/’) から ‘~/.fonts/’ にコピーしてください。

scm

生データ – 内部 Scheme ベース描画コマンド – を吐き出します。

null

譜刻された楽譜を出力しません。-dno-print-pages と同じ効果を持ちます。

例: lilypond -dbackend=svg filename.ly

preview

タイトルとファイル システム情報を保持している出力ファイルを生成します。

print-pages

すべてのページを生成します。デフォルトです。-dno-print-pages-dpreview と組み合わせて使うと有用です。

-h,--help

使用方法の要約を表示します。

-H,--header=FIELD

ヘッダ フィールドをファイル ‘BASENAME.FIELD’ に吐き出します。

--include, -I=directory

directory を入力ファイルのサーチ パスに追加します。

-i,--init=file

init ファイルとして file をセットします (デフォルト: ‘init.ly’)。

-o,--output=FILE

デフォルトの出力ファイルとして FILE をセットします。適切な接尾辞が追加されます (つまり、pdf ならば拡張子 .pdf が追加されます)。

--ps

PostScript を生成します。

--png

各ページの図を PNG フォーマットで生成します。これは内部で --ps を使用します。画像の DPI 解像度は以下のようにセットします:

-dresolution=110
--pdf

PDF を生成します。これは内部で --ps を使用します。

-j,--jail=user,group,jail,dir

lilypond を chroot jail 環境で実行します。(訳者: chroot jail 環境とはセキュリティのためにカレント プロセスに対してルート ディレクトリの位置を変更すること。)

--jail オプションは、Web サーバを通じて LilyPond 譜刻を実行するときや LilyPond が外部から提供されたソースを実行するときに、--safe よりも自由度の高い代替手段を提供します。

--jail オプションはコンパイル プロセスの開始直前に lilypond の ルートを jail に変更します。それからユーザとグループを提供された環境にマッチするように変更し、カレント ディレクトリは dir に変更されます。このセットアップは jail (牢獄) から抜け出せないということを (少なくとも理論的には) 保証します。--jail を指定した lilypond の実行はroot (ユーザ名) として行われる必要があります。通常、これは sudo を用いた安全な方法で行われます。

jail のセットアップは少々デリケートな問題です。LilyPond がソースをコンパイルするのに必要とされるものすべてを jail の内部 で見つけられるということを保証しなければならないからです。一般的なセットアップには以下の項目が含まれます:

専用のファイルシステムをセットアップする

noexec, nodev, nosuid などのセーフ オプションでマウントするための専用ファイルシステムを作成すべきです。こうすることで、LilyPond から実行可能形式ファイルを実行したり、デバイスに直接書き込むことは不可能になります。専用のパーティションを作成することを望まないのなら、適当なサイズのファイルを作成し、それを使用してループ デバイス (ループバック デバイス) をマウントしてください。専用ファイルシステムはさらに、LilyPond が許可されたディスク容量以上には書き込めないということを保証します。

専用のユーザをセットアップする

jail 内部で LilyPond を実行する際、低い権限を持つ専用のユーザとグループ (仮に lily/lily とします) で行うべきです。このユーザが書き込み可能なディレクトリが 1 つだけ存在すべきであり、それを dir に渡します。

jail の準備をする

LilyPond は実行中にいくつかのファイルを読み込む必要があります。それらのファイルをすべて jail にコピーしておきます。それらのファイルが本当のルート ファイル システムで存在しているパスと同じパスにコピーします。LilyPond インストールの内容すべて (例えば、‘/usr/share/lilypond’) をコピーすべきです。

問題が発生した場合、その原因を突き止める最も簡単な方法は strace を使って LilyPond を実行することです。これによりどのファイルが見当たらないのかがわかります。

LilyPond を実行する

noexec でマウントされた jail の中では、外部プログラムを実行することは一切できません。そのため、外部プログラムを必要としないバックエンドで LilyPond を実行しなければなりません。すでに述べたように、jail モードでの LilyPond の実行はスーパーユーザ権限で行われならず (もちろん、その権限はすぐに外されます)、たぶん sudo を使います。LilyPond が使用可能な CPU 時間を数秒に制限する (例えば、ulimit -t を使って) というのは良いアイディアです。さらに、OS がサポートしているのなら、割り当て可能なメモリ容量を制限するというのも良いアイディアです。

-v,--version

バージョン情報を表示します。

-V,--verbose

冗長表示モードにします: 読み込むすべてのファイルのフル パスを表示して、時間情報を表示します。

-w,--warranty

GNU LilyPond の保証責任を表示します。(GNU LilyPond には保証責任はありません!)


1.2.3 環境変数

lilypond は以下の環境変数を認識します:

LILYPOND_DATADIR

これはデフォルトで参照するロケール メッセージとデータ ファイルがあるディレクトリを指定します。このディレクトリは ‘ly/’, ‘ps/’, ‘tex/’ などのサブディレクトリを保持しているべきです。

LANG

これはワーニング メッセージの言語を選択します。

LILYPOND_GC_YIELD

この変数を使ってメモリ使用量とパフォーマンスを調節することができます。これはメモリ管理の振る舞いを調整するパーセント値です。高い値にするとプログラムはより多くのメモリを使用し、低い値にするとより多くの CPU 時間を使用します。デフォルト値は 70 です。


1.3 エラー メッセージ

ファイルのコンパイルの最中にはさまざまなエラー メッセージが表示される可能性があります。

Warning

何か疑わしいことがあります。あなたが何か普通でないことをリクエストしている場合は、そのメッセージを理解して、それを無視することができます。しかしながら、Warning は通常、入力ファイルに何か問題があることを示しています。

Error

何か明らかに問題があります。カレントの処理ステップ (構文解析、構文解釈、フォーマット) は終了され、次のステップは飛ばされます。

Fatal error

何か明らかに問題があり、LilyPond はコンパイルを続けられません。これが起きることは稀です。これが起こるのはたいてい、フォントのインストールに問題があるためです。

Scheme error

Scheme コードの実行中に発生するこのエラーは Scheme インタプリタによって引き起こされます。冗長オプション (-V または --verbose) 付きで実行している場合、問題となっている関数呼び出しの呼び出し追跡が表示されます。

Programming error

内部的な矛盾があります。このエラー メッセージはプログラマとデバッガを助けることを意図したものです。通常、それらは無視できます。時々、それらは非常に大きなメッセージとなり、他の出力を見えにくくします。

Aborted (core dumped)

これは、プログラムをクラッシュさせる深刻なプログラミング エラーを示しています。そのようなエラーは決定的なものだと考えられます。あなたがそのようなエラーでつまずいた場合、バグ レポートを送ってください。

警告とエラーを入力ファイルのある部分にリンクさせることが可能な場合、エラー メッセージは以下のような形式になります:

filename:lineno:columnno: message
offending input line

エラーが見つかった場所を示すために問題のある行に改行が挿入されます。例えば:

test.ly:2:19: error: not a duration: 5
  { c'4 e'
           5 g' }

これらの位置は LilyPond が警告やエラーが発生した位置を最善を尽くして推測したものですが、(ごく当たり前のことですが) 警告とエラーは何か予期しないことが起こったときに発生するものです。入力ファイルの示された行にエラーを見つけることができない場合は、示された位置の 1 行か 2 行上をチェックしてみてください。


2. convert-ly を使ってファイルを更新する

LilyPond の入力構文は、さまざまな方法で単純化または改善するために、定期的に変更されます。その副作用として、LilyPond のインタプリタはしばしば古い入力ファイルと互換性を持たなくなります。これを救済するために、プログラム convert-ly を用いることで、たいていの LilyPond のバージョン間での構文変更を処理することができます。


2.1 何故構文は変更されるのか?


2.2 convert-ly を呼び出す

convert-ly は古いバージョン番号を検出するために入力ファイルの version ステートメントを使用します。たいていの場合、あなたの入力ファイルをアップグレードするには、そのファイルを保持しているディレクトリで以下を実行することで十分です:

convert-ly -e myfile.ly

これにより、myfile.ly はアップグレードされ、オリジナル ファイルは myfile.ly~ に保存されます。

ディレクトリの中にある入力ファイルをすべて変換するには、以下のようにします:

convert-ly -e *.ly

オリジナル ファイルをアップグレードされたファイルで置き換える代わりに、アップグレードされたファイルに異なるファイル名を指定して、オリジナル ファイルをそのまま残しておくには、以下のようにします:

convert-ly myfile.ly > mynewfile.ly

convert-ly は常にそれが扱っている最新の構文変更に変換します。このことは、通常、ファイルの中にある version 番号は convert-ly 自体のバージョンよりも低いということを意味します。

このプログラムは変換元のバージョン番号をリストアップします。 バージョン番号がリストアップされない場合、そのファイルは最新であるということになります。

MacOS X ユーザはこのコマンドをメニュー エントリ (Compile > Update syntax) 下で実行することになるかもしれません。

Windows ユーザはこれらのコマンドを ‘コマンド プロンプト’ ウィンドウから実行する必要があります。コマンド プロンプトは通常、スタート > アクセサリ > コマンド プロンプト で見つかります。


2.3 convert-ly のコマンド ライン オプション

一般に、このプログラムは以下のように呼び出されます:

convert-ly [option]… filename

以下のオプションを与えることができます:

-e,--edit

Apply the conversions direct to the input file, modifying it in-place.

-f,--from=from-patchlevel

変換元のバージョンをセットします。これがセットされていない場合、convert-ly は入力ファイルの中にある version 文字列を基に推測します。例: --from=2.10.25

-n,--no-version

通常、convert-ly\version インジケータを出力に付け加えます。このオプションを指定すると、それを抑制します。

-s, --show-rules

すべての変換を表示して、終了します。

--to=to-patchlevel

変換先のバージョンをセットします。デフォルトは利用可能な最新バージョンです。例: --to=2.12.2

-h, --help

使用方法についてのヘルプを表示します。

texinfo ファイルの中にある LilyPond 断片をアップグレードするには以下を使用してください:

convert-ly --from=... --to=... --no-version *.itely

2 つのバージョン間での LilyPond 構文の変更を調べるには、以下を使用してください:

convert-ly --from=... --to=... -s

2.4 convert-ly の問題点

Windows の ‘コマンド プロンプト’ ウィンドウからスペースを含むファイル名やパスを持つファイルに対してconvert-ly を実行する場合、入力ファイル名全体を 3 つ (!) のダブル クォートで囲む必要があります:

convert-ly """D:/My Scores/Ode.ly""" > "D:/My Scores/new Ode.ly"

convert-ly -e *.ly コマンドが展開時に長くなりすぎて失敗する場合、convert-ly コマンドをループさせてやります。以下の例は UNIX 用であり、カレント ディレクトリの中にあるすべての .ly ファイルをアップグレードします:

for f in *.ly; do convert-ly -e $f; done;

Windows の ‘コマンド プロンプト’ ウィンドウでの上の例に対応するコマンドは以下の通りです:

for %x in (*.ly) do convert-ly -e """%x"""

言語の変更がすべて処理されるわけではありません。指定できる出力オプションは 1 つだけです。自動的に Scheme と更新することと LilyPond の Scheme インタフェイスを更新することはまったく異なります。Scheme コードの調整は手動で行う覚悟でいてください。

convert-ly が処理できないことがいくつかあります。ここに、LilyPond コミュニティがそのことについて訴えたリストを挙げます。

convert-ly は必要とされるすべての変更をスムーズに実装できるような構造にはなっていないため、このようなバグ レポートがあります。以下は対応して欲しいという望みのリストであり、参照のためにここに置かれています。

1.6->2.0:
 Doesn't always convert figured bass correctly, specifically things like {<
>}.  Mats' comment on working around this:
   To be able to run convert-ly
   on it, I first replaced all occurrences of '{<' to some dummy like '{#'
   and similarly I replaced '>}' with '&}'.  After the conversion, I could
   then change back from '{ #' to '{ <' and from '& }' to '> }'.
 Doesn't convert all text markup correctly.  In the old markup syntax,
 it was possible to group a number of markup commands together within
parentheses, e.g.
   -#'((bold italic) "string")
   This will incorrectly be converted into
   -\markup{{\bold italic} "string"}
   instead of the correct
   -\markup{\bold \italic "string"}
2.0->2.2:
 Doesn't handle \partcombine
 Doesn't do \addlyrics => \lyricsto, this breaks some scores with multiple
stanzas.
2.0->2.4:
 \magnify isn't changed to \fontsize.
    - \magnify #m => \fontsize #f, where f = 6ln(m)/ln(2)
 remove-tag isn't changed.
    - \applyMusic #(remove-tag '. . .) => \keepWithTag #'. . .
 first-page-number isn't changed.
    - first-page-number no => print-first-page-number = ##f
 Line breaks in header strings aren't converted.
    - \\\\  as line break in \header strings => \markup \center-align <
      "First Line" "Second Line" >
 Crescendo and decrescendo terminators aren't converted.
    - \rced => \!
    - \rc => \!
2.2->2.4:
 \turnOff (used in \set Staff.VoltaBracket = \turnOff) is not properly
converted.
2.4.2->2.5.9
 \markup{ \center-align <{ ... }> } should be converted to:
 \markup{ \center-align {\line { ... }} }
 but now, \line is missing.
2.4->2.6
 Special LaTeX characters such as $~$ in text are not converted to UTF8.
2.8
 \score{} must now begin with a music expression.  Anything else
 (particularly \header{}) must come after the music.

3. lilypond-book: Integrating text and music

If you want to add pictures of music to a document, you can simply do it the way you would do with other types of pictures. The pictures are created separately, yielding PostScript output or PNG images, and those are included into a LaTeX or HTML document.

lilypond-book provides a way to automate this process: This program extracts snippets of music from your document, runs lilypond on them, and outputs the document with pictures substituted for the music. The line width and font size definitions for the music are adjusted to match the layout of your document.

This is a separate program from lilypond itself, and is run on the command line; for more information, see コマンド ラインの使用方法. If you have MacOS 10.3 or 10.4 and you have trouble running lilypond-book, see FIXME FIXME

This procedure may be applied to LaTeX, HTML, Texinfo or DocBook documents.


3.1 An example of a musicological document

Some texts contain music examples. These texts are musicological treatises, songbooks, or manuals like this. Such texts can be made by hand, simply by importing a PostScript figure into the word processor. However, there is an automated procedure to reduce the amount of work involved in HTML, LaTeX, Texinfo and DocBook documents.

A script called lilypond-book will extract the music fragments, format them, and put back the resulting notation. Here we show a small example for use with LaTeX. The example also contains explanatory text, so we will not comment on it further.

Input

\documentclass[a4paper]{article}

\begin{document}

Documents for \verb+lilypond-book+ may freely mix music and text.
For example,

\begin{lilypond}
\relative c' {
  c2 e2 \times 2/3 { f8 a b } a2 e4
}
\end{lilypond}

Options are put in brackets.

\begin{lilypond}[fragment,quote,staffsize=26,verbatim]
  c'4 f16
\end{lilypond}

Larger examples can be put into a separate file, and introduced with
\verb+\lilypondfile+.

\lilypondfile[quote,noindent]{screech-boink.ly}

(If needed, replace screech-boink.ly by any .ly file you put in the same
directory as this file.)

\end{document}

Processing

Save the code above to a file called ‘lilybook.lytex’, then in a terminal run

lilypond-book --output=out --pdf lilybook.lytex
lilypond-book (GNU LilyPond) 2.13.45 
Reading lilybook.lytex...
..lots of stuff deleted..
Compiling lilybook.tex...
cd out
pdflatex lilybook
..lots of stuff deleted..
xpdf lilybook
(replace xpdf by your favorite PDF viewer)

Running lilypond-book and latex creates a lot of temporary files, which would clutter up the working directory. To remedy this, use the --output=dir option. It will create the files in a separate subdirectory ‘dir’.

Finally the result of the LaTeX example shown above.2 This finishes the tutorial section.

Output

Documents for lilypond-book may freely mix music and text. For example,

[image of music]

Options are put in brackets.

c'4 f16

[image of music]

Larger examples can be put into a separate file, and introduced with \lilypondfile.

[image of music]


3.2 Integrating music and text

Here we explain how to integrate LilyPond with various output formats.


3.2.1 LaTeX

LaTeX is the de-facto standard for publishing layouts in the exact sciences. It is built on top of the TeX typesetting engine, providing the best typography available anywhere.

See The Not So Short Introduction to LaTeX for an overview on how to use LaTeX.

Music is entered using

\begin{lilypond}[options,go,here]
  YOUR LILYPOND CODE
\end{lilypond}

or

\lilypondfile[options,go,here]{filename}

or

\lilypond{ YOUR LILYPOND CODE }

Additionally, \lilypondversion displays the current version of lilypond. Running lilypond-book yields a file that can be further processed with LaTeX.

We show some examples here. The lilypond environment

\begin{lilypond}[quote,fragment,staffsize=26]
  c' d' e' f' g'2 g'2
\end{lilypond}

produces

[image of music]

The short version

\lilypond[quote,fragment,staffsize=11]{<c' e' g'>}

produces

[image of music]

Currently, you cannot include { or } within \lilypond{}, so this command is only useful with the fragment option.

The default line width of the music will be adjusted by examining the commands in the document preamble, the part of the document before \begin{document}. The lilypond-book command sends these to LaTeX to find out how wide the text is. The line width for the music fragments is then adjusted to the text width. Note that this heuristic algorithm can fail easily; in such cases it is necessary to use the line-width music fragment option.

Each snippet will call the following macros if they have been defined by the user:

Selected Snippets

Sometimes it is useful to display music elements (such as ties and slurs) as if they continued after the end of the fragment. This can be done by breaking the staff and suppressing inclusion of the rest of the LilyPond output.

In LaTeX, define \betweenLilyPondSystem in such a way that inclusion of other systems is terminated once the required number of systems are included. Since \betweenLilyPondSystem is first called after the first system, including only the first system is trivial.

\def\betweenLilyPondSystem#1{\endinput}

\begin{lilypond}[fragment]
  c'1\( e'( c'~ \break c' d) e f\)
\end{lilypond}

If a greater number of systems is requested, a TeX conditional must be used before the \endinput. In this example, replace ‘2’ by the number of systems you want in the output,

\def\betweenLilyPondSystem#1{
    \ifnum##1<2\else\endinput\fi
}

Remember that the definition of \betweenLilyPondSystem is effective until TeX quits the current group (such as the LaTeX environment) or is overridden by another definition (which is, in most cases, for the rest of the document). To reset your definition, write

\let\betweenLilyPondSystem\undefined

in your LaTeX source.

This may be simplified by defining a TeX macro

\def\onlyFirstNSystems#1{
    \def\betweenLilyPondSystem##1{\ifnum##1<#1\else\endinput\fi}
}

and then saying only how many systems you want before each fragment,

\onlyFirstNSystems{3}
\begin{lilypond}...\end{lilypond}
\onlyFirstNSystems{1}
\begin{lilypond}...\end{lilypond}

参照

There are specific lilypond-book command line options and other details to know when processing LaTeX documents, see Invoking lilypond-book.


3.2.2 Texinfo

Texinfo is the standard format for documentation of the GNU project. An example of a Texinfo document is this manual. The HTML, PDF, and Info versions of the manual are made from the Texinfo document.

In the input file, music is specified with

@lilypond[options,go,here]
  YOUR LILYPOND CODE
@end lilypond

or

@lilypond[options,go,here]{ YOUR LILYPOND CODE }

or

@lilypondfile[options,go,here]{filename}

Additionally, @lilypondversion displays the current version of lilypond.

When lilypond-book is run on it, this results in a Texinfo file (with extension ‘.texi’) containing @image tags for HTML, Info and printed output. lilypond-book generates images of the music in EPS and PDF formats for use in the printed output, and in PNG format for use in HTML and Info output.

We show two simple examples here. A lilypond environment

@lilypond[fragment]
c' d' e' f' g'2 g'
@end lilypond

produces

[image of music]

The short version

@lilypond[fragment,staffsize=11]{<c' e' g'>}

produces

[image of music]

Contrary to LaTeX, @lilypond{...} does not generate an in-line image. It always gets a paragraph of its own.


3.2.3 HTML

Music is entered using

<lilypond fragment relative=2>
\key c \minor c4 es g2
</lilypond>

lilypond-book then produces an HTML file with appropriate image tags for the music fragments:

[image of music]

For inline pictures, use <lilypond ... />, where the options are separated by a colon from the music, for example

Some music in <lilypond relative=2: a b c/> a line of text.

To include separate files, say

<lilypondfile option1 option2 ...>filename</lilypondfile>

Additionally, <lilypondversion/> displays the current version of lilypond.


3.2.4 DocBook

For inserting LilyPond snippets it is good to keep the conformity of our DocBook document, thus allowing us to use DocBook editors, validation etc. So we don’t use custom tags, only specify a convention based on the standard DocBook elements.

Common conventions

For inserting all type of snippets we use the mediaobject and inlinemediaobject element, so our snippets can be formatted inline or not inline. The snippet formatting options are always provided in the role property of the innermost element (see in next sections). Tags are chosen to allow DocBook editors format the content gracefully. The DocBook files to be processed with lilypond-book should have the extension ‘.lyxml’.

Including a LilyPond file

This is the most simple case. We must use the ‘.ly’ extension for the included file, and insert it as a standard imageobject, with the following structure:

<mediaobject>
  <imageobject>
    <imagedata fileref="music1.ly" role="printfilename" />
  </imageobject>
</mediaobject>

Note that you can use mediaobject or inlinemediaobject as the outermost element as you wish.

Including LilyPond code

Including LilyPond code is possible by using a programlisting, where the language is set to lilypond with the following structure:

<inlinemediaobject>
  <textobject>
    <programlisting language="lilypond" role="fragment verbatim staffsize=16 ragged-right relative=2">
\context Staff \with {
  \remove Time_signature_engraver
  \remove Clef_engraver}
  { c4( fis) }
    </programlisting>
  </textobject>
</inlinemediaobject>

As you can see, the outermost element is a mediaobject or inlinemediaobject, and there is a textobject containing the programlisting inside.

Processing the DocBook document

Running lilypond-book on our ‘.lyxml’ file will create a valid DocBook document to be further processed with ‘.xml’ extension. If you use dblatex, it will create a PDF file from this document automatically. For HTML (HTML Help, JavaHelp etc.) generation you can use the official DocBook XSL stylesheets, however, it is possible that you have to make some customization for it.


3.3 Music fragment options

In the following, a ‘LilyPond command’ refers to any command described in the previous sections which is handled by lilypond-book to produce a music snippet. For simplicity, LilyPond commands are only shown in LaTeX syntax.

Note that the option string is parsed from left to right; if an option occurs multiple times, the last one is taken.

The following options are available for LilyPond commands:

staffsize=ht

Set staff size to ht, which is measured in points.

ragged-right

Produce ragged-right lines with natural spacing, i.e., ragged-right = ##t is added to the LilyPond snippet. This is the default for the \lilypond{} command if no line-width option is present. It is also the default for the lilypond environment if the fragment option is set, and no line width is explicitly specified.

noragged-right

For single-line snippets, allow the staff length to be stretched to equal that of the line width, i.e., ragged-right = ##f is added to the LilyPond snippet.

line-width
line-width=size\unit

Set line width to size, using unit as units. unit is one of the following strings: cm, mm, in, or pt. This option affects LilyPond output (this is, the staff length of the music snippet), not the text layout.

If used without an argument, set line width to a default value (as computed with a heuristic algorithm).

If no line-width option is given, lilypond-book tries to guess a default for lilypond environments which don’t use the ragged-right option.

notime

Do not print the time signature, and turns off the timing (time signature, bar lines) in the score.

fragment

Make lilypond-book add some boilerplate code so that you can simply enter, say,

c'4

without \layout, \score, etc.

nofragment

Do not add additional code to complete LilyPond code in music snippets. Since this is the default, nofragment is redundant normally.

indent=size\unit

Set indentation of the first music system to size, using unit as units. unit is one of the following strings: cm, mm, in, or pt. This option affects LilyPond, not the text layout.

noindent

Set indentation of the first music system to zero. This option affects LilyPond, not the text layout. Since no indentation is the default, noindent is redundant normally.

quote

Reduce line length of a music snippet by 2*0.4in and put the output into a quotation block. The value ‘0.4in’ can be controlled with the exampleindent option.

exampleindent

Set the amount by which the quote option indents a music snippet.

relative
relative=n

Use relative octave mode. By default, notes are specified relative to middle C. The optional integer argument specifies the octave of the starting note, where the default 1 is middle C. relative option only works when fragment option is set, so fragment is automatically implied by relative, regardless of the presence of any (no)fragment option in the source.

LilyPond also uses lilypond-book to produce its own documentation. To do that, some more obscure music fragment options are available.

verbatim

The argument of a LilyPond command is copied to the output file and enclosed in a verbatim block, followed by any text given with the intertext option (not implemented yet); then the actual music is displayed. This option does not work well with \lilypond{} if it is part of a paragraph.

If verbatim is used in a lilypondfile command, it is possible to enclose verbatim only a part of the source file. If the source file contain a comment containing ‘begin verbatim’ (without quotes), quoting the source in the verbatim block will start after the last occurrence of such a comment; similarly, quoting the source verbatim will stop just before the first occurrence of a comment containing ‘end verbatim’, if there is any. In the following source file example, the music will be interpreted in relative mode, but the verbatim quote will not show the relative block, i.e.

\relative c' { % begin verbatim
  c4 e2 g4
  f2 e % end verbatim
}

will be printed with a verbatim block like

  c4 e2 g4
  f2 e

If you would like to translate comments and variable names in verbatim output but not in the sources, you may set the environment variable LYDOC_LOCALEDIR to a directory path; the directory should contain a tree of ‘.mo’ message catalogs with lilypond-doc as a domain.

addversion

(Only for Texinfo output.) Prepend line \version @w{"@version{}"} to verbatim output.

texidoc

(Only for Texinfo output.) If lilypond is called with the ‘--header=texidoc’ option, and the file to be processed is called ‘foo.ly’, it creates a file ‘foo.texidoc’ if there is a texidoc field in the \header. The texidoc option makes lilypond-book include such files, adding its contents as a documentation block right before the music snippet.

Assuming the file ‘foo.ly’ contains

\header {
  texidoc = "This file demonstrates a single note."
}
{ c'4 }

and we have this in our Texinfo document ‘test.texinfo

@lilypondfile[texidoc]{foo.ly}

the following command line gives the expected result

lilypond-book --pdf --process="lilypond \
  -dbackend=eps --header=texidoc" test.texinfo

Most LilyPond test documents (in the ‘input’ directory of the distribution) are small ‘.ly’ files which look exactly like this.

For localization purpose, if the Texinfo document contains @documentlanguage LANG and ‘foo.ly’ header contains a texidocLANG field, and if lilypond is called with ‘--header=texidocLANG’, then ‘foo.texidocLANG’ will be included instead of ‘foo.texidoc’.

lilyquote

(Only for Texinfo output.) This option is similar to quote, but only the music snippet (and the optional verbatim block implied by verbatim option) is put into a quotation block. This option is useful if you want to quote the music snippet but not the texidoc documentation block.

doctitle

(Only for Texinfo output.) This option works similarly to texidoc option: if lilypond is called with the ‘--header=doctitle’ option, and the file to be processed is called ‘foo.ly’ and contains a doctitle field in the \header, it creates a file ‘foo.doctitle’. When doctitle option is used, the contents of ‘foo.doctitle’, which should be a single line of text, is inserted in the Texinfo document as @lydoctitle text. @lydoctitle should be a macro defined in the Texinfo document. The same remark about texidoc processing with localized languages also applies to doctitle.

nogettext

(Only for Texinfo output.) Do not translate comments and variable names in the snippet quoted verbatim.

printfilename

If a LilyPond input file is included with \lilypondfile, print the file name right before the music snippet. For HTML output, this is a link. Only the base name of the file is printed, i.e. the directory part of the file path is stripped.


3.4 Invoking lilypond-book

lilypond-book produces a file with one of the following extensions: ‘.tex’, ‘.texi’, ‘.html’ or ‘.xml’, depending on the output format. All of ‘.tex’, ‘.texi’ and ‘.xml’ files need further processing.

Format-specific instructions

LaTeX

There are two ways of processing your LaTeX document for printing or publishing: getting a PDF file directly with PDFLaTeX, or getting a PostScript file with LaTeX via a DVI to PostScript translator like dvips. The first way is simpler and recommended3, and whichever way you use, you can easily convert between PostScript and PDF with tools, like ps2pdf and pdf2ps included in Ghostscript package.

To produce a PDF file through PDFLaTeX, use

lilypond-book --pdf yourfile.pdftex
pdflatex yourfile.tex

To produce PDF output via LaTeX/dvips/ps2pdf, you should do

lilypond-book yourfile.lytex
latex yourfile.tex
dvips -Ppdf yourfile.dvi
ps2pdf yourfile.ps

The ‘.dvi’ file created by this process will not contain note heads. This is normal; if you follow the instructions, they will be included in the ‘.ps’ and ‘.pdf’ files.

Running dvips may produce some warnings about fonts; these are harmless and may be ignored. If you are running latex in twocolumn mode, remember to add -t landscape to the dvips options.

Texinfo

To produce a Texinfo document (in any output format), follow the normal procedures for Texinfo; this is, either call texi2pdf or texi2dvi or makeinfo, depending on the output format you want to create. See the documentation of Texinfo for further details.

Command line options

lilypond-book accepts the following command line options:

-f format
--format=format

Specify the document type to process: html, latex, texi (the default) or docbook. If this option is missing, lilypond-book tries to detect the format automatically, see Filename extensions. Currently, texi is the same as texi-html.

-F filter
--filter=filter

Pipe snippets through filter. lilypond-book will not –filter and –process at the same time. For example,

lilypond-book --filter='convert-ly --from=2.0.0 -' my-book.tely
-h
--help

Print a short help message.

-I dir
--include=dir

Add dir to the include path. lilypond-book also looks for already compiled snippets in the include path, and does not write them back to the output directory, so in some cases it is necessary to invoke further processing commands such as makeinfo or latex with the same -I dir options.

-o dir
--output=dir

Place generated files in directory dir. Running lilypond-book generates lots of small files that LilyPond will process. To avoid all that garbage in the source directory, use the ‘--output’ command line option, and change to that directory before running latex or makeinfo.

lilypond-book --output=out yourfile.lytex
cd out
...
--skip-lily-check

Do not fail if no lilypond output is found. It is used for LilyPond Info documentation without images.

--skip-png-check

Do not fail if no PNG images are found for EPS files. It is used for LilyPond Info documentation without images.

--lily-output-dir=dir

Write lily-XXX files to directory dir, link into --output directory. Use this option to save building time for documents in different directories which share a lot of identical snippets.

--info-images-dir=dir

Format Texinfo output so that Info will look for images of music in dir.

--latex-program=prog

Run executable prog instead of latex. This is useful if your document is processed with xelatex, for example.

--left-padding=amount

Pad EPS boxes by this much. amount is measured in millimeters, and is 3.0 by default. This option should be used if the lines of music stick out of the right margin.

The width of a tightly clipped system can vary, due to notation elements that stick into the left margin, such as bar numbers and instrument names. This option will shorten each line and move each line to the right by the same amount.

-P command
--process=command

Process LilyPond snippets using command. The default command is lilypond. lilypond-book will not --filter and --process at the same time.

--pdf

Create PDF files for use with PDFLaTeX.

-V
--verbose

Be verbose.

-v
--version

Print version information.

既知の問題と警告

The Texinfo command @pagesizes is not interpreted. Similarly, LaTeX commands that change margins and line widths after the preamble are ignored.

Only the first \score of a LilyPond block is processed.


3.5 Filename extensions

You can use any filename extension for the input file, but if you do not use the recommended extension for a particular format you may need to manually specify the output format; for details, see Invoking lilypond-book. Otherwise, lilypond-book automatically selects the output format based on the input filename’s extension.

extension

output format

.html

HTML

.itely

Texinfo

.latex

LaTeX

.lytex

LaTeX

.lyxml

DocBook

.tely

Texinfo

.tex

LaTeX

.texi

Texinfo

.texinfo

Texinfo

.xml

HTML

If you use the same filename extension for the input file than the extension lilypond-book uses for the output file, and if the input file is in the same directory as lilypond-book working directory, you must use --output option to make lilypond-book running, otherwise it will exit with an error message like “Output would overwrite input file”.


3.6 Alternative methods of mixing text and music

This section shows methods to integrate text and music, different than the automated method with lilypond-book.


Many quotes from a large score

If you need to quote many fragments from a large score, you can also use the clip systems feature, see Extracting fragments of music.


Inserting LilyPond output into OpenOffice.org

LilyPond notation can be added to OpenOffice.org with OOoLilyPond.


Inserting LilyPond output into other programs

To insert LilyPond output in other programs, use lilypond instead of lilypond-book. Each example must be created individually and added to the document; consult the documentation for that program. Most programs will be able to insert LilyPond output in ‘PNG’, ‘EPS’, or ‘PDF’ formats.

To reduce the white space around your LilyPond score, use the following options

\paper{
  indent=0\mm
  line-width=120\mm
  oddFooterMarkup=##f
  oddHeaderMarkup=##f
  bookTitleMarkup = ##f
  scoreTitleMarkup = ##f
}

{ c1 }

To produce a useful ‘EPS’ file, use

lilypond -dbackend=eps -dno-gs-load-fonts -dinclude-eps-fonts   myfile.ly

‘PNG’:
lilypond -dbackend=eps -dno-gs-load-fonts -dinclude-eps-fonts --png myfile.ly

4. Converting from other formats


4.1 Invoking midi2ly


4.2 Invoking musicxml2ly


4.3 Invoking abc2ly


4.4 Invoking etf2ly


4.5 Generating LilyPond files


5. LilyPond プロジェクトに取り組む

このセクションでは一般的な問題のいくつかを解決または回避する方法について説明します。あなたにプログラミングの経験があるのなら、ここで取り上げる TIPS の多くは当たり前のことに見えるかもしれませんが、それでも本章を読むことをお勧めします。


5.1 うまくいかないとき


5.1.1 古い入力ファイルをアップデートする

LilyPond 入力構文はしばしば変更されます。LilyPond 自体の改良に合わせて、構文 (入力言語) も変更されます。これらの変更は入力を読みやすく/書きやすくするために行われる場合もありますし、LilyPond の新しい機能のために行われる場合もあります。

LilyPond は、このアップデートをより容易にするファイル – convert-ly – と一緒に公開されます。このプログラムの実行方法についての詳細は convert-ly を使ってファイルを更新する を参照してください。

残念なことに、convert-ly はすべての入力構文の変更を処理できるわけではありません。単純な探索-置換 (raggedrightragged-right になったなど) は処理しますが、複雑すぎる変更もあります。convert-ly が処理できない構文の変更は convert-ly を使ってファイルを更新する にリストアップされています。

例えば、LilyPond 2.4 以前では、アクセントと非英語文字 – 例えば、No\"el (これは ‘クリスマス’ に対応するフランス語となります) – は LaTex を使って入力していました。LilyPond 2.6 以降では、特殊文字 ë を UTF-8 キャラクタとして直接 LilyPond ファイルに入力するようになりました。convert-ly はすべての LaTex 特殊文字を UTF-8 キャラクタに変更することはできません。その場合、あなたが手動で古い LilyPond 入力ファイルをアップデートする必要があります。


5.1.2 一般的なエラー

以下で記述するエラーがしばしば起こりますが、その原因は明白でなかったり、簡単には見つからなかったりします。一旦それらのエラーを経験して理解すれば、それらの処理は簡単です。


音楽がページからはみ出す

右の余白にはみ出した音楽や、過度に密集した音楽の原因はほとんどすべて音符の演奏時間を不適切に入力して、小節の最後の音符が小節線を越えたためです。小節の最後の音符が自動的に挿入される小節線のところで終わっていなくても無効ではありません。なぜなら、その音符は単に次の小節に持ち越すと見なされるからです。しかしながら、そのような持ち越しの小節が長く続くと、音楽は密集したり、ページからはみ出す可能性があります。なぜなら、自動改行を挿入できるのは完全な小節 – つまり、すべての音符がその小節の終端までに終わっている小節 – の終端だけだからです。

Note: 不適切な演奏時間は自動改行を抑制し、その行の音楽は密集したり、ページからはみ出します。

小節チェックを使うと不適切な演奏時間を簡単に見つけ出すことができます – Bar and bar number checks を参照してください。

長く続く持ち越しの小節を持とうとするならば、改行したいところに不可視の小節線を挿入する必要があります。詳細は Bar lines を参照してください。


余計な譜が出現する

コンテキストが \new で明示的に作成されてはいない場合、すでに存在しているコンテキストには適用できないコマンドが発生すると沈黙のうちにコンテキストが作成されます。簡単な楽譜ではコンテキストの自動作成機能は有用であり、この LilyPond マニュアルの中の例の大半がこの機能を利用しています。しかしながら、時々このコンテキスト自動作成機能が予期せぬ譜や楽譜を発生させます。例えば、以下のコードはその後に続く譜の中にある符頭をすべて赤くすると予期したものかもしれませんが、実際のところ、その結果は 2 つの譜となり、下側の譜の中の符頭はデフォルトの黒のままです。

\override Staff.NoteHead #'color = #red
\new Staff { a }

[image of music]

こうなった原因は、オーバライドが処理されたときに Staff コンテキストは存在しなかったためです。そのため、Staff コンテキストが 1 つ暗黙的に作成され、オーバライドはそのコンテキストに適用されます。それから、\new Staff コマンドがもう 1 つ別の譜を作成し、音符はそこに配置されます。すべての符頭を赤くするための正しいコードは以下のようになります:

\new Staff {
  \override Staff.NoteHead #'color = #red
  a
}

[image of music]

次の例として、\relative コマンドが \repeat コマンドの中にある場合、2 つの譜が生成され、2 番目の譜は 1 番目の譜からずれます。なぜなら、\repeat コマンドは 2 つの \relative ブロックを生成し、それぞれのブロックは暗黙的に Staff ブロックと \Voice ブロックを作成するからです。

\repeat unfold 2 \relative { c d e f }

[image of music]

正しい結果を得るには、以下のように \repeat コマンドと j\relative コマンドの位置を入れ換えます:

\relative {
  \repeat unfold 2 { c d e f }
}

[image of music]


見かけ上 ../ly/init.ly に発生するエラー

入力ファイルの形式が正しくない場合、../ly/init.ly の中に構文エラーがあるという内容のさまざまな原因が不明瞭なエラー メッセージが表示される可能性があります。例えば、入力ファイルの中で括弧やクォートが対になっていない場合に、そのようなエラーが発生します。

最も一般的なエラーは score ブロックの最後に波括弧 (}) が無いというエラーです。その解決法は明白です: score ブロックが正しく終わっていることをチェックしてください。入力ファイルの正しい構造は LilyPond 入力ファイルの仕組み で記述しています。角括弧と波括弧の対を自動的にハイライトするエディタを使用するとそのようなエラーを防ぐのに役立ちます。

次に一般的なエラーの原因は歌詞ブロックの最後の音節と閉じ波括弧 (}) の間にスペースが無いという場合です。このスペースが無いと、閉じ波括弧は音節の一部になってしまいます。常に すべての 中括弧の前後にスペースを置くことをお勧めします。これは歌詞を使用するときに重要になります – Lyrics explained を参照してください。

このエラー メッセージは、クォート (") を閉じることを忘れた場合にも発生します。そのような場合、付随するエラー メッセージがエラーを起こした行の行番号を提示します。対になっていないクォートは通常 1 行あるいは 2 行上にあります。


エラー メッセージ Unbound variable %

Scheme コメントではなく LilyPond コメントを保持している Scheme ルーチン (このような Scheme は無効です) が呼び出されると、“GUILE signalled an error ...” とともにこのエラー メッセージがコンソール出力やログ ファイルの最後に出現します。

LilyPond コメントはパーセント記号 (%) で始まりますが、これを Scheme ルーチン内で使ってはいけません。Scheme コメントは セミコロン (;) で始まります。


エラー メッセージ FT_Get_Glyph_Name

入力ファイルが UTF-8 エンコーディングで保存されていない非 ASCII 文字を保持している場合、このエラー メッセージがコンソール出力やログ ファイルに出現します。詳細は Text encoding を参照してください。


5.1.3 トラブルシューティング (すべてをバラバラにする)

遅かれ早かれ、あなたは LilyPond がコンパイルできないファイルを書くことになります。LilyPond が返すメッセージはエラーを見つけ出す手助けになるかもしれませんが、多くの場合、問題の原因を探し出すために調査を行う必要があります。

この目的のための最も強力なツールは 1 行コメント (% で記述します) とブロック コメント (%{ ... %} で記述します) です。問題がどこにあるかわからない場合、入力ファイルの大きな一部分をコメント アウトすることから始めます。あるセクションをコメント アウトして、そのファイルを再びコンパイルしてみます。コンパイルが通ったのなら、問題は今コメント アウトした部分の中にあります。コンパイルが通らなかった場合は、コンパイルが通るようになるまでコメント アウトしたままにしておきます。

極端な場合、最終的に以下のようになるかもしれません:

\score {
  <<
    % \melody
    % \harmony
    % \bass
  >>
  \layout{}
}

(言い換えると、何の音楽も持たないファイルです)

こうなったとしても、あきらめないでください。少しだけコメントを外して – 例えば、バス パートを – コンパイルが通るかどうか試してみます。コンパイルが通らなかった場合は、バスの音楽をすべてコメント アウトします (しかし、\score の中の \bass はコメントを外したままにしておきます)。

bass = \relative c' {
%{
  c4 c c c
  d d d d
%}
}

そして、問題を起こしている行を見つけ出すまで、bass パートから少しずつコメントを外していきます。

もう 1 つの非常に有用なデバッグ テクニックは 最小化例 を構築することです。


5.1.4 最小化例

最小化例は可能な限り小さな例のことです。最小化例は長い例よりも理解することがずっと容易です。最小化例は以下の目的で使用されます:

可能な限り小さな例を構築するための規則はとても単純です: 必要の無いものはすべて削除する。ファイルの不要な部分を削除しようとしているとき、実際に削除する代わりにコメント アウトを使用するというのはとても良いアイディアです。そうしておけば、ある行が実際には必要だということがわかった場合に、その行をゼロから入力する代わりに、コメントを外すだけで済みます。

“可能な限り小さく” という規則には 2 つの例外があります:

最小化例の要点は読みやすくするということです:


5.2 Make と Makefile

LilyPond を実行できるほとんどすべてのプラットフォームが make というソフトウェアをサポートします。このソフトウェアは Makefile という名前の特殊なファイルを読み込みます。ファイル Makefile は、ファイルの依存関係と、あるファイルから別のファイルを作り出すためにオペレーティング システムに渡す必要があるコマンドを定義します。例えば、Makefile は LilyPond を実行して ballad.ly から ballad.pdfballad.midi を作り出す方法を記述します。

自身の便利さのためかソース ファイルにアクセスしてくれる他の人のために、自身のプロジェクト用に Makefile を作成することが良い場合があります。これが当てはまるのは、多くのインクルード ファイルと複数の出力オプション (例えば、フル スコア、パート スコア、指揮譜、ピアノ譜など) を持つ 非常に大きなプロジェクト、あるいは、ビルドするために複雑なコマンドを必要とするプロジェクト (lilypond-book プロジェクトなど) です。Makefile の複雑さと自由度は、必要性と作者のスキルに応じて、さまざまです。プログラム GNU Make は GNU/Linux ディストリビューションと MacOS X にインストールされていて、Windows でも利用可能です。

make の使い方についてのすべての詳細は GNU Make マニュアル を参照してください。これから示すのは make でできることのほんの一例です。

Makefile の中に規則を定義するためのコマンドは、プラットフォームによって異なります。例えば、さまざまな種類がある Linux と MacOS は bash を使いますが、Windows は cmd を使います。MacOS X では、コマンド ライン インタプリタを使用するためにシステムをコンフィグレーションする必要があるということに注意してください。ここで、Makefile の例をいくつか Linux/MacOS 用と Windows 用の両方のバージョンで示します。

最初の例は、4 楽章のオーケストラのためのもので、以下のようなディレクトリ構造を持ちます:

Symphony/
|-- MIDI/
|-- Makefile
|-- Notes/
|   |-- cello.ily
|   |-- figures.ily
|   |-- horn.ily
|   |-- oboe.ily
|   |-- trioString.ily
|   |-- viola.ily
|   |-- violinOne.ily
|   `-- violinTwo.ily
|-- PDF/
|-- Parts/
|   |-- symphony-cello.ly
|   |-- symphony-horn.ly
|   |-- symphony-oboes.ly
|   |-- symphony-viola.ly
|   |-- symphony-violinOne.ly
|   `-- symphony-violinTwo.ly
|-- Scores/
|   |-- symphony.ly
|   |-- symphonyI.ly
|   |-- symphonyII.ly
|   |-- symphonyIII.ly
|   `-- symphonyIV.ly
`-- symphonyDefs.ily

Scores ディレクトリと Parts ディレクトリの中にある .ly ファイルは音符を Notes ディレクトリの中にある .ily ファイルから取得します:

%%% top of file "symphony-cello.ly"
\include ../definitions.ily
\include ../Notes/cello.ily

この Makefile はターゲットとして score (フル スコアの楽曲全体)、movements (フル スコアの個々の楽章)、それに parts (演奏者のための個々のパート) を持ちます。さらに、web や email で配布するのに適したソース ファイルの tarball (訳者: 複数のファイルをコマンド tar で 1 つのファイルにまとめたもの) を作成するターゲット archive もあります。ここでは GNU/Linux や MacOS X 用の Makefile を示します。これをプロジェクトのトップ ディレクトリに Makefile という名前で保存する必要があります:

Note: ターゲットやパターン ルールが定義されたとき、そのあとの行はスペースではなく Tab で始まる必要があります。

# the name stem of the output files
# 出力ファイル名の語幹: symphonyI.pdf, symphonyIII.ly など
piece = symphony
# determine how many processors are present
# いくつプロセッサがあるかを決定します
CPU_CORES=`cat /proc/cpuinfo | grep -m1 "cpu cores" | sed s/".*: "//`
# The command to run lilypond
# lilypond を実行するコマンド
LILY_CMD = lilypond -ddelete-intermediate-files \
                    -dno-point-and-click -djob-count=$(CPU_CORES)

# The suffixes used in this Makefile.
# この Makefile で使用される拡張子
.SUFFIXES: .ly .ily .pdf .midi

# Input and output files are searched in the directories listed in
# the VPATH variable.  All of them are subdirectories of the current
# directory (given by the GNU make variable `CURDIR').
# 入力ファイルと出力ファイルのサーチは VPATH 変数でリストアップされている
# ディレクトリの中で行われます。それらのディレクトリはすべて (GNU make 変数 
# `CURDIR' によって与えられる) カレント ディレクトリのサブディレクトリです。
VPATH = \
  $(CURDIR)/Scores \
  $(CURDIR)/PDF \
  $(CURDIR)/Parts \
  $(CURDIR)/Notes

# LY 入力ファイルから PDF ファイルと MIDI ファイルを作成するための
# パターン ルール。.pdf 出力ファイルは `PDF' サブディレクトリの中に
# 配置され、.midi ファイルは `MIDI' サブディレクトリの中に配置されます。
%.pdf %.midi: %.ly
        $(LILY_CMD) $<; \           # this line begins with a tab
        if test -f "$*.pdf"; then \
            mv "$*.pdf" PDF/; \
        fi; \
        if test -f "$*.midi"; then \
            mv "$*.midi" MIDI/; \
        fi

notes = \
  cello.ily \
  horn.ily \
  oboe.ily \
  viola.ily \
  violinOne.ily \
  violinTwo.ily

# The dependencies of the movements.
# ターゲット movements の依存関係
$(piece)I.pdf: $(piece)I.ly $(notes)
$(piece)II.pdf: $(piece)II.ly $(notes)
$(piece)III.pdf: $(piece)III.ly $(notes)
$(piece)IV.pdf: $(piece)IV.ly $(notes)

# The dependencies of the full score.
# ターゲット score の依存関係
$(piece).pdf: $(piece).ly $(notes)

# The dependencies of the parts.
# ターゲット parts の依存関係
$(piece)-cello.pdf: $(piece)-cello.ly cello.ily
$(piece)-horn.pdf: $(piece)-horn.ly horn.ily
$(piece)-oboes.pdf: $(piece)-oboes.ly oboe.ily
$(piece)-viola.pdf: $(piece)-viola.ly viola.ily
$(piece)-violinOne.pdf: $(piece)-violinOne.ly violinOne.ily
$(piece)-violinTwo.pdf: $(piece)-violinTwo.ly violinTwo.ily

# Type `make score' to generate the full score of all four
# movements as one file.
# 4 つすべての楽章のフル スコアを 1 つのファイルとして生成するには
# `make score' とタイプします。
.PHONY: score
score: $(piece).pdf

# Type `make parts' to generate all parts.
# Type `make foo.pdf' to generate the part for instrument `foo'.
# Example: `make symphony-cello.pdf'.
# すべてのパートを生成するには `make parts' とタイプします。
# 楽器 `foo' のためのパートを生成するには `make foo.pdf' とタイプします。
# 例: `make symphony-cello.pdf'
.PHONY: parts
parts: $(piece)-cello.pdf \
       $(piece)-violinOne.pdf \
       $(piece)-violinTwo.pdf \
       $(piece)-viola.pdf \
       $(piece)-oboes.pdf \
       $(piece)-horn.pdf

# Type `make movements' to generate files for the
# four movements separately.
# 4 つの楽章を別個のファイルとして生成するには `make movements' とタイプします。
.PHONY: movements
movements: $(piece)I.pdf \
           $(piece)II.pdf \
           $(piece)III.pdf \
           $(piece)IV.pdf

all: score parts movements

archive:
        tar -cvvf stamitz.tar \       # this line begins with a tab
        --exclude=*pdf --exclude=*~ \
        --exclude=*midi --exclude=*.tar \
        ../Stamitz/*

Windows プラットフォームには特別な面倒さがあります。Windows 用の GNU Make をダウンロードしてインストールした後、システム環境変数に正しいパスを設定して、DOS シェルが Make プログラムを見つけられるようにする必要があります。これを行うには、"マイ コンピュータ" を右クリックして、プロパティ を選択し、それから 詳細設定 を選択します。それから 環境変数 をクリックして、システム環境変数 パネルの中にある Path をハイライトしてから 編集 をクリックして、GNU Make の実行ファイルへのパスを追加します。そのパスは以下のようになります (訳者: GNU Make のインストールのされ方によって異なります):

C:\Program Files\GnuWin32\bin

Linux/MacOS X とは異なるシェル コマンドを扱い、いくつかのデフォルト システム ディレクトリの中に存在するファイル空間を扱うために、Makefile 自体を変更する必要があります。Windows は tar コマンドを持たないため、archive ターゲットは除去されます。また、Windows が持つ MIDI ファイルのデフォルト拡張子は異なります。

## WINDOWS VERSION
##
piece = symphony
LILY_CMD = lilypond -ddelete-intermediate-files \
                    -dno-point-and-click \
                    -djob-count=$(NUMBER_OF_PROCESSORS)

#get the 8.3 name of CURDIR (workaround for spaces in PATH)
workdir = $(shell for /f "tokens=*" %%b in ("$(CURDIR)") \
          do @echo %%~sb)

.SUFFIXES: .ly .ily .pdf .mid

VPATH = \
  $(workdir)/Scores \
  $(workdir)/PDF \
  $(workdir)/Parts \
  $(workdir)/Notes

%.pdf %.mid: %.ly
        $(LILY_CMD) $<      # this line begins with a tab
        if exist "$*.pdf"  move /Y "$*.pdf"  PDF/ # begin with tab
        if exist "$*.mid" move /Y "$*.mid" MIDI/  # begin with tab

notes = \
  cello.ily \
  figures.ily \
  horn.ily \
  oboe.ily \
  trioString.ily \
  viola.ily \
  violinOne.ily \
  violinTwo.ily

$(piece)I.pdf: $(piece)I.ly $(notes)
$(piece)II.pdf: $(piece)II.ly $(notes)
$(piece)III.pdf: $(piece)III.ly $(notes)
$(piece)IV.pdf: $(piece)IV.ly $(notes)

$(piece).pdf: $(piece).ly $(notes)

$(piece)-cello.pdf: $(piece)-cello.ly cello.ily
$(piece)-horn.pdf: $(piece)-horn.ly horn.ily
$(piece)-oboes.pdf: $(piece)-oboes.ly oboe.ily
$(piece)-viola.pdf: $(piece)-viola.ly viola.ily
$(piece)-violinOne.pdf: $(piece)-violinOne.ly violinOne.ily
$(piece)-violinTwo.pdf: $(piece)-violinTwo.ly violinTwo.ily

.PHONY: score
score: $(piece).pdf

.PHONY: parts
parts: $(piece)-cello.pdf \
       $(piece)-violinOne.pdf \
       $(piece)-violinTwo.pdf \
       $(piece)-viola.pdf \
       $(piece)-oboes.pdf \
       $(piece)-horn.pdf

.PHONY: movements
movements: $(piece)I.pdf \
           $(piece)II.pdf \
           $(piece)III.pdf \
           $(piece)IV.pdf

all: score parts movements

次の Makefile は、LaTeX で処理する lilypond-book ドキュメント用です。このドキュメントは目次を持ちます。目次を作成するには、リンクを更新するために latex コマンドを 2 回実行する必要があります。.pdf 出力ファイルは out ディレクトリに保存され、HTML 出力ファイルは htmlout ディレクトリに保存されます。

SHELL=/bin/sh
FILE=myproject
OUTDIR=out
WEBDIR=htmlout
VIEWER=acroread
BROWSER=firefox
LILYBOOK_PDF=lilypond-book --output=$(OUTDIR) --pdf $(FILE).lytex
LILYBOOK_HTML=lilypond-book --output=$(WEBDIR) $(FILE).lytex
PDF=cd $(OUTDIR) && pdflatex $(FILE)
HTML=cd $(WEBDIR) && latex2html $(FILE)
INDEX=cd $(OUTDIR) && makeindex $(FILE)
PREVIEW=$(VIEWER) $(OUTDIR)/$(FILE).pdf &

all: pdf web keep

pdf:
        $(LILYBOOK_PDF)  # begin with tab
        $(PDF)           # begin with tab
        $(INDEX)         # begin with tab
        $(PDF)           # begin with tab
        $(PREVIEW)       # begin with tab

web:
        $(LILYBOOK_HTML) # begin with tab
        $(HTML)          # begin with tab
        cp -R $(WEBDIR)/$(FILE)/ ./  # begin with tab
        $(BROWSER) $(FILE)/$(FILE).html &  # begin with tab

keep: pdf
        cp $(OUTDIR)/$(FILE).pdf $(FILE).pdf  # begin with tab

clean:
        rm -rf $(OUTDIR) # begin with tab

web-clean:
        rm -rf $(WEBDIR) # begin with tab

archive:
        tar -cvvf myproject.tar \ # begin this line with tab
        --exclude=out/* \
        --exclude=htmlout/* \
        --exclude=myproject/* \
        --exclude=*midi \
        --exclude=*pdf \
        --exclude=*~ \
        ../MyProject/*

TODO: make this thing work on Windows

この Makefile は Windows では機能しません。Windows ユーザの代替手段として、ビルド コマンドを保持する簡単なバッチ ファイルを作成する方法があります。これは Makefile のように依存関係を保持できませんが、少なくともビルド処理を単一のコマンドに縮小します。以下のコードを build.bat あるいは build.cmd として保存してください。このバッチ ファイルは DOS プロンプトから実行することができ、単にそのアイコンをダブル クリックすることでも実行することができます。

lilypond-book --output=out --pdf myproject.lytex
cd out
pdflatex myproject
makeindex myproject
pdflatex myproject
cd ..
copy out\myproject.pdf MyProject.pdf

参照

アプリケーションの使用方法: FIXME コマンド ラインの使用方法, lilypond-book


6. LilyPond 入力ファイルの記述に対する提案

今やあなたはもっと大きな LilyPond 入力ファイル – チュートリアルにあるような小さな例ではなく、楽曲全体 – を書き始める準備が整っています。しかしながら、どのように書き進めていくべきなのでしょうか?

LilyPond があなたの入力ファイルを理解でき、望みの出力を作り出している限り、あなたの入力ファイルがどのようなものであるかは問題になりません。しかしながら、LilyPond 入力ファイルを書いているときに考慮すべきことが他にもいくつかあります。


6.1 一般的な提案

ここで、あなたが問題を回避したり修正する手助けになる可能性がある提案をいくつか挙げます:


6.2 既存の音楽を譜刻する

既存の楽譜からの音楽を入力している (つまり、既存の楽譜の楽曲を譜刻している) のなら、


6.3 大きなプロジェクト

大きなプロジェクトに取り組んでいるとき、LilyPond 入力ファイルの構造をすっきりさせておくことが不可欠です。


A. GNU Free Documentation License

Version 1.3, 3 November 2008

 
Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
http://fsf.org/

Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
  1. PREAMBLE

    The purpose of this License is to make a manual, textbook, or other functional and useful document free in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others.

    This License is a kind of “copyleft”, which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software.

    We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference.

  2. APPLICABILITY AND DEFINITIONS

    This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The “Document”, below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as “you”. You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law.

    A “Modified Version” of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language.

    A “Secondary Section” is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document’s overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them.

    The “Invariant Sections” are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none.

    The “Cover Texts” are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words.

    A “Transparent” copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not “Transparent” is called “Opaque”.

    Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only.

    The “Title Page” means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, “Title Page” means the text near the most prominent appearance of the work’s title, preceding the beginning of the body of the text.

    The “publisher” means any person or entity that distributes copies of the Document to the public.

    A section “Entitled XYZ” means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as “Acknowledgements”, “Dedications”, “Endorsements”, or “History”.) To “Preserve the Title” of such a section when you modify the Document means that it remains a section “Entitled XYZ” according to this definition.

    The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License.

  3. VERBATIM COPYING

    You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3.

    You may also lend copies, under the same conditions stated above, and you may publicly display copies.

  4. COPYING IN QUANTITY

    If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document’s license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects.

    If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages.

    If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public.

    It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document.

  5. MODIFICATIONS

    You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version:

    1. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission.
    2. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement.
    3. State on the Title page the name of the publisher of the Modified Version, as the publisher.
    4. Preserve all the copyright notices of the Document.
    5. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices.
    6. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below.
    7. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document’s license notice.
    8. Include an unaltered copy of this License.
    9. Preserve the section Entitled “History”, Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled “History” in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence.
    10. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the “History” section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission.
    11. For any section Entitled “Acknowledgements” or “Dedications”, Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein.
    12. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles.
    13. Delete any section Entitled “Endorsements”. Such a section may not be included in the Modified Version.
    14. Do not retitle any existing section to be Entitled “Endorsements” or to conflict in title with any Invariant Section.
    15. Preserve any Warranty Disclaimers.

    If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version’s license notice. These titles must be distinct from any other section titles.

    You may add a section Entitled “Endorsements”, provided it contains nothing but endorsements of your Modified Version by various parties—for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard.

    You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one.

    The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version.

  6. COMBINING DOCUMENTS

    You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers.

    The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work.

    In the combination, you must combine any sections Entitled “History” in the various original documents, forming one section Entitled “History”; likewise combine any sections Entitled “Acknowledgements”, and any sections Entitled “Dedications”. You must delete all sections Entitled “Endorsements.”

  7. COLLECTIONS OF DOCUMENTS

    You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects.

    You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document.

  8. AGGREGATION WITH INDEPENDENT WORKS

    A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an “aggregate” if the copyright resulting from the compilation is not used to limit the legal rights of the compilation’s users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document.

    If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document’s Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate.

  9. TRANSLATION

    Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail.

    If a section in the Document is Entitled “Acknowledgements”, “Dedications”, or “History”, the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title.

  10. TERMINATION

    You may not copy, modify, sublicense, or distribute the Document except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, or distribute it is void, and will automatically terminate your rights under this License.

    However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.

    Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.

    Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, receipt of a copy of some or all of the same material does not give you any rights to use it.

  11. FUTURE REVISIONS OF THIS LICENSE

    The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/.

    Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License “or any later version” applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. If the Document specifies that a proxy can decide which future versions of this License can be used, that proxy’s public statement of acceptance of a version permanently authorizes you to choose that version for the Document.

  12. RELICENSING

    “Massive Multiauthor Collaboration Site” (or “MMC Site”) means any World Wide Web server that publishes copyrightable works and also provides prominent facilities for anybody to edit those works. A public wiki that anybody can edit is an example of such a server. A “Massive Multiauthor Collaboration” (or “MMC”) contained in the site means any set of copyrightable works thus published on the MMC site.

    “CC-BY-SA” means the Creative Commons Attribution-Share Alike 3.0 license published by Creative Commons Corporation, a not-for-profit corporation with a principal place of business in San Francisco, California, as well as future copyleft versions of that license published by that same organization.

    “Incorporate” means to publish or republish a Document, in whole or in part, as part of another Document.

    An MMC is “eligible for relicensing” if it is licensed under this License, and if all works that were first published under this License somewhere other than this MMC, and subsequently incorporated in whole or in part into the MMC, (1) had no cover texts or invariant sections, and (2) were thus incorporated prior to November 1, 2008.

    The operator of an MMC Site may republish an MMC contained in the site under CC-BY-SA on the same site at any time before August 1, 2009, provided the MMC is eligible for relicensing.

ADDENDUM: How to use this License for your documents

To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page:

 
  Copyright (C)  year  your name.
  Permission is granted to copy, distribute and/or modify this document
  under the terms of the GNU Free Documentation License, Version 1.3
  or any later version published by the Free Software Foundation;
  with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
  Texts.  A copy of the license is included in the section entitled ``GNU
  Free Documentation License''.

If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the “with…Texts.” line with this:

 
    with the Invariant Sections being list their titles, with
    the Front-Cover Texts being list, and with the Back-Cover Texts
    being list.

If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation.

If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software.


B. LilyPond インデックス

Jump to:   \        
B   C   D   E   F   H   I   L   M   O   P   S   T   U   W  
インデックス エントリ セクション

\
\header in LaTeX documents3.2.1 LaTeX

B
Bar and bar number checks音楽がページからはみ出す
Bar and bar number checks6.1 一般的な提案
Bar lines音楽がページからはみ出す

C
call trace (トレースを呼び出す)1.3 エラー メッセージ
command line options for lilypond (lilypond のためのコマンド ライン オプション)1.2.1 lilypond を呼び出す
convert-ly2. convert-ly を使ってファイルを更新する
convert-ly5.1.1 古い入力ファイルをアップデートする
convert-ly を使ってファイルを更新する5.1.1 古い入力ファイルをアップデートする
convert-ly を使ってファイルを更新する5.1.1 古い入力ファイルをアップデートする

D
docbook3. lilypond-book: Integrating text and music
DocBook, music in3. lilypond-book: Integrating text and music
documents, adding music to3. lilypond-book: Integrating text and music
dvipsLaTeX

E
error (エラー)1.3 エラー メッセージ
error messages (エラー メッセージ)1.3 エラー メッセージ
errors, message format (エラー メッセージの形式)1.3 エラー メッセージ
Extracting fragments of musicMany quotes from a large score

F
fatal error (致命的なエラー)1.3 エラー メッセージ
file searching (ファイル検索)1.2.2 lilypond のコマンド ライン オプション

H
html3. lilypond-book: Integrating text and music
HTML, music in3. lilypond-book: Integrating text and music

I
invoking dvipsLaTeX
Invoking lilypond (lilypond を呼び出す)1.2.1 lilypond を呼び出す

L
LANG1.2.3 環境変数
latex3. lilypond-book: Integrating text and music
LaTeX, music in3. lilypond-book: Integrating text and music
LilyPond 入力ファイルの仕組み見かけ上 ../ly/init.ly に発生するエラー
lilypond-book参照
LILYPOND_DATADIR1.2.3 環境変数
Lyrics explained見かけ上 ../ly/init.ly に発生するエラー

M
make5.2 Make と Makefile
makefiles5.2 Make と Makefile
musicology3.1 An example of a musicological document

O
Octave checks6.1 一般的な提案
OpenOffice.orgInserting LilyPond output into OpenOffice.org
options, command line (コマンド ライン オプション)1.2.1 lilypond を呼び出す
outline fontsLaTeX
output format, setting (出力フォーマットを設定する)1.2.2 lilypond のコマンド ライン オプション

P
point and click, command line (コマンド ラインからポイント&クリックを制御する)1.2.2 lilypond のコマンド ライン オプション
PostScript output (PostScript 出力)1.2.2 lilypond のコマンド ライン オプション
preview image3.2.3 HTML
Programming error (プログラミング エラー)1.3 エラー メッセージ

S
Scheme dump (Scheme ダンプ)1.2.2 lilypond のコマンド ライン オプション
Scheme error (Scheme エラー)1.3 エラー メッセージ
search path (サーチ パス)1.2.2 lilypond のコマンド ライン オプション
Skipping corrected music6.2 既存の音楽を譜刻する
SVG (Scalable Vector Graphics)1.2.2 lilypond のコマンド ライン オプション
switches (切り換え)1.2.1 lilypond を呼び出す

T
texi3. lilypond-book: Integrating text and music
texinfo3. lilypond-book: Integrating text and music
texinfo3. lilypond-book: Integrating text and music
Texinfo, music in3. lilypond-book: Integrating text and music
Text encodingエラー メッセージ FT_Get_Glyph_Name
thumbnail3.2.3 HTML
titling and lilypond-book3.2.1 LaTeX
titling in HTML3.2.3 HTML
trace, Scheme (Scheme トレース)1.3 エラー メッセージ
type1 fontsLaTeX

U
Updating a LilyPond file (LilyPond ファイルを更新する)2. convert-ly を使ってファイルを更新する
updating old input files (ふるい入力ファイルをアップデートする)5.1.1 古い入力ファイルをアップデートする
URLGNU LilyPond — アプリケーション使用方法

W
warning (ワーニング)1.3 エラー メッセージ
web siteGNU LilyPond — アプリケーション使用方法

コマンド ラインの使用方法参照

スタイル シート6.1 一般的な提案

変数と関数を用いて入力の手間を省く6.1 一般的な提案

Jump to:   \        
B   C   D   E   F   H   I   L   M   O   P   S   T   U   W  

脚注

[1] GUILE のステータスは .ly 処理後にリセットされません。そのため、Scheme 内部からいかなるシステム デフォルトも変更しないよう注意してください。

[2] This tutorial is processed with Texinfo, so the example gives slightly different results in layout.

[3] Note that PDFLaTeX and LaTeX may not be both usable to compile any LaTeX document, that is why we explain the two ways.


目次


このドキュメントについて

This document was generated by Sawada on 1 月 3, 2011 using texi2html 1.82.

ナビゲーション パネルの中にあるボタンには以下のような意味があります:

ボタン Name 行き先 1.2.3 からの行き先
[]
[ << ] FastBack この章あるいは前の章の先頭 1
[]
[トップ] トップ ドキュメントの表紙 (先頭)  
[目次] 目次 目次  
[インデックス] インデックス インデックス  
[ ? ] 情報 情報 (ヘルプ)  
[]
[ >> ] FastForward 次の章 2
[]
[]
[ < ] Back 前のセクション 1.2.2
[]
[ 上へ ] 上のセクション 1.2
[]
[ > ] Forward 次のセクション 1.2.4

この表で、 行き先 は、現在の位置が以下のような構造を持つドキュメントの サブサブセクション 1-2-3 であると仮定しています:


他の言語: English, deutsch, español, français, magyar

アプリケーション使用方法

inserted by FC2 system