1 @c -*- coding: utf-8; mode: texinfo; documentlanguage: ja -*-
4 Translation of GIT committish: c1b0482f63f881bd3f67845e5f76a3e04675ef2a
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..
13 @c Translators: Yoshiki Sawada
14 @c Translation status: post-GDP
18 @translationof Changing defaults
20 LilyPond はデフォルトで最高品質の出力を提供できるよう設計されています。@c
22 デフォルトのレイアウトを変更する必要が発生する場合もあります。@c
23 レイアウトは、@q{プロパティ} と呼ばれる多数の @q{つまみとスイッチ} によって@c
25 これらのプロパティにアクセスし、変更するための手引は学習マニュアルの中にあります
26 -- @rlearning{出力を調整する} を参照してください。@c
29 よりリファレンス マニュアルに適したスタイルで提供します。
31 @cindex Internals Reference (内部リファレンス)
33 調整のために利用できる制御の定義についての説明は、@c
34 別のドキュメントの中にあります: @rinternalsnamed{Top,内部リファレンス} です。@c
35 このマニュアルは利用可能なすべての変数、関数、それにオプションを@c
37 これは HTML ドキュメントとして記述されていて、@c
38 @uref{http://@/lilypond@/.org/@/doc/@/stable/@/Documentation/@/internals/,オンライン}
40 LilyPond ドキュメント パッケージにも含まれています。
42 内部的には、LilyPond は Scheme (LISP 派生語) を用いて機能を提供しています。@c
43 レイアウトについての決定をオーバライドすることは、@c
44 プログラムの内部にアクセスすることであり、@c
46 Scheme の要素は、@code{.ly} の中で、@c
47 ハッシュ記号 @code{#} を付けて記述します。@footnote{@rextend{Scheme tutorial}
48 の中に、Scheme 形式で数、リスト、文字列、それに記号を入力するための@c
64 @translationof Interpretation contexts
66 このセクションでは、コンテキストとは何なのか、@c
67 それをどのように変更するのかについて説明します。
74 * コンテキストのデフォルト設定を変更する::
81 @rlearning{コンテキストとエングラーバ}
84 @file{ly/@/engraver@/-init@/.ly},
85 @file{ly/@/performer@/-init@/.ly}
88 @rlsr{Contexts and engravers}
91 @rinternals{Contexts},
92 @rinternals{Engravers and Performers}
97 @translationof Contexts explained
100 @c TODO Rethink and rewrite
102 >> > > - list of contexts: my *danger unmaintainable*
103 >> > > alarm just went off. I'm
105 I knew it would... And leaving out some of them is perfectly fine
107 I do think that a list like this, with the main contexts and a
109 description of what they do (perhaps also with a note about what
111 behavior is associated with each of them, but this may be
113 should be there, and then we could simply list the remaining ones
115 further explanation and with links to the IR.
118 @c TODO Improve layout, order and consistency of wording -td
120 @c TODO Add introduction which explains contexts in generality -td
122 @c TODO Describe propagation of property values -td
127 * Score - すべてのコンテキストのマスタ::
133 @node Score - すべてのコンテキストのマスタ
134 @unnumberedsubsubsec Score - すべてのコンテキストのマスタ
135 @translationof Score - the master of all contexts
138 他のコンテキストが Score コンテキストを保持することはできません。@c
139 デフォルトでは、Score コンテキストが拍子記号の管理を扱い、@c
140 音部記号、拍子記号、調号などのアイテムが譜間で揃っていることを保証します。
142 Score コンテキストは、@code{\score @{@dots{}@}} や @code{\layout @{@dots{}@}}
143 ブロックが処理されたときに暗黙的にインスタンス化されます。@c
144 @c また、@code{\new Score} コマンドが実行されたときに@c
148 @node 上位コンテキスト - 譜コンテナ
149 @unnumberedsubsubsec 上位コンテキスト - 譜コンテナ
150 @translationof Top-level contexts - staff containers
152 @strong{@emph{StaffGroup}}
154 譜をグループ化して、左端に角括弧を付けます。@c
155 このコンテキストに保持されている譜の小節線は垂直につながります。@c
156 @code{StaffGroup} は譜のコレクション、@c
157 それに左端の角括弧と延長された小節線だけを保持します。
159 @strong{@emph{ChoirStaff}}
161 保持されている譜の小節線が垂直につながらないことを除けば、@c
162 @code{StaffGroup} と同じです。
164 @strong{@emph{GrandStaff}}
166 譜をグループ化して、左端に波括弧を付けます。@c
167 このコンテキストに保持されている譜の小節線は垂直につながります。@c
169 @strong{@emph{PianoStaff}}
171 @code{GrandStaff} と似ていますが、@c
172 各システムの左端に楽器名を付けることができます。
176 @unnumberedsubsubsec 中位コンテキスト - 譜
177 @translationof Intermediate-level contexts - staves
179 @strong{@emph{Staff}}
181 音部記号、小節線、調、臨時記号を扱います。@c
182 このコンテキストは @code{Voice} コンテキストを保持することができます。
184 @strong{@emph{RhythmicStaff}}
186 @code{Staff} と似ていますが、リズムを表示するためのものです。@c
187 ピッチは無視され、音符は線として表示されます。
189 @strong{@emph{TabStaff}}
191 タブ譜を生成するためのコンテキストです。@c
192 デフォルトでは、音楽表記を 6 線のギター タブ譜として配置します。
194 @strong{@emph{DrumStaff}}
197 @code{DrumVoice} を保持することができます。
199 @strong{@emph{VaticanaStaff}}
201 @code{Staff} と同じですが、@c
202 グレゴリア形式の楽曲を譜刻するためにデザインされている点が異なります。
204 @strong{@emph{MensuralStaff}}
206 @code{Staff} と同じでが、@c
207 定量形式の楽曲を譜刻するためにデザインされている点が異なります。
210 @unnumberedsubsubsec 下位コンテキスト - ボイス
211 @translationof Bottom-level contexts - voices
213 Voice レベルのコンテキストはある特定のプロパティを初期化し、@c
215 下位コンテキストであるため、他のコンテキストを保持することはできません。
217 @strong{@emph{Voice}}
220 このコンテキストは、強弱記号、符幹、連桁、上付き/下付き文字、タイ、@c
222 1 つの譜に複数のボイスを配置する必要がある場合、@c
223 ボイスを明示的にインスタンス化する必要があります。
225 @strong{@emph{VaticanaVoice}}
227 @code{Voice} と同じですが、@c
228 グレゴリア形式の楽曲を譜刻するためにデザインされている点が異なります。
230 @strong{@emph{MensuralVoice}}
232 @code{Voice} と同じですが、@c
233 定量形式の楽曲を譜刻するためにデザインされている点が異なります。
235 @strong{@emph{Lyrics}}
237 歌詞を保持するボイスに相当します。単一行の歌詞の表示を扱います。
239 @strong{@emph{DrumVoice}}
241 打楽器譜で使用されるボイス コンテキストです。
243 @strong{@emph{FiguredBass}}
246 @code{\figuremode} モードで記述された入力から
247 @code{BassFigure} オブジェクトが作成されます。
249 @strong{@emph{TabVoice}}
251 @code{TabStaff} コンテキスト内部で使用されるボイス コンテキストです。@c
254 @strong{@emph{CueVoice}}
256 小さなサイズの音符を描画するために使用されるボイス コンテキストです。@c
257 主に合図音符を譜に付け加えることを目的としています。@c
258 @ref{合図音符をフォーマットする} を参照してください。@c
261 @strong{@emph{ChordNames}}
268 Then the following, which I don't know what to do with:
270 * GregorianTranscriptionVoice
271 * GregorianTranscriptionStaff
274 Engraves fretboards from chords. Not easy... Not
276 There is now some documentation on FretBoards in the NR, under
277 instrument-specific notation -- cds.
282 Hard coded entry point for LilyPond. Cannot be tuned.
284 Silently discards all musical information given to this
290 @node コンテキストを作成して参照する
291 @subsection コンテキストを作成して参照する
292 @translationof Creating and referencing contexts
296 @cindex new contexts (新しいコンテキスト)
297 @cindex referencing contexts (コンテキストを参照する)
298 @cindex Contexts, creating and referencing (コンテキストを作成して参照する)
300 LilyPond は、適切なコンテキストが存在しないうちに音楽表記に遭遇すると、@c
301 自動的に下位コンテキストを作成します。@c
302 しかしながら、通常これは、シンプルな楽譜やドキュメントの中の楽譜断片@c
303 のような単純な場合にしかうまくいきません。@c
304 もっと複雑な楽譜の場合、すべてのコンテキストを @code{\new} コマンドや
305 @code{\context} コマンドを用いて明示的に指定することをお勧めします。@c
306 これら 2 つのコマンドの構文はほとんど同じです:
309 [\new | \context] @var{Context} [ = @var{name}] [@var{music-expression}]
313 ここで、@code{\new} と @code{\context} のどちらかを使用します。@c
314 @var{Context} は作成するコンテキストのタイプであり、@var{name} は@c
315 作成されるコンテキストにオプションで付けることができる名前であり、@c
316 @var{music-expression} はこのコンテキストのエングラーバとパフォーマに@c
319 コンテキスト名を持たない @code{\new} コマンドは一般的に複数の譜を持つ
323 @lilypond[quote,verbatim,relative=2]
326 % 暗黙的に Voice コンテキストが作成されます
336 そして、1 つの譜に複数のボイスが配置されます:
338 @lilypond[quote,verbatim,relative=2]
356 @c @code{\new} should always be used to specify unnamed contexts.
358 @code{\new} と @code{\context} は動作が異なります:
362 @code{\new} はコンテキスト名を持っているか、いないかにかかわらず、@c
363 例え同じ名前を持つコンテキストが存在していたとしても、常に全く新たな@c
366 @lilypond[quote,verbatim,relative=2]
382 コンテキスト名を持つ @code{\context} は、階層、名前、それにタイプが@c
383 同じコンテキストが存在しない場合にのみ、新たなコンテキスを作成します。@c
384 存在する場合、@code{\context} はすでに作成されているコンテキストへの@c
385 参照となり、音楽表記はそのコンテキストに渡されて処理されます。
387 名前を持つコンテキストの用途の 1 つとして、楽譜レイアウトと音楽コンテンツ@c
392 @lilypond[quote,verbatim]
406 \context Voice = "one" {
411 \context Voice = "two" {
421 @lilypond[quote,verbatim]
426 \context Voice = "one" {
429 \context Voice = "two" {
435 \context Voice = "one" {
440 \context Voice = "two" {
449 名前付きコンテキストの他の使用例として、2 つの音楽表記をつなげて
450 1 つのコンテキストにすることができます。@c
451 以下の例では、アーティキュレーションと音符は別々に入力されています:
454 @rlearning{Organizing pieces with variables} を参照してください。
457 コンテキスト名を持たない @code{\context} は、階層とタイプが一致する@c
458 コンテキストのうち最初に作成されたものに適用され
459 (例えそのコンテキストが名前を持っていたとしても適用されます)、@c
460 音楽表記はそのコンテキストに渡されて処理されます。@c
462 しかしながら、コンテキスト名と音楽表記を持たない @code{\context}
463 は、コンテキスト内で @code{\applyContext} で記述した Scheme
464 プロシージャを実行させるのに用いられます:
467 \new Staff \relative c' @{
470 \applyContext #(lambda (ctx)
472 (display (ly:context-current-moment ctx)))
479 後で参照するコンテキストには名前を付ける必要があります。@c
480 例えば、歌詞を音楽に関連付けるような場合です:
483 \new Voice = "tenor" @var{music}
485 \new Lyrics \lyricsto "tenor" @var{lyrics}
489 歌詞を音楽に関連付ける方法についての詳細は
490 @ref{Automatic syllable durations} を参照してください。
492 ある特定のタイプのすべてのコンテキストのプロパティを @code{\layout}
493 ブロックで変更することができます (構文は異なります)
494 -- @ref{Changing all contexts of the same type} を参照してください。@c
495 この構造でもレイアウトを音楽コンテンツから分離させることができます。@c
496 単一のコンテキストを変更するのであれば、@code{\with} ブロックを用いる@c
497 必要があります -- @ref{Changing just one specific context} を参照@c
503 @rlearning{Organizing pieces with variables}
506 @ref{Changing just one specific context},
507 @ref{Automatic syllable durations}
511 @subsection コンテキストを残しておく
512 @translationof Keeping contexts alive
514 @cindex contexts, keeping alive (コンテキストを残しておく)
515 @cindex contexts, lifetime (コンテキストのライフタイム)
517 通常、コンテキストは何もすることが無くなった最初の音楽的タイミングで@c
519 そのため、@code{Voice} コンテキストはすべてのイベントを終えるとすぐに消滅し、@c
520 @code{Staff} コンテキストは保持しているすべての @code{Voice} コンテキストの@c
521 イベントが終了するとすぐに消滅する、などとなっています。@c
522 このことは、早い段階のすでに消滅したコンテキスを参照する必要がある場合に、@c
524 例えば、@code{\change} コマンドで譜を変更する場合、@c
525 @code{\lyricsto} コマンドで歌詞をボイスに結び付ける場合、@c
526 あるいは、早い段階で登場したコンテキストに音楽イベントを追加する場合に@c
530 @code{Staff} コンテキストや @code{<<...>>} 構造の中にある @code{Voice}
531 コンテキストのうち 1 つだけは、例え途中ですることが無くなったとしても、@c
532 @code{Staff} コンテキストあるいは
533 @code{<<...>>} 構造の終わりまで維持されます。@c
534 このように維持されるコンテキストは、最初の @code{@{...@}} 構造の中にある@c
535 最初のコンテキストであり、@code{<<...>>} 構造の中にあるものは無視されます。
537 各音楽タイミングで何かすることを持たせることにより、@c
538 任意のコンテキストを残しておくことができます。@c
539 @code{Staff} コンテキストを残しておくには、それに含まれるボイスの 1 つが@c
540 維持されることを保証する必要があります。@c
541 ボイスを残しておく方法の 1 つに、ボイスに含まれる実際の音楽と並列に、@c
542 空白休符をそのボイスに付け加えるという方法があります。@c
543 残しておく必要があるすべての @code{Voice} コンテキストに対して、@c
545 ところどころで使用されるボイスがある場合、@c
546 前述の例外によって必要なボイスを残そうとするよりは、@c
547 それらのボイスすべてを残しておく方が安全です。
549 以下の例では、空白休符の追加を用いる方法で、@c
550 ボイス A とボイス B の両方が楽曲全体を通して維持されます:
553 @lilypond[quote,verbatim]
554 musicA = \relative c'' { d4 d d d }
555 musicB = \relative c'' { g4 g g g }
558 \new Voice = "A" { s1*5 } % Voice "A" を 5 小節の間、維持する
559 \new Voice = "B" { s1*5 } % Voice "B" を 5 小節の間、維持する
564 \context Voice = "A" {
568 \context Voice = "B" {
572 \context Voice = "A" { \musicA }
573 \context Voice = "B" { \musicB }
574 \context Voice = "A" { \musicA }
585 @cindex lyrics, aligning with sporadic melody (途切れ途切れのメロディに歌詞を揃える)
588 途切れ途切れのメロディに歌詞を持たせる方法を示しています。@c
590 メロディや伴奏は複数のセクションによって構成されることになります。
593 @lilypond[quote,verbatim]
594 melody = \relative c'' { a4 a a a }
595 accompaniment = \relative c' { d4 d d d }
596 words = \lyricmode { These words fol -- low the mel -- o -- dy }
599 \new Staff = "music" {
601 \new Voice = "melody" {
603 s1*4 % Voice "melody" を 4 小節の間、残します
606 \new Voice = "accompaniment" {
611 \context Voice = "melody" { \melody }
612 \context Voice = "accompaniment" { \accompaniment }
614 \context Voice = "accompaniment" { \accompaniment }
616 \context Voice = "melody" { \melody }
617 \context Voice = "accompaniment" { \accompaniment }
622 \new Lyrics \with { alignAboveContext = #"music" }
623 \lyricsto "melody" { \words }
628 これに代わる方法として、メロディに直接空白休符を付け加えて、@c
629 メロディが伴奏と揃うようにする方法があります
630 -- 多くの場合、こちらの方法の方が良いかもしれません:
633 @lilypond[quote,verbatim]
634 melody = \relative c'' {
640 accompaniment = \relative c' {
646 words = \lyricmode { These words fol -- low the mel -- o -- dy }
650 \new Staff = "music" {
652 \new Voice = "melody" {
656 \new Voice = "accompaniment" {
662 \new Lyrics \with { alignAboveContext = #"music" }
663 \lyricsto "melody" { \words }
669 @node コンテキストのプラグインを変更する
670 @subsection コンテキストのプラグインを変更する
671 @translationof Modifying context plug-ins
673 @c TODO Should this be Modifying engravers or Modifying contexts?
675 記譜コンテキスト (@code{Score} や @code{Staff} のような) は@c
677 @q{エングラーバ} と呼ばれる記譜要素を作成するプラグインを保持します。@c
678 例えば、@code{Voice} コンテキストは @code{Note_head_engraver} を保持し、@c
679 @code{Staff} コンテキストは @code{Key_engraver} を保持します。
683 @rinternals{Engravers and Performers}.
686 Internals Reference @expansion{} Translation @expansion{} Engravers.
690 @rinternals{Contexts}
693 Internals Reference @expansion{} Translation @expansion{} Context.
695 の中にある各コンテキストについての説明では、@c
696 そのコンテキストで使用されるエングラーバがリストアップされています。
698 これらのプラグインを入れ換えると有用な場合があります。@c
699 プラグインを入れ換えるには、新たに作成するコンテキストを
700 @code{\new} あるいは @code{\context} で開始し、@c
701 そのコンテキストを以下のように変更します:
706 \new @var{context} \with @{
719 ここで、@dots{} はエングラーバの名前になります。@c
720 ここで、@code{Staff} コンテキストから @code{Time_signature_engraver} と
721 @code{Clef_engraver} を削除する簡単な例を示します:
723 @lilypond[quote,relative=1,verbatim,fragment]
729 \remove "Time_signature_engraver"
730 \remove "Clef_engraver"
737 2 番目の譜には、拍子記号と音部記号がありません。@c
738 この方法は、オブジェクトを不可視にするよりも乱暴な方法です。@c
739 なぜなら、譜全体に影響を与えるからです。@c
740 さらに、望む望まないに係わらず、この方法はスペースにも影響を与えます。@c
741 オブジェクトを消すもっと洗練された方法については、@c
742 @rlearning{オブジェクトの可視性と色} を参照してください。
745 通常、小節線と拍子記号は楽譜全体で同期されます。@c
746 これは @code{Timing_translator} と @code{Default_bar_line_engraver}
748 このプラグインは拍子記号の管理や、小節内の配置の管理などを行います。@c
749 これらのエングラーバを @code{Score} コンテキストから
750 @code{Staff} コンテキストへ異動させることにより、@c
751 楽譜の各譜に独自の拍子記号を持たせることが可能になります。
753 @cindex polymetric scores (多拍子の楽譜)
754 @cindex Time signatures, multiple (複数の拍子記号)
756 @lilypond[quote,relative=1,ragged-right,verbatim,fragment]
758 \remove "Timing_translator"
759 \remove "Default_bar_line_engraver"
762 \consists "Timing_translator"
763 \consists "Default_bar_line_engraver"
769 \consists "Timing_translator"
770 \consists "Default_bar_line_engraver"
780 エングラーバを指定する順序は、エングラーバが処理を行う順序です。@c
781 通常、エングラーバが指定される順序は問題にはなりません。@c
782 しかしながら、いくつかの特殊なケースでは、この順序が重要になります。@c
783 例えば、あるエングラーバがプロパティを記述して、@c
784 それを他のエングラーバが読む場合、あるいは、@c
785 あるエングラーバがグラフィカル オブジェクトを作成し、@c
786 それを他のエングラーバが処理しなければならない場合です。@c
792 通常、@code{Bar_engraver} を最初にする必要があります。
795 @code{New_fingering_engraver} を @code{Script_column_engraver} の前に@c
799 @code{Timing_translator} を @code{Bar_number_engraver} の前に配置する@c
806 @file{ly/engraver-init.ly}
809 @node コンテキストのデフォルト設定を変更する
810 @subsection コンテキストのデフォルト設定を変更する
811 @translationof Changing context default settings
813 @cindex default context properties, changing (デフォルトのコンテキスト プロパティを変更する)
814 @cindex context properties, changing defaults (デフォルトのコンテキスト プロパティを変更する)
816 @ref{Modifying properties} で説明したように、コンテキストとグラフィカル
817 オブジェクトのプロパティを @code{\set} コマンドや @code{\override}
819 これらのコマンドは音楽イベントを生成して、楽譜処理中にコマンドが出現する@c
822 対照的に、このセクションではコンテキストが作成された時点でコンテキストと@c
823 グラフィカル オブジェクトのプロパティの @emph{デフォルト} 値を変更する@c
826 1 つはある特定のタイプの全コンテキストのデフォルト値を変更する方法で、@c
827 もう 1 つはただ 1 つのコンテキストのインスタンスのデフォルト値を変更する@c
831 * 同じタイプの全コンテキストを変更する::
832 * 指定したコンテキストだけを変更する::
836 @node 同じタイプの全コンテキストを変更する
837 @unnumberedsubsubsec 同じタイプの全コンテキストを変更する
838 @translationof Changing all contexts of the same type
840 @cindex \context in \layout block (\layout ブロックの中の \context)
844 @code{Score}, @code{Staff}, @code{Voice}, その他のコンテキストにおいて@c
845 デフォルトで使用されるコンテキスト設定は、@code{\layout} ブロックの中の@c
846 @code{\context} ブロックでで指定することができます。@c
847 @code{\layout} ブロックは、それを適用する @code{\score} ブロックの中で、@c
848 かつ、音楽表記の後に配置する必要があります。
854 [すべての Voice コンテキストのコンテキスト設定]
858 [context settings for all Staff contexts]
863 以下のタイプの設定を指定することができます:
867 @code{\override} コマンド -- コンテキスト名を省略します
869 @lilypond[quote,verbatim]
872 a4^"Thicker stems" a a a
878 \override Stem.thickness = #4.0
887 @lilypond[quote,verbatim]
890 a4^"Smaller font" a a a
903 @code{\dynamicUp} や @code{\accidentalStyle dodecaphonic} のような音楽@c
906 @lilypond[quote,verbatim]
909 a4^"Dynamics above" a a a
919 \accidentalStyle dodecaphonic
926 @code{\with} ブロックを有するユーザ定義変数 -- @code{\with} ブロックの@c
927 詳細は @ref{Changing just one specific context} を参照してください。
929 @lilypond[quote,verbatim]
930 StaffDefaults = \with {
937 a4^"Smaller font" a a a
952 プロパティ設定コマンドは、@code{\context} ブロックで囲まずに、@c
953 @code{\layout} ブロックの中に配置することができます。@c
954 そのような設定は、指定されたタイプの任意のコンテキストの開始時に@c
955 プロパティ設定コマンドをインクルードするのと等価です。@c
956 コンテキストを指定しない場合、@emph{すべての} 下位コンテキストに影響を@c
957 与えます -- @ref{Bottom-level contexts - voices} を参照してください。@c
958 @code{\layout} ブロックの中でのプロパティ設定コマンドの構文は、@c
959 音楽ストリームの中で同じコマンドを記述するのと同じです。
961 @lilypond[quote,verbatim]
965 a4^"Smaller font" a a a
970 \accidentalStyle dodecaphonic
972 \override Voice.Stem.thickness = #4.0
978 @node 指定したコンテキストだけを変更する
979 @unnumberedsubsubsec 指定したコンテキストだけを変更する
980 @translationof Changing just one specific context
985 @code{\with} ブロックで指定したコンテキスト インスタンスのコンテキスト
986 プロパティだけを変更することができます。@c
987 他の全ての同じタイプのコンテキスト インスタンスは、LilyPond に組み込まれて@c
988 スコープ内の @code{\layout} ブロックによって変更されたデフォルト設定の@c
990 @code{\with} ブロックは @code{\new} @var{context-type} コマンドの直後に@c
996 [このコンテキスト インスタンスだけに適用されるコンテキスト設定]
1002 以下のタイプの設定を指定することができます:
1006 @code{\override} コマンド -- コンテキスト名を省略します
1008 @lilypond[quote,verbatim]
1013 \override Stem.thickness = #4.0
1017 a4^"Thick stems" a a a
1026 コンテキスト プロパティを直接設定します
1028 @lilypond[quote,verbatim]
1033 a4^"Default font" a a a
1042 a4^"Smaller font" a a a
1051 @code{\dynamicUp} 等のあらかじめ定義されているコマンド
1053 @lilypond[quote,verbatim]
1059 a4^"Dynamics below" a a a
1065 \with { \accidentalStyle dodecaphonic }
1068 \with { \dynamicUp }
1071 a4^"Dynamics above" a a a
1083 @unnumberedsubsubsec 適用順序
1084 @translationof Order of precedence
1086 ある特定のタイミングで適用されるプロパティの値は以下のように決定されます:
1090 入力ストリームの中の @code{\override} コマンドや @code{\set} コマンドが
1094 さもなければ、コンテキスト初期宣言の @code{\with} から取得したデフォルト値@c
1098 さもなければ、@code{\layout} ブロックの中にある直近で適切な @code{\context}
1099 ブロックから取得したデフォルト値が用いられます。
1102 さもなければ、LilyPond の組み込みデフォルト値が用いられます。
1107 @rlearning{Modifying context properties}
1110 @ref{Contexts explained},
1111 @ref{Bottom-level contexts - voices},
1112 @ref{The set command},
1113 @ref{The override command},
1114 @ref{The \layout block}
1117 @node 新しいコンテキストを定義する
1118 @subsection 新しいコンテキストを定義する
1119 @translationof Defining new contexts
1121 @cindex contexts, defining new (新しいコンテキストを定義する)
1122 @cindex engravers, including in contexts (エングラーバをコンテキストに含める)
1137 @code{Staff} や @code{Voice} のようなコンテキストは、@c
1138 簡単なブロックの組み合わせで構成されています。
1139 エングラーバ プラグインの組み合わせを変えることで、@c
1140 新しいタイプのコンテキスを作成することができます。
1142 次の例は、ゼロからタイプの異なる @code{Voice} コンテキストを作り上げる方法を@c
1144 このコンテキストは @code{Voice} コンテキストに似ていますが、@c
1145 音符の代わりにスラッシュを譜の中央に譜刻します。@c
1146 これはジャズで即興を表すのに使うことができます。
1148 @lilypond[quote,ragged-right]
1149 \layout { \context {
1151 \type "Engraver_group"
1152 \consists "Note_heads_engraver"
1153 \consists "Rhythmic_column_engraver"
1154 \consists "Text_engraver"
1155 \consists "Pitch_squash_engraver"
1156 squashedPosition = #0
1157 \override NoteHead.style = #'slash
1162 \accepts "ImproVoice"
1166 a4 d8 bes8 \new ImproVoice { c4^"ad lib" c
1167 c4 c^"undress" c_"while playing :)" c }
1173 これらの設定は @code{\layout} ブロック内部の @code{\context} ブロック@c
1184 以下では、上記の例の @dots{} に入るべき入力について議論します。
1186 最初に、新しいコンテキストの名前を定義する必要があります:
1192 このコンテキストは @code{Voice} に似せる必要があるため、@c
1193 (既存の) @code{Voice} と同じ機能を実現するコマンドが必要です。@c
1194 これは、新しいコンテキストにエイリアス @code{Voice} を与えることで実現できます。
1200 このコンテキストは音符と指示テキストを譜刻しますので、@c
1201 それらの機能を提供するエングラーバを付け加える必要があります:
1204 \consists "Note_heads_engraver"
1205 \consists "Text_engraver"
1208 しかしながら、音符の代わりにスラッシュを譜の中央線上に配置します:
1211 \consists "Pitch_squash_engraver"
1212 squashedPosition = #0
1215 @rinternals{Pitch_squash_engraver} は
1216 (@rinternals{Note_heads_engraver} によって作成される) 符頭を変更し、@c
1217 符頭の垂直位置を @code{squashedPosition} にセットします
1218 -- 今回は @code{0}、つまり中央線上です。
1223 \override NoteHead.style = #'slash
1227 これらのプラグインすべてが共同する必要があり、@c
1228 それには特殊なプラグインが必要です。@c
1229 このプラグインは常に @code{Engraver_group} であり、@c
1230 キーワード @code{\type} を付ける必要があります。
1233 \type "Engraver_group"
1241 \type "Engraver_group"
1242 \consists "Note_heads_engraver"
1243 \consists "Text_engraver"
1244 \consists "Pitch_squash_engraver"
1245 squashedPosition = #0
1246 \override NoteHead.style = #'slash
1254 通常の @code{Voice} と同様に、@c
1255 @code{ImproVoice} を @code{Staff} の下に置く必要があります。@c
1256 それゆえ、@code{Staff} 定義を @code{\accepts} コマンドで変更します:
1266 @code{\accepts} の反対は @code{\denies} です。@c
1267 これは既存のコンテキスト定義を再利用する場合に必要となります。
1269 以下のように、両方を @code{\layout} ブロックの中に置きます:
1279 \accepts "ImproVoice"
1284 それから、このサブセクションの最初にあった出力を入力します:
1292 c c_"while playing :)"
1300 @subsection コンテキストの配置順序
1301 @translationof Context layout order
1303 @cindex contexts, layout order (コンテキストの配置順序)
1307 通常、コンテキストは入力ファイルの中で記述した順に楽譜の段の上から下に@c
1309 コンテキストがネストされている場合、外側のコンテキストは入力ファイルの@c
1310 中で指定されたコンテキストを内側に保持して、内側のコンテキストは外側の@c
1311 コンテキストの @qq{accepts} リストに含まれます。@c
1312 ネストされたコンテキストのうち外側のコンテキストの @qq{accepts} リスト@c
1313 に含まれないものは、ネストされずに外側のコンテキストの下に再配置されます。
1315 コンテキストの @qq{accepts} リストを @code{\accepts} コマンドと
1316 @code{\denies} コマンドで変更することができます。@c
1317 @code{\accepts} はコンテキストを @qq{accepts} リストに追加して、@c
1318 @code{\denies} は @qq{accepts} リストからコンテキストを削除します。@c
1319 例えば、通常、コード ネームは @code{Staff} コンテキストの中にネスト@c
1320 されないため、@code{ChordNames} コンテキストはデフォルトでは @code{Staff}
1321 コンテキストの @qq{accepts} リストには含まれませんが、リストに含める必要が@c
1324 @lilypond[verbatim,quote]
1328 \chords { d1:m7 b1:min7.5- }
1333 @lilypond[verbatim,quote]
1337 \chords { d1:m7 b1:min7.5- }
1342 \accepts "ChordNames"
1348 @code{\denies} は主に、他のコンテキストをベースに新しいコンテキストを@c
1349 作成した時に、中にネストするコンテキストを変更するために用いられます。
1351 例えば、@code{VaticanaStaff} コンテキストは @code{Staff} コンテキストを@c
1352 ベースにしていますが、@qq{accepts} リストでは @code{Voice} コンテキスト@c
1353 の代わりに @code{VaticanaVoice} コンテキストを保持しています。
1355 コンテキストに保持されるべきコマンドが出現して、それを保持するための@c
1356 適切なコンテキストが存在しない場合、コンテキストが暗黙的に作成される@c
1358 これは予期しない譜や楽譜を生み出す可能性があります。
1360 @cindex alignAboveContext
1361 @cindex alignBelowContext
1362 @funindex alignAboveContext
1363 @funindex alignBelowContext
1365 短い期間、あるコンテキストを存在させる必要がある場合があります。@c
1366 オッシアの譜コンテキストが良い例です。@c
1367 通常、これは主音楽の対応するセクションと並列に、適切な場所でコンテキスト@c
1369 デフォルトでは、一時コンテキストは既存のすべてのコンテキストの下に配置@c
1371 @qq{main} というコンテキストの上に配置し直すには以下のようにします:
1374 @code{\new Staff \with @{ alignAboveContext = #"main" @} }
1377 @code{ChoirStaff} のような複数の譜のレイアウトで一時的な歌詞を配置する場合
1378 -- 例えば、繰り返しセクションに 2 番目の歌詞を追加する場合 --
1380 デフォルトでは、一時的な歌詞は下段の譜の下に配置されます。@c
1381 一時的な歌詞コンテキストを @code{alignBelowContext} で定義することにより、@c
1382 1 番目の歌詞を保持する (名前付きの) 歌詞コンテキストの下に配置することが@c
1385 一時コンテキストを再配置する例は他にもあります
1386 -- @rlearning{Nesting music expressions}、+@ref{Modifying single staves}、@c
1387 それに @ref{Techniques specific to lyrics} を参照してください。
1391 @rlearning{Nesting music expressions}
1394 @ref{Modifying single staves},
1395 @ref{Techniques specific to lyrics}
1398 @rprogram{An extra staff appears}
1401 @file{ly/engraver-init.ly}
1405 @section 内部リファレンスの説明
1406 @translationof Explaining the Internals Reference
1412 * グラフィカル オブジェクト プロパティを決定する::
1416 @node 内部リファレンスを使いこなす
1417 @subsection 内部リファレンスを使いこなす
1418 @translationof Navigating the program reference
1420 @c TODO remove this (it's in the LM)
1421 @c Replace with more factual directions
1423 以下の譜面の運指記号を移動させたいとします:
1425 @lilypond[quote,relative=2,verbatim]
1431 運指指示のドキュメント (@ref{運指の指示}) を見ると、@c
1432 以下のようなセクションがあることに気付くはずです:
1437 内部リファレンス: @rinternals{Fingering}
1442 @c outdated info; probably will delete.
1444 This fragment points to two parts of the program reference: a page
1445 on @code{FingeringEvent} and one on @code{Fingering}.
1447 The page on @code{FingeringEvent} describes the properties of the music
1448 expression for the input @code{-2}. The page contains many links
1449 forward. For example, it says
1452 Accepted by: @rinternals{Fingering_engraver},
1456 That link brings us to the documentation for the Engraver, the
1460 This engraver creates the following layout objects: @rinternals{Fingering}.
1463 In other words, once the @code{FingeringEvent}s are interpreted, the
1464 @code{Fingering_engraver} plug-in will process them.
1468 @c I can't figure out what this is supposed to mean. -gp
1470 The @code{Fingering_engraver} is also listed to create
1471 @rinternals{Fingering} objects,
1473 @c old info? it doesn't make any sense to me with our current docs.
1475 second bit of information listed under @b{See also} in the Notation
1480 内部リファレンスは HTML ドキュメント形式で入手可能です。@c
1481 内部リファレンスは、オンラインか HTML ドキュメントをダウンロードするかして、@c
1482 HTML 形式で読むことを強く推奨します。@c
1483 PDF マニュアルを使用していると、@c
1484 このセクションを理解するのはずっと困難になります。@c
1485 (訳者: 日本語では PDF 形式での提供はありません。)
1488 @rinternals{Fingering} へのリンクを辿ってください。@c
1489 ページの先頭に、以下のような記述があります:
1492 Fingering objects are created by: @rinternals{Fingering_engraver} and
1493 @rinternals{New_fingering_engraver}.
1496 内部リファレンスの中にある関連リンクを辿っていくことで、@c
1497 プログラム内部の情報フローを追っていくことができます:
1501 @item @rinternals{Fingering}:
1502 @rinternals{Fingering} objects are created by:
1503 @rinternals{Fingering_engraver}
1505 (@rinternals{Fingering}:
1506 @rinternals{Fingering} オブジェクトを作成するのは:
1507 @rinternals{Fingering_engraver})
1510 @item @rinternals{Fingering_engraver}:
1511 Music types accepted:
1512 @rinternals{fingering-event}
1514 (@rinternals{Fingering_engraver}:
1515 受け取る音楽タイプは: @rinternals{fingering-event})
1517 @item @rinternals{fingering-event}:
1518 Music event type @code{fingering-event} is in
1519 Music expressions named @rinternals{FingeringEvent}
1521 (@rinternals{fingering-event}:
1522 音楽イベント タイプ @code{fingering-event} は
1523 @rinternals{FingeringEvent} という名前の音楽表記の中にあります)
1526 このパスは、プログラム内部での情報フローとは逆向きです:
1527 出力からスタートして、入力イベントで終わっています。@c
1528 入力イベントからスタートして、情報フローを読み進め、@c
1529 最後は出力オブジェクトに辿り着くこともできます。
1531 内部リファレンスを通常のドキュメントのように読むこともできます。@c
1534 @rinternals{Music definitions},
1537 @code{Music definitions},
1539 @rinternals{Translation}, それに @rinternals{Backend} です。
1540 各章は、使用されているすべての定義と調整可能なすべてのプロパティを@c
1544 @node レイアウト インターフェイス
1545 @subsection レイアウト インターフェイス
1546 @translationof Layout interfaces
1548 @cindex interface, layout (レイアウト インターフェイス)
1549 @cindex layout interface (レイアウト インターフェイス)
1550 @cindex grob (グラフィカル オブジェクト)
1552 前のセクションで見た HTML ページには、@c
1553 @rinternals{Fingering} と呼ばれるレイアウト オブジェクトについての@c
1555 そのようなオブジェクトは楽譜で記号となります。@c
1556 レイアウト オブジェクトは (太さや向きのような) 数値を保持する@c
1558 関連オブジェクトへのポインタも持っています。@c
1559 レイアウト オブジェクトは @emph{Grob}
1560 -- これはグラフィカル オブジェクトを縮めたものです --
1562 Grob についての詳細は、@rinternals{grob-interface} を参照してください。
1564 @code{Fingering} のページは、@c
1565 @code{Fingering} オブジェクトの定義をリストアップしています。@c
1566 例えば、このページには以下のような記述があります:
1569 @code{padding} (dimension, in staff space):
1575 これは、この数値は少なくとも符頭の 0.5 倍の距離を保つということを意味します。
1578 各レイアウト オブジェクトは、記譜要素あるいは写植要素としての機能を@c
1580 例えば、@code{Fingering} オブジェクトは以下の側面を持っています:
1584 Its size is independent of the horizontal spacing, unlike slurs or beams.
1586 (このオブジェクトのサイズは、スラーや連桁と異なり、@c
1590 It is a piece of text. Granted, it is usually a very short text.
1592 (このオブジェクトはテキストです。通常、これは非常に短いテキストです。)
1595 That piece of text is typeset with a font, unlike slurs or beams.
1597 (このテキストは、スラーや連桁と異なり、フォントで写植されます。)
1600 Horizontally, the center of the symbol should be aligned to the
1601 center of the note head.
1603 (水平方向では、この記号の中心は符頭の中心に揃えられます。)
1606 Vertically, the symbol is placed next to the note and the staff.
1608 (垂直方向では、この記号は音符や譜の近く配置されます。)
1611 The vertical position is also coordinated with other superscript
1612 and subscript symbols.
1614 (また、垂直方向の位置は、他の上付き記号や下付き記号との調整によって決まります。)
1617 これらの側面はそれぞれ、いわゆる @emph{インターフェイス}
1619 それらは、@rinternals{Fingering} ページの最下部でリストアップされています。
1622 This object supports the following interfaces:
1624 (このオブジェクトは以下のインターフェイスをサポートします:)
1626 @rinternals{item-interface},
1627 @rinternals{self-alignment-interface},
1628 @rinternals{side-position-interface}, @rinternals{text-interface},
1629 @rinternals{text-script-interface}, @rinternals{font-interface},
1630 @rinternals{finger-interface}, and @rinternals{grob-interface}.
1634 それぞれのオブジェクト インターフェイスのページに行くことができます。@c
1635 各インターフェイスはいくつかのプロパティを持ちます。@c
1636 それらプロパティの中には、ユーザにとって役に立たないもの
1637 (@q{内部プロパティ}) もありますが、それ以外は変更可能です。
1639 これまで @code{Fingering} オブジェクトについて話してきましたが、@c
1640 これは実際にはそれほど多くのことをしているわけではありません。@c
1641 初期化ファイル (@rlearning{その他の情報源} を参照してください)
1642 @file{scm/define-grobs.scm} がこの @q{オブジェクト} の本質を示しています:
1647 (avoid-slur . around)
1648 (slur-padding . 0.2)
1649 (staff-padding . 0.5)
1650 (self-alignment-X . 0)
1651 (self-alignment-Y . 0)
1652 (script-priority . 100)
1653 (stencil . ,ly:text-interface::print)
1654 (direction . ,ly:script-interface::calc-direction)
1655 (font-encoding . fetaText)
1656 (font-size . -5) ; don't overlap when next to heads.
1657 (meta . ((class . Item)
1658 (interfaces . (finger-interface
1660 text-script-interface
1662 side-position-interface
1663 self-alignment-interface
1664 item-interface))))))
1669 @code{Fingering} オブジェクトは変数設定の塊に過ぎず、@c
1670 内部リファレンスの中にある Web ページは、@c
1671 この定義から直接生成されたに過ぎません。
1674 @node グラフィカル オブジェクト プロパティを決定する
1675 @subsection グラフィカル オブジェクト プロパティを決定する
1676 @translationof Determining the grob property
1678 @c TODO remove this (it's in the LM)
1679 @c Replace with more factual directions
1681 以下の @b{2} の位置を変更しようとしていたことを思い出してください:
1683 @lilypond[quote,fragment,relative=2,verbatim]
1689 垂直方向で見て、@b{2} は元の音符の隣に配置されるのですから、@c
1690 この配置に関連するインターフェイスに干渉する必要があります。@c
1691 これは @code{side-position-interface} を用いて行います。@c
1692 このインターフェイスについてのページには、以下のように記述されています:
1695 @code{side-position-interface}
1697 Position a victim object (this one) next to other objects (the
1698 support). The property @code{direction} signifies where to put the
1699 victim object relative to the support (left or right, up or down?)
1701 (対象オブジェクトを他のオブジェクト (サポート オブジェクト)
1703 このプロパティ @code{direction} は、@c
1704 対象オブジェクトをどこに配置するかを@c
1705 サポート オブジェクトからの相対位置で示します
1711 この記述の下に、以下のような変数 @code{padding} についての記述があります:
1716 (dimension, in staff space)
1719 Add this much extra space between objects that are next to each other.
1720 (隣り合うオブジェクトの間にスペースを付け加えます)
1724 @code{padding} の値を増やすことで、@c
1725 運指記号を符頭から離すことができます。@c
1726 以下のコマンドは、音符と運指記号の間に 3 譜スペースを挿入します:
1729 \once \override Voice.Fingering.padding = #3
1732 このコマンドを @code{Fingering} オブジェクトが作成される前に挿入する
1733 -- つまり @code{c2} の前に挿入する -- と、以下のような結果が得られます:
1735 @lilypond[quote,relative=2,fragment,verbatim]
1736 \once \override Voice.Fingering.padding = #3
1743 このケースでは、調整されるコンテキストは @code{Voice} です。@c
1744 このことは、内部リファレンスの @rinternals{Fingering_engraver}
1745 プラグインについてのページからわかります。@c
1746 このページには、以下のような記述があります:
1749 Fingering_engraver is part of contexts: @dots{} @rinternals{Voice}
1751 (Fingering_engraver は次のコンテキストの一部です: @dots{} @rinternals{Voice})
1757 @translationof Naming conventions
1759 内部リファレンスについて他に説明しておくべき事柄として、@c
1760 さまざまな命名規約についての概要があります:
1763 @item Scheme スタイル: 小文字の単語をハイフンでつなぎます
1764 (1 単語の名前を含みます) -- 例: lowercase-with-hyphens
1765 @item Scheme 関数: Scheme スタイルの先頭に @code{ly:} を付けます
1766 -- 例: ly:plus-scheme-style
1767 @item 音楽イベント、音楽クラス、それに音楽プロパティ: Scheme スタイルです
1768 -- 例: as-scheme-functions
1769 @item グラフィカル オブジェクト インターフェイス: Scheme スタイルです
1771 @item バックエンド プロパティ: Scheme スタイルです (が、X と Y があります!)
1772 @item コンテキスト (それに、音楽表記とグラフィカル オブジェクト):
1773 大文字で始まる単語、あるいはそれらをつなげます
1774 -- 例: Capitalized, CamelCase
1776 小文字で始まる単語に、大文字で始まる単語をつなげます
1777 -- 例: lowercaseFollowedByCamelCase
1779 大文字で始まる単語に、小文字で始まる単語をアンダスコアでつなげます
1780 -- 例: Capitalized_followed_by_lowercase_and_with_underscores
1785 @item 命名規約のうち、慣習なのはどれで、規則なのはどれか?
1786 @item 命名規約のうち、どれが基本言語の規則で、@c
1787 どれが LP (訳者: LilyPond?) 特有の規則なのか?
1793 @translationof Modifying properties
1795 @c TODO change the menu and subsection node names to use
1796 @c backslash once the new macro to handle the refs
1797 @c is available. Need to find and change all refs at
1798 @c the same time. -td
1811 @subsection プロパティ変更の概要
1812 @translationof Overview of modifying properties
1814 各コンテキストは、ある特定のタイプのグラフィカル オブジェクトを作成することに@c
1816 それらのオブジェクトを表示するために使用される設定も、@c
1818 それらの設定を変更することにより、オブジェクトの見た目を変えることができます。
1820 コンテキストに保存されるプロパティには 2 種類あります:
1821 コンテキスト プロパティとグラフィカル オブジェクト プロパティです。@c
1822 コンテキスト プロパティは、コンテキスト全体に適用され、@c
1823 コンテキスト自体をどのように表示するかを制御します。@c
1824 対照的に、グラフィカル オブジェクト プロパティは、コンテキストの中に表示される@c
1825 ある特定のタイプのグラフィカル オブジェクトに適用されます。
1827 @code{\set} コマンドと @code{\unset} コマンドは、@c
1828 コンテキスト プロパティの値を変更するために使用されます。@c
1829 @code{\override} コマンドと @code{\revert} コマンドは、@c
1830 グラフィカル オブジェクト プロパティの値を変更するために使用されます。
1833 The syntax for this is
1836 \override @var{context}.@var{name} #'@var{property} = #@var{value}
1839 Here @var{name} is the name of a graphical object, like
1840 @code{Stem} or @code{NoteHead}, and @var{property} is an internal
1841 variable of the formatting system (@q{grob property} or @q{layout
1842 property}). The latter is a symbol, so it must be quoted. The
1843 subsection @ref{Modifying properties}, explains what to fill in
1844 for @var{name}, @var{property}, and @var{value}. Here we only
1845 discuss the functionality of this command.
1850 \override Staff.Stem.thickness = #4.0
1854 makes stems thicker (the default is 1.3, with staff line thickness as a
1855 unit). Since the command specifies @code{Staff} as context, it only
1856 applies to the current staff. Other staves will keep their normal
1857 appearance. Here we see the command in action:
1859 @lilypond[quote,verbatim,relative=2,fragment]
1861 \override Staff.Stem.thickness = #4.0
1867 The @code{\override} command changes the definition of the @code{Stem}
1868 within the current @code{Staff}. After the command is interpreted
1869 all stems are thickened.
1871 Analogous to @code{\set}, the @var{context} argument may be left out,
1872 causing the default context @code{Voice} to be used. Adding
1873 @code{\once} applies the change during one timestep only.
1875 @lilypond[quote,fragment,verbatim,relative=2]
1877 \once \override Stem.thickness = #4.0
1882 The @code{\override} must be done before the object is
1883 started. Therefore, when altering @emph{Spanner} objects such as slurs
1884 or beams, the @code{\override} command must be executed at the moment
1885 when the object is created. In this example,
1887 @lilypond[quote,fragment,verbatim,relative=2]
1888 \override Slur.thickness = #3.0
1890 \override Beam.beam-thickness = #0.6
1895 the slur is fatter but the beam is not. This is because the command for
1896 @code{Beam} comes after the Beam is started, so it has no effect.
1898 Analogous to @code{\unset}, the @code{\revert} command for a context
1899 undoes an @code{\override} command; like with @code{\unset}, it only
1900 affects settings that were made in the same context. In other words, the
1901 @code{\revert} in the next example does not do anything.
1904 \override Voice.Stem.thickness = #4.0
1905 \revert Staff.Stem.thickness
1908 Some tweakable options are called @q{subproperties} and reside inside
1909 properties. To tweak those, use commands of the form
1911 @c leave this as a long long
1913 \override @var{context}.@var{name} #'@var{property} #'@var{subproperty} = #@var{value}
1920 \override Stem.details.beamed-lengths = #'(4 4 3)
1927 @rinternals{Backend},
1928 @rinternals{All layout objects},
1929 @rinternals{OverrideProperty},
1930 @rinternals{RevertProperty},
1931 @rinternals{PropertySet}
1936 バックエンドはオブジェクト プロパティのタイプ チェックを@c
1938 Scheme 値の循環参照は、ハング アップまたはクラッシュ、@c
1939 あるいは両方を引き起こす可能性があります。
1944 @subsection @code{\set} コマンド
1945 @translationof The set command
1947 @cindex properties (プロパティ)
1949 @cindex changing properties (プロパティを変更する)
1951 各コンテキストは @emph{プロパティ} の集合を持ちます。@c
1952 プロパティとは、コンテキストの中に保持されている変数です。@c
1953 コンテキスト プロパティは、@code{\set} コマンドによって変更されます。@c
1954 @code{\set} コマンドは以下のような構文を持ちます:
1957 \set @var{context}.@var{property} = #@var{value}
1960 @var{value} は Scheme オブジェクトですので、@c
1961 @code{#} 文字を前に置く必要があります。
1963 通常、コンテキスト プロパティの名前は、@c
1964 小文字で始まる単語に大文字で始まる単語をつなげたものです。@c
1965 これらはたいてい音楽から記譜への翻訳を制御します
1966 -- 例えば、@code{localKeySignature} (臨時記号を表示するかどうかを決定します)
1967 や、@code{measurePosition} (小節線を表示するタイミングを決定します) です。@c
1968 コンテキスト プロパティは、楽曲の解釈をしている間、@c
1969 ずっと値を変更しておくことができます。@c
1970 @code{measurePosition} がその良い例です。@c
1971 コンテキスト プロパティは @code{\set} で変更されます。
1973 例えば、コンテキスト プロパティ @code{skipBars} が
1974 @code{#t} にセットされていれば、@c
1975 複小節休符は 1 つの小節に統合されます:
1977 @lilypond[quote,verbatim,relative=2,fragment]
1979 \set Score.skipBars = ##t
1983 @var{context} 引数が省略されている場合、@c
1984 プロパティはカレントの最下位のコンテキストにセットされます
1985 (一般に、@code{ChordNames}, @code{Voice}, @code{TabVoice},
1986 あるいは @code{Lyrics} です)。
1988 @lilypond[quote,verbatim,relative=2]
1989 \set Score.autoBeaming = ##f
1993 \set autoBeaming = ##t
2001 変更は @q{オンザフライ} (その場、その時々) で適用されるため、@c
2002 設定 @code{\set autoBeaming = ##t} は 2 番目の 8 分音符グループだけに@c
2005 最下位コンテキストが常に変更しようとしているプロパティを持っているとは@c
2007 -- 例えば、@code{skipBars} プロパティをデフォルトの最下位コンテキスト
2008 (この場合は、@code{Voice} です) にセットしようと試みても、効果はありません。@c
2009 なぜなら、@code{skipBars} は @code{Score} コンテキストのプロパティだからです。
2011 @lilypond[quote,verbatim,relative=2]
2017 コンテキストは階層構造をとるため、音楽表記を囲っているコンテキスト
2018 -- 例えば、@code{Staff} -- が指定された場合、@c
2019 変更はカレントの @code{Staff} の中にあるすべての @code{Voice} に適用されます。
2026 \unset @var{context}.@var{property}
2030 は、@var{context} から @var{property} の定義を削除するために使用されます。@c
2031 このコマンドは、@var{context} の中にセットされた場合にのみ、定義を削除します。@c
2032 音楽表記を囲っているコンテキストにセットされたプロパティは、@c
2033 囲まれているコンテキストの中にある @code{\unset} では変更されません:
2035 @lilypond[quote,verbatim,relative=2]
2036 \set Score.autoBeaming = ##t
2041 \unset Score.autoBeaming
2050 最下位コンテキストに対しては @var{context} 引数を指定する必要はありません。@c
2054 \set Voice.autoBeaming = ##t
2055 \set autoBeaming = ##t
2059 は、カレントの最下位コンテキストが @code{Voice} であれば、等価です。
2063 @code{\set} の前に @code{\once} を置くと、@c
2064 その設定は単一の時間ステップにだけ適用されます:
2066 @lilypond[quote,verbatim,relative=2]
2068 \once \set fontSize = #4.7
2073 利用可能なすべてのコンテキスト プロパティについての完全な記述は、@c
2077 @rinternals{Tunable context properties}.
2080 Translation @expansion{} Tunable context properties.
2085 @rinternals{Tunable context properties}
2089 @subsection @code{\override} コマンド
2090 @translationof The override command
2092 @cindex grob properties (グラフィカル オブジェクト プロパティ)
2093 @cindex properties, grob (グラフィカル オブジェクト プロパティ)
2096 特殊なタイプのコンテキスト プロパティがあります:
2097 グラフィカル オブジェクト記述です。@c
2098 グラフィカル オブジェクト記述には @code{StudlyCaps} という名前
2099 (大文字で始まります) が付けられています。@c
2100 これらは、関連リストとして、ある特定の種類のグラフィカル オブジェクト用の
2101 @q{デフォルト設定} を保持します。@c
2102 各グラフィカル オブジェクト記述の設定を調べるには、@c
2103 @file{scm/define-grobs.scm} を参照してください。@c
2104 各グラフィカル オブジェクト記述は @code{\override} を用いて変更します。
2106 @code{\override} コマンドの構文は以下の通りです:
2109 \override [@var{context}.]@var{GrobName}.@var{property} = #@var{value}
2112 例えば、@code{Stem} オブジェクトの @code{thickness} プロパティを@c
2113 オーバライドすることによって、符幹の太さを太くすることができます:
2115 @lilypond[quote,verbatim,relative=2]
2117 \override Voice.Stem.thickness = #3.0
2121 @code{\override} でコンテキストが指定されていない場合、その下にある@c
2124 @lilypond[quote,verbatim,relative=2]
2125 { \override Staff.Stem.thickness = #3.0
2129 \override Stem.thickness = #0.5
2138 調整可能なオプションには @q{サブプロパティ} があり、これはプロパティの@c
2140 これを調整するには、以下のような形式のコマンドを用います:
2143 \override Stem.details.beamed-lengths = #'(4 4 3)
2146 また、スパナの端を変更するには、以下のようにします:
2149 \override TextSpanner.bound-details.left.text = #"left text"
2150 \override TextSpanner.bound-details.right.text = #"right text"
2154 @cindex reverting overrides (オーバライドを元に戻す)
2155 @cindex overrides, reverting (オーバライドを元に戻す)
2157 @code{\override} の効果は、@code{\revert} によって元に戻すことができます。
2159 @code{\revert} の構文は以下の通りです:
2162 \revert [@var{context}.]@var{GrobName}.@var{property}
2167 @lilypond[quote,verbatim,relative=2]
2169 \override Voice.Stem.thickness = #3.0
2171 \revert Voice.Stem.thickness
2175 @code{\override} と @code{\revert} の効果は、@c
2176 その時点から影響を受けるコンテキストの中にある@c
2177 すべてのグラフィカル オブジェクトに適用されます:
2179 @lilypond[quote,verbatim,relative=2]
2184 \override Staff.Stem.thickness = #3.0
2188 \revert Staff.Stem.thickness
2196 @cindex overriding for only one moment (一時的にオーバライドする)
2198 @code{\once} を @code{\override} と共に用いることで、@c
2199 カレントの時間ステップだけに効果を与えることができます:
2201 @lilypond[quote,verbatim,relative=2]
2205 \override Stem.thickness = #3.0
2209 \once \override Stem.thickness = #3.0
2218 Commands which change output generally look like
2221 \override Voice.Stem.thickness = #3.0
2225 To construct this tweak we must determine these bits of information:
2228 @item the context: here @code{Voice}.
2229 @item the layout object: here @code{Stem}.
2230 @item the layout property: here @code{thickness}.
2231 @item a sensible value: here @code{3.0}.
2234 @cindex internal documentation
2235 @cindex finding graphical objects
2236 @cindex graphical object descriptions
2239 @cindex internal documentation
2241 For many properties, regardless of the data type of the property, setting the
2242 property to false ( @code{##f} ) will result in turning it off, causing
2243 LilyPond to ignore that property entirely. This is particularly useful for
2244 turning off grob properties which may otherwise be causing problems.
2246 We demonstrate how to glean this information from the notation manual
2247 and the program reference.
2252 @rinternals{Backend}
2256 @subsection @code{\tweak} コマンド
2257 @translationof The tweak command
2260 @cindex tweaking (調整)
2262 @code{\tweak} を用いたグラフィカル オブジェクト プロパティの変更は、@c
2263 コンテキストの中にあるすべてのグラフィカル オブジェクトに適用されます。@c
2265 影響を受けるコンテキストの中にあるすべてのグラフィカル オブジェクトではなく、@c
2266 1 つのグラフィカル オブジェクトだけに変更を適用したい場合もあります。@c
2267 そうするには、@code{\tweak} コマンドを用います。@c
2268 @code{\tweak} コマンドは以下のような構文を持ちます:
2271 \tweak [@var{layout-object}.]@var{grob-property} @var{value}
2274 @code{layout-object} の指定はオプションです。@c
2275 @code{\tweak} コマンドは、音楽の流れの中で
2276 @code{value} のすぐ後に現れる音楽オブジェクトに変更を適用します。
2279 In some cases, it is possible to take a short-cut for tuning
2280 graphical objects. For objects that are created directly from
2281 an item in the input file, you can use the @code{\tweak} command.
2284 @lilypond[relative=2,verbatim,quote]
2289 \tweak duration-log #1
2298 The main use of the @code{\tweak} command is to modify just
2299 one of a number of notation elements which start at the same musical
2300 moment, like the notes of a chord, or tuplet brackets which start
2303 The @code{\tweak} command sets a property in the following object
2304 directly, without requiring the grob name or context to be
2305 specified. For this to work, it is necessary for the @code{\tweak}
2306 command to remain immediately adjacent to the object to which it is
2307 to apply after the input file has been converted to a music stream.
2308 This is often not the case, as many additional elements are inserted
2309 into the music stream implicitly. For example, when a note which is
2310 not part of a chord is processed, LilyPond implicitly inserts a
2311 @code{ChordEvent} event before the note, so separating the tweak
2312 from the note. However, if chord symbols are placed round the
2313 tweak and the note, the @code{\tweak} command comes after the
2314 @code{ChordEvent} in the music stream, so remaining adjacent to the
2315 note, and able to modify it.
2319 @lilypond[relative=2,verbatim,quote]
2320 <\tweak color #red c>4
2326 @lilypond[relative=2,verbatim,quote]
2327 \tweak color #red c4
2332 調整コマンドの構文と使用方法についての紹介は、@c
2333 @rlearning{調整手段} を参照してください。
2335 同じようなオブジェクトがいくつか、同じ音楽タイミングで配置されている場合、@c
2336 @code{\override} コマンドでそれらの 1 つだけを変更することはできません
2337 -- @code{\tweak} コマンドを用いる必要があります。@c
2338 同じ音楽タイミングで複数出現する可能性があるオブジェクトには、@c
2341 @c TODO expand to include any further uses of \tweak
2344 @item 1 つの音符に付けられるアーティキュレーション記号
2345 @item 和音の中にある音符の間に付けられるタイ
2349 @c TODO add examples of these
2351 @cindex chord, modifying one note in (和音の中にある音符の 1 つを変更する)
2353 以下の例では、和音の中にある符頭の 1 つの色を変更し、@c
2354 さらに他の符頭のタイプを変更しています:
2356 @lilypond[relative=2,verbatim,quote]
2361 \tweak duration-log #1
2366 @code{\tweak} を用いて、スラーを変更することができます:
2368 @lilypond[verbatim,quote,relative=1]
2369 c-\tweak thickness #5 ( d e f)
2373 @code{\tweak} コマンドが機能するためには、@c
2374 入力ファイルが音楽の流れに変換されたときに、@c
2375 @code{\tweak} コマンドのすぐ後に@c
2376 変更が適用されるオブジェクトが配置されている必要があります。
2377 和音全体に対する調整は何の効果もありません。@c
2378 なぜなら、和音の音楽イベントはコンテナと機能するだけで、すべてのレイアウト
2379 オブジェクトは @code{EventChord} の内部にあるイベントによって作成される@c
2382 @lilypond[relative=2,verbatim,quote]
2383 \tweak color #red c4
2384 \tweak color #red <c e>4
2385 <\tweak color #red c e>4
2388 単純な @code{\tweak} コマンドでは入力から直接作成されないオブジェクトを@c
2390 特に、符幹、自動連桁、それに臨時記号には効果を持ちません。@c
2391 なぜなら、それらは入力ストリームの中の音楽要素によって生成される@c
2392 のではなく、後になって @code{NoteHead} レイアウト オブジェクトによって@c
2395 そのような直接作成されないレイアウト オブジェクトは、グラフィカル
2396 オブジェクト名を明示的に指定した @code{\tweak} コマンドを用いることで@c
2399 @lilypond[relative=2,verbatim,quote]
2400 \tweak Stem.color #red
2401 \tweak Beam.color #green c8 e
2402 <c e \tweak Accidental.font-size #-3 ges>4
2405 @code{\tweak} コマンドで音部記号や拍子記号を変更することはできません。@c
2406 なぜなら、コンテキストを指定するために必要とされる追加要素の自動挿入に@c
2407 より、それらは前に配置された @code{\tweak} コマンドとは分離されるから@c
2410 記譜要素の前に複数の @code{\tweak} コマンドを配置することができます
2413 @lilypond[verbatim,quote,relative=1]
2415 -\tweak style #'dashed-line
2416 -\tweak dash-fraction #0.2
2417 -\tweak thickness #3
2423 入力ファイルのあるセクションから生成される音楽の流れ
2424 -- 自動的に挿入される要素も含めて --
2426 @rextend{Displaying music expressions} を参照してください。@c
2427 これは、@code{\tweak} コマンドによって変更されるオブジェクトを決定するとき、@c
2429 @code{\tweak} の適用で入力を調整する方法を決定するときに役に立つかもしれません。
2436 @rextend{Displaying music expressions}
2439 @code{\tweak} コマンドで和音の中にある複数のタイのうち 1 つだけの位置を@c
2441 入力ファイルの中で最初に遭遇したタイの位置を変更してしまいます。
2443 @node set 対 override
2444 @subsection @code{\set} 対 @code{\override}
2445 @translationof set versus override
2447 @c TODO -- This section is probably unnecessary now.
2450 We have seen two methods of changing properties: @code{\set} and
2451 @code{\override}. There are actually two different kinds of
2454 @code{fontSize} is a special property: it is equivalent to
2455 entering @code{\override ... #'font-size} for all pertinent
2456 objects. Since this is a common change, the special
2457 property (modified with @code{\set}) was created.
2463 @subsection 連想配列を変更する
2464 @translationof Modifying alists
2466 ユーザが変更可能なプロパティの中には、@c
2467 内部的には @emph{連想配列} として存在しているものがあります
2468 -- 連想配列は @emph{キー} と @emph{値} のペアの配列を保持します。@c
2472 '((@var{キー1} . @var{値1})
2473 (@var{キー2} . @var{値2})
2474 (@var{キー3} . @var{値3})
2478 ある連想配列がグラフィカル オブジェクト プロパティまたは
2479 @code{\paper} 変数である場合、@c
2480 その連想配列の個々のキーを、他のキーに影響を与えることなく、@c
2483 例えば、譜グループの中にある隣り合う譜間のスペースを減らすには、@c
2484 @code{StaffGrouper} グラフィカル オブジェクトの
2485 @code{staff-staff-spacing} プロパティを使用します。@c
2487 -- @code{basic-distance}, @code{minimum-distance},
2488 @code{padding}, それに @code{stretchability} --
2491 内部リファレンスの @qq{Backend} セクションでリストアップされています
2492 (@rinternals{StaffGrouper} を参照してください):
2495 '((basic-distance . 9)
2496 (minimum-distance . 7)
2498 (stretchability . 5))
2501 譜間のスペースを小さくする方法の 1 つは、@c
2502 @code{basic-distance} キーの値 (@code{9}) を
2503 @code{minimum-distance} キーの値 (@code{7}) 近くまで減らすことです。@c
2504 個々のキーを変更するには、@emph{ネストされた宣言} を使います:
2507 @lilypond[quote,verbatim]
2510 \new Staff { \clef treble c''1 }
2511 \new Staff { \clef bass c1 }
2515 \new PianoStaff \with {
2516 % this is the nested declaration
2517 \override StaffGrouper.staff-staff-spacing.basic-distance = #7
2519 \new Staff { \clef treble c''1 }
2520 \new Staff { \clef bass c1 }
2524 ネストされた宣言は、プロパティの他のキーに変更を加えることなく、@c
2525 指定されたキー (上の例では @code{basic-distance}) を更新します。
2527 今度は、譜を重ならない範囲でできる限り近づけたいとします。@c
2528 最も簡単な方法は、連想配列の 4 つのキーすべてを 0 にセットすることです。@c
2529 しかしながら、4 つのネストされた宣言を記述する必要はありません。@c
2530 1 つの宣言でプロパティを丸ごと再定義することができます:
2532 @lilypond[quote,verbatim]
2533 \new PianoStaff \with {
2534 \override StaffGrouper.staff-staff-spacing =
2535 #'((basic-distance . 0)
2536 (minimum-distance . 0)
2538 (stretchability . 0))
2540 \new Staff { \clef treble c''1 }
2541 \new Staff { \clef bass c1 }
2545 連想配列の再定義でリストアップされなかったキーは、@c
2546 @emph{セットされなかった場合のデフォルト値} にリセットされます。@c
2547 @code{staff-staff-spacing} の場合、@c
2548 セットされなかったキーは 0 にリセットされます
2549 (@code{stretchability} は例外で、セットされなかった場合、@c
2550 @code{basic-distance} にリセットされます)。@c
2551 このため、以下の 2 つの宣言は等価です:
2554 \override StaffGrouper.staff-staff-spacing =
2555 #'((basic-distance . 7))
2557 \override StaffGrouper.staff-staff-spacing =
2558 #'((basic-distance . 7)
2559 (minimum-distance . 0)
2561 (stretchability . 7))
2564 連想配列の再定義でリストアップされなかったキーがあることにより、@c
2566 入力ファイルがコンパイルされるときに読み込まれた@c
2567 標準設定が (意図せずに) 削除される可能性があります。@c
2568 上の例では、@code{padding} と @code{minimum-distance} の標準設定
2569 (@file{scm/define-grobs.scm} で定義されます) は、@c
2570 @emph{セットされなかった場合のデフォルト値} (両方とも 0) にリセットされます。@c
2571 プロパティや (任意のサイズ) 連想配列を定義した場合、@c
2572 セットされなかったキー値はすべて @emph{セットされなかった場合のデフォルト値}
2574 そうすることを意図しているのでない限り、@c
2575 ネストされた宣言を用いてキー値を個々に更新する方が安全です。
2577 @warning{ネストされた宣言は、コンテキスト プロパティ連想配列
2578 (@code{beamExceptions}, @code{keySignature}, @code{timeSignatureSettings} 等)
2581 連想配列として丸ごと再定義するしかありません。}
2584 @node 役に立つコンセプトとプロパティ
2585 @section 役に立つコンセプトとプロパティ
2586 @translationof Useful concepts and properties
2602 @translationof Input modes
2604 入力ファイルの中に保持されている記譜を解釈する方法は、@c
2605 カレントの入力モードによって決定されます。
2609 このモードは @code{\chordmode} コマンドで有効になり、@c
2610 入力はコード記譜法の構文で解釈されるようになります。@c
2611 @ref{Chord notation} を参照してください。@c
2612 コードは、譜面上に音符として描画されます。
2614 和音モードは @code{\chords} コマンドでも有効になります。@c
2615 このコマンドは新たに @code{ChordNames} コンテキストも作成します。@c
2616 入力はコード記譜法の構文で解釈され、@c
2617 さらに @code{ChordNames} コンテキストの中にコード ネームとして描画されます。@c
2618 @ref{Printing chord names} を参照してください。
2622 このモードは @code{\drummode} コマンドで有効になり、@c
2623 入力はドラム記譜法の構文で解釈されるようになります。@c
2624 @ref{Basic percussion notation} を参照してください。
2626 また、ドラム モードは @code{\drums} コマンドでも有効になります。@c
2627 このモードも新たに @code{DrumStaff} コンテキストを作成し、@c
2628 コマンドの後に続く入力をドラム記譜法の構文で解釈して、@c
2629 ドラム譜上にドラム記号として描画します。@c
2630 @ref{Basic percussion notation} を参照してください。
2634 このモードは @code{\figuremode} コマンドで有効になり、@c
2635 入力は通奏低音の構文で解釈されるようになります。@c
2636 @ref{Entering figured bass} を参照してください。
2638 また、音型モードは @code{\figures} コマンドでも有効になります。@c
2639 このモードも新たに @code{FiguredBass} コンテキストを作成し、@c
2640 コマンドの後に続く入力を通奏低音の構文で解釈して、@c
2641 @code{FiguredBass} コンテキストの中に通奏低音記号として描画します。@c
2642 @ref{Introduction to figured bass} を参照してください。
2644 @strong{フレットとタブ モード}
2646 フレット記号とタブ記号を入力するための特別な入力モードはありません。
2648 タブ図を作成するには、音符モードで音符や和音を入力して、@c
2649 それらを @code{TabStaff} コンテキストの中に描画します。@c
2650 @ref{Default tablatures} を参照してください。
2652 譜の上にフレット図を作成するには、2 つの方法があります。@c
2653 @code{FretBoards} コンテキスト
2654 (@ref{Automatic fret diagrams} を参照してください) を用いるか、@c
2655 あるいは、音符の上に @code{\fret-diagram} コマンド
2656 (@ref{Fret diagram markups}) を用いてフレット図をマークアップとして@c
2661 このモードは @code{\lyricmode} コマンドで有効になり、@c
2662 入力はオプションで演奏時間を持つ歌詞音節として解釈され、@c
2664 通奏低音の構文で解釈されるようになります。@c
2665 @ref{Vocal music} を参照してください。
2667 また、歌詞モードは @code{\addlyrics} コマンドでも有効になります。@c
2668 このモードも新たに @code{Lyrics} コンテキストを作成し、@c
2669 暗黙的に @code{lyricsto} コマンドを作成します。@c
2670 @code{lyricsto} は、後に続く歌詞を、前にある音楽に関連付けします。
2674 このモードは @code{\markup} コマンドで有効になり、@c
2675 入力はマークアップの構文で解釈されるようになります。@c
2676 @ref{Text markup commands} を参照してください。
2678 @c silly work-around for texinfo broken-ness
2679 @c (@strong{Note...} causes a spurious cross-reference in Info)
2682 このモードはデフォルトのモードであり、@c
2683 @code{\notemode} コマンドで有効にすることもできます。@c
2684 入力はピッチ、演奏時間、マークアップなどとして解釈され、@c
2687 通常、音符モードを明示的に指定する必要はありません。@c
2689 -- 例えば、歌詞モード、和音モード、あるいは他のモードを使っていて、@c
2690 音符モードの構文でしか入力できないものを入力しようとしている場合 --
2691 では、音符モードを明示的に指定することが有用な場合があります。
2693 例えば、合唱曲で節ごとに強弱記号を指定するには、@c
2694 音符モードで入力して記号を解釈させる必要があります:
2696 @lilypond[verbatim,relative=2,quote]
2699 \notemode{\set stanza = \markup{ \dynamic f 1. } }
2703 \notemode{\set stanza = \markup{ \dynamic p 2. } }
2711 @translationof Direction and placement
2713 楽譜を写植しているとき、多くの要素の向きと配置には選択の余地があります。@c
2714 例えば、音符の符幹は上向きあるいは下向きにすることができ、@c
2715 歌詞、強弱記号、他の表現記号は譜の上あるいは下に配置することができ、@c
2716 テキストは左揃え、右揃え、あるいは中央揃えにすることができる、などです。@c
2717 これらの選択のほとんどは LilyPond によって自動的に決定されますが、@c
2718 強制的に向きや配置を指定することが望ましい場合もあります。
2721 * アーティキュレーションの方向指示子::
2725 @node アーティキュレーションの方向指示子
2726 @unnumberedsubsubsec アーティキュレーションの方向指示子
2727 @translationof Articulation direction indicators
2729 デフォルトでは、アーティキュレーションのいくつかの向きは常に上または下に@c
2730 なっています (例えば、強弱記号やフェルマータ)。@c
2731 一方、他のアーティキュレーションは、符幹の向きによって、@c
2732 向きが上下します (スラーやアクセントなど)。
2734 @c TODO Add table showing these
2736 アーティキュレーションの前に @emph{方向指示子} を置くことで、@c
2737 デフォルトの向きをオーバライドすることができます。@c
2738 3 つの方向指示子があります: @code{^} (@qq{上向き} を意味します)、@c
2739 @code{_} (@qq{下向き} を意味します)、@c
2740 それに @code{-} (@qq{デフォルトの向き} を意味します) です。@c
2741 通常、方向指示子は省略することができ、その場合は @code{-} と見なされます。@c
2742 しかしながら、以下のものの前には @strong{常に} 方向指示子を置く必要があります:
2745 @item @code{\tweak} コマンド
2746 @item @code{\markup} コマンド
2747 @item @code{\tag} コマンド
2748 @item 文字列マークアップ。例えば、-"string"
2749 @item 運指指示。例えば、@code{-1}
2750 @item アーティキュレーションの短縮記法。例えば、@code{-.}, @code{->}, @code{--}
2753 方向指示子は、その後にくる音符だけに効果を持ちます:
2755 @lilypond[verbatim,quote,relative=2]
2763 @unnumberedsubsubsec 方向プロパティ
2764 @translationof The direction property
2766 多くのレイアウト オブジェクトの位置や向きは、@c
2767 @code{direction} プロパティによって制御されます。
2769 @code{direction} プロパティの値は、@c
2770 @code{1} (@qq{上向き} あるいは @qq{上} を意味します)、@c
2771 @code{-1} (@qq{下向き} あるいは @qq{下} を意味します)
2773 記号 @code{UP} と @code{DOWN} は、@c
2774 それぞれ @code{1} と @code{-1} の代わりに用いることができます。@c
2776 @code{direction} を @code{0} あるいは @code{CENTER} にセットします。@c
2778 多くの場合で、向きを指定するための前置コマンドが存在しています。@c
2779 それらはすべて以下のような形式をとります:
2782 @code{\xxxUp}, @code{xxxDown}, @code{xxxNeutral}
2785 ここで、@code{xxxNeutral} は @qq{デフォルトの向きを使用する}
2787 @rlearning{譜内部オブジェクト} を参照してください。
2790 -- 一般的な例としてはアルペジオしかありません --
2791 @code{direction} プロパティの値は、@c
2792 オブジェクトが親オブジェクトの左右どちらに配置されるかを指定します。
2793 この場合、@code{-1} あるいは @code{LEFT} は @qq{左側} を意味し、@c
2794 @code{1} あるいは @code{RIGHT} は @qq{右側} を意味します。@c
2795 @code{0} あるいは @code{CENTER} は、前のケースと同様に、@c
2796 @qq{デフォルトの向きを使用する} ことを意味します。
2799 These all have side-axis set to #X
2800 AmbitusAccidental - direction has no effect
2802 StanzaNumber - not tried
2803 TrillPitchAccidental - not tried
2804 TrillPitchGroup - not tried
2807 これらの指示子は、キャンセルされるまで効果を持ちます。
2809 @lilypond[verbatim,quote,relative=2]
2818 多声の音楽では、一般的にオブジェクトの向きを変えるよりも明示的に
2819 @code{voice} を指定した方が良いです。@c
2820 更なる情報は、@ref{Multiple voices} を参照してください。
2824 @rlearning{Within-staff objects}
2827 @ref{Multiple voices}
2831 @subsection 距離と距離の単位
2832 @translationof Distances and measurements
2834 @cindex distances, absolute (絶対距離)
2835 @cindex distances, scaled (相対距離)
2842 LilyPond における距離には 2 つのタイプがあります: 絶対距離と相対距離です。
2844 絶対距離は、マージン、インデント、それにその他の詳細なページ レイアウトを@c
2845 指定するために使用され、デフォルトではミリメートルで指定されます。
2846 距離は以下の単位で指定することもできます: @code{\mm}, @code{\cm},
2847 @code{\inch} (インチ), それに @code{\pt} (ポイント。1/73.27 インチ) です。@c
2848 また、ページ レイアウトにおける距離は、@c
2849 値の後ろに @code{\staff-space} を付けることにより、
2850 比率で指定することもできます (次の段落を参照してください)。@c
2851 ページ レイアウトについての詳細は、@c
2852 @ref{Page layout} に記述されています。
2854 相対距離は常に譜スペースを単位として指定されます
2855 -- 稀に、半譜スペースが使用されます。@c
2856 譜スペースは隣り合う 2 本の譜線間の距離です。@c
2857 グローバル譜サイズを設定することにより、@c
2858 デフォルト値をグローバルに変更することができます。@c
2859 また、@code{StaffSymbol} の @code{staff-space} プロパティを@c
2860 変更することにより、譜スペースをローカルにオーバライドすることもできます。@c
2861 相対距離は、グローバル譜サイズや @code{StaffSymbol} の @code{staff-space}
2862 プロパティのいずれかが変更されると、自動的に変更されます。@c
2863 しかしながら、フォントの比率はグローバル譜サイズが変更された場合にのみ、@c
2866 容易に描画される楽譜全体のサイズを変更することができます。@c
2867 グローバル譜サイズを設定するための手段については、@c
2868 @ref{譜サイズを設定する} を参照してください。
2872 楽譜のある部分だけの比率を変更したいのなら
2873 -- 例えば、オッシア セクションや脚注で --
2874 単純にグローバル譜サイズを変更するわけにはいきません。@c
2875 なぜなら、グローバル譜サイズを変更すると、楽譜全体が影響を受けるからです。@c
2876 そのような場合、@code{StaffSymbol} の @code{staff-space} プロパティと@c
2877 フォントのサイズをオーバライドすることにより、サイズを変更します。@c
2878 フォント サイズの変更を @code{staff-space} 単位の変更に変換するには、@c
2879 Scheme 関数 @code{magstep} を使用することができます。@c
2881 @rlearning{オブジェクトの長さと太さ} を参照してください。
2885 @rlearning{オブジェクトの長さと太さ}
2893 @subsection 譜記号プロパティ
2894 @translationof Staff symbol properties
2896 @cindex adjusting staff symbol (譜記号を調節する)
2897 @cindex drawing staff symbol (譜記号を描画する)
2898 @cindex staff symbol, setting of (譜記号の設定)
2900 @c TODO Extend or remove this section. See also NR 1.6.2 Staff symbol
2901 @c Need to think of uses for these properties. Eg 'line-positions
2902 @c is used in a snippet to thicken centre line.
2903 @c If retained, add @ref to here in 1.6.2 -td
2905 譜線の垂直位置と譜線の本数を同時に定義することができます。@c
2906 以下の例が示すように、音符の位置は譜線の位置には影響されません。
2908 @warning{@code{'line-positions} プロパティは @code{'line-count} を@c
2910 譜線の本数は、@code{'line-positions} の値リストの中にある要素数によって、@c
2913 @lilypond[verbatim,quote,relative=1]
2915 \override StaffSymbol.line-positions = #'(7 3 0 -4 -6 -7)
2922 譜内部のオブジェクトのスペースは、この設定によって影響を受けません。
2924 @lilypond[verbatim,quote,relative=1]
2926 \override StaffSymbol.width = #23
2934 @translationof Spanners
2936 多くの音楽記譜オブジェクトは、複数の音符あるいは複数の小節にまたがって、@c
2938 例としては、スラー、連桁、連譜の囲み、volta 繰り返しの囲み、クレッシェンド、@c
2939 トリル、それにグリッサンドがあります。@c
2940 そのようなオブジェクトは総称して @qq{スパナ} と呼ばれ、@c
2941 それらの見た目と振る舞いを制御するための特殊なプロパティを持ちます。@c
2942 これらのプロパティのいくつかは、すべてのスパナに共通しています。@c
2943 他のプロパティはスパナの部分集合に限定されています。
2945 すべてのスパナは @code{spanner-interface} をサポートします。@c
2946 いくつかのスパナ -- 2 つのオブジェクトの間に直線を描くもの -- は、さらに、@c
2947 @code{line-spanner-interface} をサポートします。
2950 * spanner-interface を使用する::
2951 * line-spanner-interface を使用する::
2954 @node spanner-interface を使用する
2955 @unnumberedsubsubsec @code{spanner-interface} を使用する
2956 @translationof Using the spanner-interface
2959 いくつかのスパナに適用される 2 つのプロパティを提供します。
2961 @subsubsubheading The @code{minimum-length} プロパティ
2963 スパナの最短の長さは、@code{minimum-length} プロパティによって指定されます。@c
2964 通常、このプロパティを増加させると、@c
2965 スパナの両端の間にある音符の間隔は増加します。@c
2966 しかしながら、このオーバライドは多くのスパナで効果を持ちません。@c
2967 なぜなら、それらの長さは他の要素によって決定されるからです。@c
2968 以下に効果を持つ例を 2, 3 示します。
2978 Works as long as callback is made:
2982 Works not at all for:
2992 @lilypond[verbatim,quote,relative=2]
2996 -\tweak minimum-length #5
3001 @lilypond[verbatim,quote,relative=2]
3003 \compressFullBarRests
3006 \once \override MultiMeasureRest.minimum-length = #20
3012 @lilypond[verbatim,quote,relative=2]
3015 \override Hairpin.minimum-length = #20
3019 さらに、このオーバライドはスラーとフレージング スラーの長さを@c
3022 @lilypond[verbatim,quote,relative=2]
3025 -\tweak minimum-length #5
3030 -\tweak minimum-length #5
3034 いくつかのレイアウト オブジェクトでは、@c
3035 @code{minimum-length} プロパティは、@c
3036 @code{set-spacing-rods} プロシージャが明示的に呼び出された場合にのみ@c
3038 このプロシージャを呼び出すには、@code{springs-and-rods} プロパティに@c
3039 @code{ly:spanner::set-spacing-rods} をセットしておく必要があります。@c
3041 @code{springs-and-rods} プロパティが設定されていない限り、@c
3045 @lilypond[verbatim,quote,relative=1]
3050 \once \override Glissando.minimum-length = #20
3053 % 以下の両方のオーバライドが存在する場合にのみ、効果を持ちます
3054 \once \override Glissando.minimum-length = #20
3055 \once \override Glissando.springs-and-rods = #ly:spanner::set-spacing-rods
3059 @code{Beam} オブジェクトでも同じことが言えます:
3062 @lilypond[verbatim,quote,relative=1]
3064 \once \override Beam.minimum-length = #20
3067 % 以下の両方のオーバライドが存在する場合にのみ、効果を持ちます
3068 \once \override Beam.minimum-length = #20
3069 \once \override Beam.springs-and-rods = #ly:spanner::set-spacing-rods
3073 @subsubsubheading The @code{to-barline} プロパティ
3075 @code{spanner-interface} の 2 番目に有用なプロパティは
3076 @code{to-barline} です。@c
3077 デフォルトではこのプロパティは真であり、@c
3078 小節の最初の音符のところで終了するヘアピンや他のスパナは@c
3079 直前の小節線のところで終了させられます。@c
3080 偽に設定すると、スパナは小節線を越えて、音符のところで終了します:
3082 @lilypond[verbatim,quote,relative=2]
3083 a \< a a a a \! a a a \break
3084 \override Hairpin.to-barline = ##f
3085 a \< a a a a \! a a a
3088 このプロパティはすべてのスパナに対して効果を持つわけではありません。@c
3089 例えば、スラーやフレージング スラー、@c
3090 あるいは小節線で終了させることに意味が無い他のスパナに対して、@c
3091 このプロパティを @code{#t} に設定しても効果がありません。
3093 @node line-spanner-interface を使用する
3094 @unnumberedsubsubsec @code{line-spanner-interface} を使用する
3095 @translationof Using the line-spanner-interface
3097 @code{line-spanner-interface} をサポートするオブジェクトには@c
3101 @item @code{DynamicTextSpanner}
3102 @item @code{Glissando}
3103 @item @code{TextSpanner}
3104 @item @code{TrillSpanner}
3105 @item @code{VoiceFollower}
3108 これらのスパナのステンシルを描画する責任を持つルーチンは
3109 @code{ly:line-interface::print} です。@c
3110 このルーチンはスパナの両端の位置を綿密に決定し、@c
3111 求めに応じたスタイルでそれらの間に線を描きます@c
3112 スパナの両端の位置はオンザフライ (その場、その時々) で算出されますが、@c
3113 それらの Y 座標をオーバライドすることができます。@c
3115 プロパティ階層内で 2 階層下にネストされていますが、@c
3116 この @code{\override} コマンドは非常にシンプルです:
3118 @lilypond[relative=2,quote,verbatim]
3120 \once \override Glissando.bound-details.left.Y = #3
3121 \once \override Glissando.bound-details.right.Y = #-2
3125 @code{Y} プロパティの単位は @code{staff-space} であり、@c
3127 グリッサンドでは、スパナの両端は各符頭の中心であり、@c
3128 @code{Y} はそれらの点を上下させます。
3130 @code{Y} が設定されていない場合、@c
3131 値はスパナの両端の垂直位置から算出されます。
3133 改行の場合、終点の @code{Y} の値は @code{bound-details} の@c
3134 部分リスト @code{left-broken} や @code{right-broken} のによって指定されます。@c
3137 @lilypond[relative=2,ragged-right,verbatim,fragment]
3138 \override Glissando.breakable = ##t
3139 \override Glissando.bound-details.right-broken.Y = #-3
3140 c1 \glissando \break
3145 @code{bound-details} プロパティの部分リスト @code{left} や @code{right} の@c
3146 下位プロパティのいくつかは、@code{Y} と同じ方法で変更することができます:
3151 譜の中央線からの @code{staff-space} オフセットで、設定します。@c
3152 デフォルトでは、終点オブジェクトの中心です。@c
3153 ですから、グリッサンドは符頭の中心に向かって進みます。
3155 水平方向に広がるスパナ -- テキスト スパナやトリル スパナなど --
3156 では、この値は 0 に固定されています。
3159 スパナのラインがオブジェクトの左右どちらから始まり、終わるのかを決定します。@c
3160 @code{-1} (あるいは @code{LEFT}) であれば、@c
3161 ラインは符頭の左側から開始あるいは終了します。
3165 通常、オンザフライ (その場、その時々) で算出され、@c
3166 これをオーバライドしてもあまり意味がありません。
3169 ライン スパナは開始点や終了点で記号を持つ場合があり、@c
3170 その記号はこのサブ プロパティに保持されています。@c
3171 このサブ プロパティは内部で使用するためのものです。@c
3172 このサブ プロパティの代わりに @code{text} を使用することを推奨します。
3175 ステンシルを作成するために評価されるマークアップです。@c
3176 水平スパナに @i{cresc.}, @i{tr} それに他のテキストを配置するために使用されます。
3178 @lilypond[quote,ragged-right,fragment,relative=2,verbatim]
3179 \override TextSpanner.bound-details.left.text
3180 = \markup { \small \bold Slower }
3181 c2\startTextSpan b c a\stopTextSpan
3184 @item stencil-align-dir-y
3185 @item stencil-offset
3187 ステンシルは、@code{X} と @code{Y} サブ プロパティで定義されたとおりに、@c
3188 ラインに中央揃えで、終点に配置されます。@c
3189 @code{stencil-align-dir-y} あるいは @code{stencil-offset} の@c
3193 @lilypond[relative=1,fragment,verbatim]
3194 \override TextSpanner.bound-details.left.stencil-align-dir-y = #-2
3195 \override TextSpanner.bound-details.right.stencil-align-dir-y = #UP
3197 \override TextSpanner.bound-details.left.text = #"ggg"
3198 \override TextSpanner.bound-details.right.text = #"hhh"
3199 c4^\startTextSpan c c c \stopTextSpan
3203 負の値はテキストを @emph{上げる} ということに注意してください。@c
3204 なぜなら、@code{-1} あるいは @code{DOWN} は@c
3205 テキストの @emph{下端} をスパナ ラインに揃え、
3206 @code{1} あるいは @code{UP} は@c
3207 テキストの @emph{上端} をスパナ ラインに揃えるからです。
3210 このサブ プロパティに @code{#t} をセットするとラインの終点に矢印が描かれます。
3213 このサブ プロパティはラインの終点と実際の終点の間のスペースを制御します。@c
3214 パディングがなければ、グリッサンドは両端の符頭の中心から描かれます。
3218 音楽関数 @code{\endSpanners} は@c
3219 直後の音符から始まるスパナをすぐに終了させます。@c
3220 ちょうど 1 音符分でスパナを終了させますが、@c
3221 @code{to-barline} が真で、かつ、次の音符の前に小節線がある場合は@c
3222 その小節線のところでスパナを終了させます。
3224 @lilypond[verbatim,quote,ragged-right,relative=2,fragment]
3226 c2 \startTextSpan c2 c2
3231 @code{\endSpanners} を使用している場合、@c
3232 @code{\startTextSpan} を @code{\endTextSpan} で閉じる必要はなく、@c
3233 ヘアピンを @code{\!} で閉じる必要もありません。
3237 @rinternals{TextSpanner},
3238 @rinternals{Glissando},
3239 @rinternals{VoiceFollower},
3240 @rinternals{TrillSpanner},
3241 @rinternals{line-spanner-interface}
3245 @subsection オブジェクトの可視性
3246 @translationof Visibility of objects
3248 @cindex objects, visibility of (オブジェクトの可視性)
3249 @cindex grobs, visibility of (グラフィカル オブジェクトの可視性)
3250 @cindex visibility of objects (オブジェクトの可視性)
3252 レイアウト オブジェクトの可視性を制御する主な方法は 4 つあります:
3253 オブジェクトのステンシルを削除する方法、オブジェクトを透明にする方法、@c
3254 オブジェクトの色を白にする方法、あるいは、@c
3255 オブジェクトの @code{break-visibility} プロパティをオーバライドする方法です。
3256 最初の 3 つの方法はすべてのレイアウト オブジェクトに適用されますが、@c
3257 最後の方法はいくつかの -- @emph{改行可能な} オブジェクト --
3259 学習マニュアルでは、これら 4 つのテクニックについて紹介しています。@c
3260 @rlearning{オブジェクトの可視性と色} を参照してください。
3262 さらに、特定のレイアウト オブジェクト特有のテクニックがいくつかあります。@c
3263 それらについては、特別な考慮でカバーされています。
3269 * break-visibility を用いる::
3275 @unnumberedsubsubsec ステンシルを削除する
3276 @translationof Removing the stencil
3278 @cindex stencil, removing (ステンシルを削除する)
3280 レウアウト オブジェクトはそれぞれステンシル プロパティを持ちます。@c
3282 このプロパティはそのオブジェクトを描画する特殊な関数にセットされています。@c
3283 このプロパティが @code{#f} にオーバライドされた場合、@c
3284 関数は呼び出されず、そのオブジェクトは描画されません。@c
3285 @code{\rever} でデフォルトの動作に戻すことができます。
3287 @lilypond[quote,verbatim,relative=1]
3291 \undo \omit Score.BarLine
3296 @unnumberedsubsubsec オブジェクトを透明にする
3297 @translationof Making objects transparent
3299 @cindex transparent, making objects (オブジェクトを透明にする)
3301 レイアウト オブジェクトはそれぞれ @code{transparent} プロパティを持っていて、@c
3302 デフォルトでは @code{#f} にセットされています。@c
3303 @code{#t} にセットされると、そのオブジェクトはスペースを占めたままですが、@c
3306 @lilypond[quote,verbatim,relative=2]
3308 \once \hide NoteHead
3313 @unnumberedsubsubsec オブジェクトを白で描く
3314 @translationof Painting objects white
3316 @cindex objects, coloring (オブジェクトに色を付ける)
3317 @cindex coloring objects (オブジェクトに色を付ける)
3318 @cindex layers (レイヤ)
3319 @cindex printing order (描画の順番)
3320 @cindex overwriting objects (オブジェクトを上書きする)
3321 @cindex objects, overwriting (オブジェクトを上書きする)
3322 @cindex grobs, overwriting (グラフィカル オブジェクトを上書きする)
3324 レイアウト オブジェクトはそれぞれ @code{color} プロパティを持っていて、@c
3325 デフォルトでは @code{black} にセットされています。@c
3326 このプロパティが @code{white} にセットされてると、@c
3327 そのオブジェクトは白い背景と区別が付かなくなります。@c
3328 しかしながら、そのオブジェクトが他のオブジェクトと交差している場合、@c
3329 交差している場所の色はオブジェクトの描画順序によって決定されます。@c
3331 白いオブジェクトの画像が幽霊のように浮かび上がることがあります:
3333 @lilypond[quote,verbatim,relative=2]
3334 \override Staff.Clef.color = #white
3338 オブジェクトの描画順序を変更することにより、これを回避することができます。@c
3339 すべてのレイアウト オブジェクトは @code{layer} プロパティを持っており、@c
3340 このプロパティには整数がセットされています。@c
3341 より小さな値の @code{layer} を持つオブジェクトが最初に描画され、@c
3342 より大きな値の @code{layer} を持つオブジェクトが後になってから描画されます。@c
3344 より大きな値を持つオブジェクトがより小さな値を持つオブジェクトを上書きします。@c
3346 たいていのオブジェクトの @code{layer} には @code{1} が代入されています。@c
3348 -- @code{StaffSymbol} や @code{BarLine} など --
3349 には @code{0} が代入されています。@c
3350 同じ値の @code{layer} を持つオブジェクトを描画する順番は不確定です。
3353 (この @code{layer} のデフォルト値は @code{1} です)
3355 (この @code{layer} のデフォルト値は @code{0} です)
3357 そのため、音部記号は譜線を上書きしています。@c
3358 これを変更するには、@code{Clef} オブジェクトの @code{layer} に@c
3359 より小さな値 -- 例えば、@code{-1} -- を与えて、@c
3360 音部記号を先に描画させる必要があります:
3362 @lilypond[quote,verbatim,relative=2]
3363 \override Staff.Clef.color = #white
3364 \override Staff.Clef.layer = #-1
3368 @node break-visibility を用いる
3369 @unnumberedsubsubsec break-visibility を用いる
3370 @translationof Using break-visibility
3372 @c TODO Add making other objects breakable
3374 @cindex break-visibility
3376 たいていのレイアウト オブジェクトは 1 回だけ描画されます。@c
3377 しかしながら、小節線、音部記号、拍子記号、それに調号などのオブジェクトは、@c
3378 改行が起こると 2 回描画する必要があります
3379 -- 行の最後で 1 回、次の行の最初でもう 1 回。@c
3380 そのようなオブジェクトは @emph{改行可能} と呼ばれ、@c
3381 それらのオブジェクトが描画される可能性がある 3 つの場所
3382 -- 行の先頭、行の途中 (それらが変更された場合)、@c
3383 それに、行の最後 (そこで変更が行われた場合) --
3384 における可視性を制御する @code{break-visibility} プロパティを持ちます。
3386 例えば、デフォルトでは拍子記号は最初の行の先頭で描画されますが、@c
3387 変更されない限り他の場所には描画されません。@c
3388 変更された場合、拍子記号は変更が行われた場所に描画されます。@c
3389 この変更が行の最後で行われた場合、新しい拍子記号は次の行の先頭に描画され、@c
3390 その前の行の最後にも忠告の拍子記号が描画されます。
3392 この振る舞いは @code{break-visibility} プロパティによって制御されます。@c
3394 @c Leave this ref on a newline - formats incorrectly otherwise -td
3395 @rlearning{オブジェクトの可視性と色}
3397 このプロパティは 3 つのブール値からなるベクトルをとり、@c
3398 順に、そのオブジェクトが行の最後で描画されるかどうか、@c
3400 そして、行の先頭で描画されるかどうかを決定します。@c
3401 より正確には、改行の前、改行がない場合、改行の後です。
3403 @code{break-visibility} プロパティによって制御する代わりに、@c
3404 これら 8 通りの組み合わせを @file{scm/output-lib.scm} で定義されている@c
3405 定義済み関数によって指定することもできます。@c
3406 このファイルの中で、最後の 3 列がその列のヘッダで示される場所での@c
3409 @multitable {@code{begin-of-line-invisible}} {@code{'#(#t #t #t)}} {改行前} {改行なし} {改行後}
3410 @headitem 関数形式 @tab ベクトル形式 @tab 改行前 @tab 改行なし @tab 改行後
3412 @item @code{all-visible} @tab @code{'#(#t #t #t)} @tab yes @tab yes @tab yes
3413 @item @code{begin-of-line-visible} @tab @code{'#(#f #f #t)} @tab no @tab no @tab yes
3414 @item @code{center-visible} @tab @code{'#(#f #t #f)} @tab no @tab yes @tab no
3415 @item @code{end-of-line-visible} @tab @code{'#(#t #f #f)} @tab yes @tab no @tab no
3416 @item @code{begin-of-line-invisible} @tab @code{'#(#t #t #f)} @tab yes @tab yes @tab no
3417 @item @code{center-invisible} @tab @code{'#(#t #f #t)} @tab yes @tab no @tab yes
3418 @item @code{end-of-line-invisible} @tab @code{'#(#f #t #t)} @tab no @tab yes @tab yes
3419 @item @code{all-invisible} @tab @code{'#(#f #f #f)} @tab no @tab no @tab no
3422 @code{break-visibility} のデフォルト設定は@c
3423 レイアウト オブジェクトによって異なります。@c
3424 以下の表は、@code{break-visibility} によって影響をうける@c
3425 すべてのレイアウト オブジェクトと、そのプロパティのデフォルト設定を示しています:
3427 @multitable @columnfractions .3 .3 .4
3429 @headitem レイアウト オブジェクト @tab 通常のコンテキスト @tab デフォルト設定
3431 @c omit Ambitus as it appears not to be affected by break-visibility -td
3432 @c @item @code{Ambitus} @tab as specified @tab @code{begin-of-line-visible}
3433 @item @code{BarLine} @tab @code{Score} @tab calculated
3434 @item @code{BarNumber} @tab @code{Score} @tab @code{begin-of-line-visible}
3435 @c omit the following item until it can be explained -td
3436 @c @item @code{BreakAlignGroup} @tab @code{Score} @tab calculated
3437 @item @code{BreathingSign} @tab @code{Voice} @tab @code{begin-of-line-invisible}
3438 @item @code{Clef} @tab @code{Staff} @tab @code{begin-of-line-visible}
3439 @item @code{Custos} @tab @code{Staff} @tab @code{end-of-line-visible}
3440 @item @code{DoublePercentRepeat} @tab @code{Voice} @tab @code{begin-of-line-invisible}
3441 @item @code{KeyCancellation} @tab @code{Staff} @tab @code{begin-of-line-invisible}
3442 @item @code{KeySignature} @tab @code{Staff} @tab @code{begin-of-line-visible}
3443 @c omit LeftEdge until it can be explained -td
3444 @c @item @code{LeftEdge} @tab @code{Score} @tab @code{center-invisible}
3445 @item @code{ClefModifier} @tab @code{Staff} @tab @code{begin-of-line-visible}
3446 @item @code{RehearsalMark} @tab @code{Score} @tab @code{end-of-line-invisible}
3447 @item @code{TimeSignature} @tab @code{Staff} @tab @code{all-visible}
3451 以下の例は、小節線の可視性を制御するベクトルの使用方法を示しています:
3454 @lilypond[quote,verbatim,relative=1,ragged-right]
3457 % カレント行の最後で小節線を削除します
3458 \once \override Score.BarLine.break-visibility = #'#(#f #t #t)
3464 @code{break-visibility} をオーバライドするために使用される@c
3465 ベクトルの要素 3 つをすべて記述する必要がありますが、@c
3466 それらすべてが各レイアウト オブジェクトに対して効果を持つわけではなく、@c
3467 組み合わせによってはエラーになる場合もあります。@c
3471 @item 小節線を行の先頭に描画することはできません。
3472 @item 小節番号は 1 から始まるのでなければ、@c
3473 最初の行の先頭に描画することはできません。
3474 @item 音部記号 -- 以下を参照してください
3475 @item 2 重線のパーセント繰り返しはすべて描画するか、@c
3477 描画するには @code{begin-of-line-invisible} を用い、@c
3478 描画しないのなら @code{all-invisible} を用います。
3479 @item Key signature -- 以下を参照してください
3480 @item ClefModifier -- 以下を参照してください
3484 @unnumberedsubsubsec 特別な考慮を必要とするもの
3485 @translationof Special considerations
3487 @subsubsubheading 明示的な変更の後の可視性
3489 @cindex key signature, visibility following explicit change (明示的な変更の後の調号の可視性)
3490 @cindex explicitKeySignatureVisibility
3491 @cindex clef, visibility following explicit change (明示的な変更の後の音部記号の可視性)
3492 @cindex explicitClefVisibility
3494 @code{break-visibility} プロパティが調号の可視性と音部記号の変更を@c
3495 制御するのは、行の先頭 -- つまり、改行の後 -- においてだけです。@c
3496 行の途中や終わりでの明示的な調の変更や音部記号の変更の後に出現する@c
3497 調号や音部記号の可視性には効果を持ちません。@c
3498 以下の例では、@code{all-invisible} がセットされていますが、@c
3499 B フラット メジャーへの明示的な変更の後に出現する調号は可視のままです。
3502 @lilypond[quote,verbatim,relative=1,ragged-right]
3506 \override Staff.KeySignature.break-visibility = #all-invisible
3514 そのような明示的な調号や音部記号の変更の可視性は
3515 @code{explicitKeySignatureVisibility} プロパティや
3516 @code{explicitClefVisibility} プロパティによって制御されます。@c
3517 これらは @code{break-visibility} プロパティと等価であり、@c
3518 どちらも @code{break-visibility} と同様に 3 つのブール値からなるベクトルか@c
3519 上でリストアップした定義済み関数をとります。@c
3520 どちらも @code{Staff} コンテキストのプロパティであり、@c
3521 レイアウト オブジェクト自体のプロパティではありません。@c
3522 ですから、これらは @code{\set} コマンドでセットします。@c
3523 どちらもデフォルトでは @code{all-visible} がセットされています。@c
3524 これらのプロパティは明示的な変更の結果として生じる@c
3525 調号と音部記号の可視性だけを制御し、@c
3526 行の先頭での調号や音部記号には効果を持ちませんので、@c
3527 オブジェクトを削除するには適切な @code{break-visibility}
3530 @lilypond[quote,verbatim,relative=1,ragged-right]
3533 \set Staff.explicitKeySignatureVisibility = #all-invisible
3534 \override Staff.KeySignature.break-visibility = #all-invisible
3541 @subsubsubheading 前の調をキャンセルする臨時記号の可視性
3543 明示的な調の変更で描画される前の調をキャンセルする臨時記号を削除するには、@c
3544 @code{Staff} コンテキスト プロパティ @code{printKeyCancellation} に
3547 @lilypond[quote,verbatim,relative=1,ragged-right]
3550 \set Staff.explicitKeySignatureVisibility = #all-invisible
3551 \set Staff.printKeyCancellation = ##f
3552 \override Staff.KeySignature.break-visibility = #all-invisible
3559 このオーバライドによって、調の変更を示す臨時記号だけが残ります。
3561 調を C@tie{}メジャーや A@tie{}マイナーに変更する時、前の調をキャンセル@c
3562 する臨時記号は前の調のキャンセルしている @emph{だけ} であることに@c
3564 そのようなケースでは、@code{printKeyCancellation} を @code{#f} に@c
3567 @lilypond[quote,verbatim,relative=1,ragged-right]
3570 \set Staff.explicitKeySignatureVisibility = #all-invisible
3571 \set Staff.printKeyCancellation = ##f
3578 調を C@tie{}メジャーや A@tie{}マイナーに変更する場合に、@c
3579 前の調をキャンセルする臨時記号を消すには、@code{KeyCancellation}
3580 グラフィカル オブジェクトの可視性をオーバライドします:
3582 @lilypond[quote,verbatim,relative=1,ragged-right]
3585 \set Staff.explicitKeySignatureVisibility = #all-invisible
3586 \override Staff.KeyCancellation.break-visibility = #all-invisible
3593 @c TODO Add visibility of cautionary accidentals before notes
3595 @subsubsubheading 自動小節線
3597 @cindex automaticBars
3598 @cindex bar lines, suppressing (小節線を消す)
3601 @code{Score} コンテキストの @code{automaticBars} プロパティを@c
3602 設定することにより、小節線の描画を Off にすることもできます。@c
3603 @code{#f} をセットされた場合、小節線は自動的には描画されなくなり、@c
3604 @code{\bar} コマンドで明示的に作成しなければならなくなります。@c
3605 定義済みコマンド @code{\cadenzaOn} とは異なり、小節数はカウントされ続けます。@c
3606 後になってこのプロパティに @code{#t} がセットされると、@c
3607 このカウントに従って小節線の生成が再開されます。@c
3608 @code{#f} がセットされている場合、@c
3609 改行が起こりえるのは明示的な @code{\bar} コマンドがある場所でだけになります。
3613 @subsubsubheading オクターブ移調付きの音部記号
3615 @cindex transposed clefs, visibility of (オクターブ移調付きの音部記号の可視性)
3616 @cindex visibility of transposed clefs (オクターブ移調付きの音部記号の可視性)
3617 @cindex clefs, visibility of transposition (オクターブ移調付きの音部記号の可視性)
3619 オクターブ移調付きの音部記号上の小さなオクターブ記号は
3620 @code{ClefModifier} レイアウト オブジェクトによって作り出されます。@c
3622 @code{Clef} オブジェクトの可視性とは独立して制御されます。@c
3623 そのため、各行の先頭においてそのような音部記号を完全に消そうとするなら、@c
3624 @code{Clef} オブジェクトと @code{ClefModifier} オブジェクトの両方に対して@c
3625 必要な @code{break-visibility} のオーバライドを行う必要があります。
3628 @code{explicitClefVisibility} プロパティが@c
3629 音部記号とそれに関連するオクターブ記号の両方を制御します。
3633 @rlearning{オブジェクトの可視性と色}
3637 @subsection ライン スタイル
3638 @translationof Line styles
3641 -- 例えば、@i{rallentando}, @i{accelerando} それに @i{trills} など --
3643 線で (点線や波線の場合もあります) でいくつもの小節にわたって広がります。
3645 これらはすべてグリッサンドと同じルーチンを用いてテキストと線を描きます。@c
3646 そのため、それらの振る舞いの調整も同じように行います。@c
3647 これらはスパナによって実現され、スパナを描くルーチンは
3648 @code{ly:line-interface::print} です。@c
3649 このルーチンは 2 つの @i{スパン ポイント} の位置を決定し、@c
3650 要求されたスタイルに応じてそれら 2 点の間に線を描きます。
3652 利用可能なライン スタイルと、それらをどのように調整するかを示す例を挙げます。
3654 @lilypond[relative=2,ragged-right,verbatim,fragment]
3656 \once \override Glissando.style = #'dashed-line
3658 \override Glissando.style = #'dotted-line
3660 \override Glissando.style = #'zigzag
3662 \override Glissando.style = #'trill
3666 スパナの終点の位置は各グラフィック オブジェクトごとに@c
3667 オンザフライ (その場、その時々) で計算されますが、@c
3668 それらをオーバライドすることもできます:
3671 @lilypond[relative=2,ragged-right,verbatim,quote]
3673 \once \override Glissando.bound-details.right.Y = #-2
3677 グリッサンドの終点の @code{Y} には @code{-2} がセットされています。@c
3678 @code{right} の代わりに @code{left} を指定することにより、@c
3679 始点も同じように調整することができます。
3681 @code{Y} がセットされていない場合、@c
3682 その値はスパナが取り付けられるポイントの垂直位置から算出されます。
3684 スパナに他の調整を行うことも可能です。@c
3685 詳細は @ref{スパナ} を参照してください。
3689 @subsection オブジェクトを回転させる
3690 @translationof Rotating objects
3692 レイアウト オブジェクトとマークアップ テキストの要素はどちらも@c
3693 任意のポイントを中心にして任意の角度で回転させることができます。@c
3694 しかしながら、回転させる方法はまったく異なります。
3697 * レイアウト オブジェクトを回転させる::
3701 @node レイアウト オブジェクトを回転させる
3702 @unnumberedsubsubsec レイアウト オブジェクトを回転させる
3703 @translationof Rotating layout objects
3705 @cindex rotating objects (オブジェクトを回転させる)
3706 @cindex objects, rotating (オブジェクトを回転させる)
3708 @code{grob-interface} をサポートするすべてのレイアウト オブジェクトは、@c
3709 それらのオブジェクトの @code{rotation} プロパティを設定することにより、@c
3711 これは 3 要素のリストをとります: 反時計回りの回転の角度、@c
3712 オブジェクトの参照ポイントからの相対座標 x と y
3713 (この座標が回転の中心になります) です。@c
3714 回転の角度は @q{°}で指定し、座標は譜スペースで指定します。
3716 回転の角度と回転の中心座標は、トライ&エラーで決定する必要があります。
3718 @cindex hairpins, angled (回転させられたヘアピン)
3719 @cindex angled hairpins (回転させられたヘアピン)
3721 レイアウト オブジェクトを回転させることが有用な状況はあまりありません。@c
3722 以下の例は、有用であるかもしれないシチュエーションの 1 つを示しています:
3724 @lilypond[quote,verbatim,relative=1]
3726 \override Hairpin.rotation = #'(20 -1 0)
3731 @unnumberedsubsubsec マークアップを回転させる
3732 @translationof Rotating markup
3734 すべてのマークアップ テキストは、@code{\rotate} コマンドを前に置くことにより、@c
3735 任意の角度に回転させることができます。@c
3736 このコマンドは 2 つの引数をとります: 反時計回りの回転の角度 @q{°} と、@c
3739 テキストの領域は回転させられるテキストの四隅になります。@c
3740 以下の例では、自動衝突回避を不可にするために@c
3741 テキストの @code{outside-staff-priority} プロパティに @code{#f} を@c
3743 そうしなければテキストのいくつかは高く押し上げられてしまいます。
3745 @lilypond[quote,verbatim,relative=1]
3746 \override TextScript.outside-staff-priority = ##f
3747 g4^\markup { \rotate #30 "a G" }
3748 b^\markup { \rotate #30 "a B" }
3749 des^\markup { \rotate #30 "a D-Flat" }
3750 fis^\markup { \rotate #30 "an F-Sharp" }
3756 @translationof Advanced tweaks
3759 楽譜の見た目を細かく調節するためのさまざまなアプローチについて議論します。
3763 * グラフィカル オブジェクトを垂直方向にグループ化する::
3766 * unpure-pure コンテナ::
3771 @rlearning{出力を調整する},
3779 @rextend{Interfaces for programmers}
3782 @file{scm/define-grobs.scm}
3785 @rlsr{Tweaks and overrides}
3788 @rinternals{All layout objects}
3792 @subsection オブジェクトを揃える
3793 @translationof Aligning objects
3795 @code{self-alignment-interface} と/あるいは @code{side-position-interface} を@c
3796 サポートするグラフィカル オブジェクトは、@c
3797 さまざまな形式で配置済みのオブジェクトに揃えることができます。@c
3798 そのようなオブジェクトのリストは、@rinternals{self-alignment-interface} と
3799 @rinternals{side-position-interface} を参照してください。@c
3801 すべてのグラフィカル オブジェクトは参照ポイント、水平方向の広がり、@c
3804 参照ポイントから左端と右端までの距離を意味する数値のペアであり、@c
3807 参照ポイントから下端と上端までの距離を意味する数値のペアであり、@c
3810 あるオブジェクトの譜面上の位置は、@code{X-offset} プロパティと
3811 @code{Y-offset} プロパティの値によって与えられます。@c
3812 @code{X-offset} の値は、親オブジェクトの参照ポイントの X 座標からの@c
3814 @code{Y-offset} の値は、譜の中央線からの距離を意味します。@c
3815 @code{X-offset} と @code{Y-offset} の値は直接設定されることもありますし、@c
3816 いくつかの形式で親オブジェクトと揃えるために@c
3817 プロシージャによって算出されることもあります。
3819 @c positioning considerations: 配置のための考慮 -> 配置規則
3820 @warning{多くのオブジェクトは特殊な配置規則を持っています。@c
3821 そのため、そのオブジェクトが @code{self-alignment-interface} を@c
3823 @code{X-offset} あるいは @code{Y-offset} の設定は無視されたり、@c
3826 例えば、臨時記号は @code{Y-offset} を設定することにより@c
3827 垂直方向の位置を変更することができますが、@code{X-offset} は効果を持ちません。
3829 リハーサル記号は、小節線、音部記号、拍子記号それに調号などの@c
3830 改行可能なオブジェクトに揃えることができます。@c
3831 リハーサル記号をそのようなオブジェクトに合わせて配置するために、@c
3832 @code{break-aligned-interface} の中に特別なプロパティがあります。
3836 @ref{break-alignable-interface を使用する},
3839 @rextend{Callback functions}
3842 * X-offset と Y-offset を直接設定する::
3843 * side-position-interface を使用する::
3844 * self-alignment-interface を使用する::
3845 * break-alignable-interface を使用する::
3848 @node X-offset と Y-offset を直接設定する
3849 @unnumberedsubsubsec @code{X-offset} と @code{Y-offset} を直接設定する
3850 @translationof Setting X-offset and Y-offset directly
3852 多くのオブジェクトの @code{X-offset} プロパティと @code{Y-offset} プロパティに@c
3854 以下の例は、3 つの音符を示していて、1 つはデフォルト配置の運指記号を持ち、@c
3855 他の 2 つの運指記号は @code{X-offset} と @code{Y-offset} が変更されています。
3857 @lilypond[verbatim,quote,relative=2]
3864 -\tweak X-offset #-1
3871 @node side-position-interface を使用する
3872 @unnumberedsubsubsec @code{side-position-interface} を使用する
3873 @translationof Using the @code{side-position-interface}
3875 @code{side-position-interface} をサポートするオブジェクトは、@c
3876 その親オブジェクトの隣に配置することができ、@c
3878 それら 2 つのオブジェクトの指定された端をくっつけることができます。@c
3879 オブジェクトを親オブジェクトの上、下、右、あるいは左に配置することができます。@c
3880 親オブジェクトを指定することはできません:
3881 親オブジェクトは入力ストリームの中での要素の順序によって決定されます。@c
3882 たいていのオブジェクトの親オブジェクトは、@c
3883 そのオブジェクトに関連する符頭となります。
3885 @code{side-axis} プロパティと @code{direction} プロパティの値は、@c
3886 以下のように、オブジェクトが配置される場所を決定します:
3888 @c TODO add an example of each to the table
3890 @multitable @columnfractions .3 .3 .3
3891 @headitem @code{side-axis} @tab @code{direction} @tab
3892 @headitem property @tab property @tab Placement
3894 @item @code{0} @tab @code{-1} @tab 左
3895 @item @code{0} @tab @code{1} @tab 右
3896 @item @code{1} @tab @code{-1} @tab 下
3897 @item @code{1} @tab @code{1} @tab 上
3901 @code{side-axis} が @code{0} である場合、@code{X-offset} には@c
3902 プロシージャ @code{ly:side-position-interface::x-aligned-side} を@c
3904 このプロシージャは、@code{direction} の値に基づいて@c
3905 親オブジェクトの左あるいは右にオブジェクトを配置するための適切な値を
3906 @code{X-offset} に返します。
3908 @code{side-axis} が @code{1} である場合、@code{Y-offset} には@c
3909 プロシージャ @code{ly:side-position-interface::y-aligned-side} を@c
3911 このプロシージャは、@code{direction} の値に基づいて@c
3912 親オブジェクトの上あるいは下にオブジェクトを配置するための適切な値を
3913 @code{Y-offset} に返します。
3915 @c TODO Add examples
3917 @node self-alignment-interface を使用する
3918 @unnumberedsubsubsec @code{self-alignment-interface} を使用する
3919 @translationof Using the @code{self-alignment-interface}
3921 @subsubsubheading オブジェクトを自動的に水平方向に揃える
3923 @code{self-alignment-interface} をサポートするオブジェクトの水平方向の揃えは、@c
3924 @code{self-alignment-X} プロパティの値によって制御され、@c
3925 そのオブジェクトの @code{X-offset} プロパティには@c
3927 @code{ly:self-alignment-interface::x-aligned-on-self}.
3928 @code{self-alignment-X} がセットされます。@c
3929 与える実数値は、そのオブジェクトの X 方向の広がりの半分を単位とします。@c
3930 負値はオブジェクトを右に移動させ、正値はオブジェクトを左に移動させます。@c
3931 値が @code{0} であればそのオブジェクトは親オブジェクトの参照ポイントに@c
3933 値が @code{-1} であればそのオブジェクトの左端が親オブジェクトの参照ポイントに@c
3935 値が @code{1} であればそのオブジェクトの右端が親オブジェクトの参照ポイントに@c
3937 記号 @code{LEFT}, @code{CENTER}, それに @code{RIGHT} は@c
3938 それぞれ @w{@code{-1}, @code{0}, それに @code{1}} に対応します。
3940 通常、@code{\override} コマンドを用いて @code{self-alignment-X} の値を@c
3942 @code{\tweak} コマンドを用いることで@c
3943 単一の音符に付けられている複数の注釈を個別に揃えることができます:
3945 @lilypond[quote,verbatim,relative=1]
3947 -\tweak self-alignment-X #-1
3949 -\tweak self-alignment-X #0
3951 -\tweak self-alignment-X #RIGHT
3953 -\tweak self-alignment-X #-2.5
3954 ^"aligned further to the right"
3957 @subsubsubheading オブジェクトを自動的に垂直方向に揃える
3959 オブジェクトの @code{Y-offset} プロパティに
3960 @code{ly:self-alignment-interface::y-aligned-on-self} がセットされていれば、@c
3961 水平方向の揃えと同じように、垂直方向に揃えることができます。@c
3962 しかしながら、垂直方向の揃えには他のメカニズムも関与します:
3963 @code{Y-offset} の値は、垂直方向の揃えに関与する変数の 1 つに過ぎません。@c
3964 このことにより、いくつかのオブジェクトの @code{Y-offset} 値の調整は@c
3966 単位はそのオブジェクトの垂直方向の広がりの半分です。@c
3967 通常これは非常に小さいため、非常に大きな数値が必要になる可能性があります。@c
3968 値が @code{-1} であればそのオブジェクトの下端が親オブジェクトの参照ポイントに@c
3970 値が @code{0} であればそのオブジェクトの中央が親オブジェクトの参照ポイントに@c
3972 値が @code{1} であればそのオブジェクトの上端が親オブジェクトの参照ポイントに@c
3974 記号 @code{DOWN}, @code{CENTER}, それに @code{UP} は@c
3975 それぞれ @w{@code{-1}, @code{0}, それに @code{1}} に対応します。
3977 @subsubsubheading オブジェクトを自動的に両方向に揃える
3979 @code{X-offset} と @code{Y-offset} の両方の設定を行うことで、@c
3980 オブジェクトの水平方向と垂直方向の揃えを同時に行うことができます。
3982 以下の例は、運指記号を符頭に近づけるための調整方法を示しています。
3985 @lilypond[quote,verbatim,relative=2]
3987 -\tweak self-alignment-X #0.5 % 左方向に移動させます
3988 -\tweak Y-offset #ly:self-alignment-interface::y-aligned-on-self
3989 -\tweak self-alignment-Y #-1 % 上方向に移動させます
3994 @unnumberedsubsubsec Using the @code{aligned-on-parent} procedures
3996 @c Cannot document as they do not seem to operate consistently on all objects -td
3997 @c TODO investigate further
3999 The @code{aligned-on-parent} procedures are used in the same way
4000 as the @code{aligned-on-self} procedures, they difference being
4001 that they permit an object to be aligned with the @emph{edges} of
4002 the parent rather than the parent's reference point. The following
4003 example shows the difference:
4007 @lilypond[verbatim,quote]
4013 @unnumberedsubsubsec Using the @code{centered-on-parent} procedures
4015 @c Cannot document as they do not seem to operate consistently on all objects -td
4016 @c TODO investigate further
4020 @c TODO The align-interface, BassFigureAlignment and VerticalAlignment
4022 @node break-alignable-interface を使用する
4023 @unnumberedsubsubsec @code{break-alignable-interface} を使用する
4024 @translationof Using the @code{break-alignable-interface}
4026 @cindex align to objects (オブジェクトに揃える)
4027 @cindex break-align-symbols
4029 リハーサル記号と小節番号を小節線ではなく、@c
4030 記譜オブジェクトに揃えることができます。@c
4031 対象となる記譜オブジェクトには、@code{ambitus},
4032 @code{breathing-sign}, @code{clef}, @code{custos}, @code{staff-bar},
4033 @code{left-edge}, @code{key-cancellation}, @code{key-signature}, それに
4034 @code{time-signature} があります。
4037 リハーサル記号と小節番号はオブジェクトの上で水平方向に中央揃えされます:
4040 @lilypond[verbatim,quote,relative=1]
4041 % リハーサル記号は音部記号の上に中央揃えされます
4042 \override Score.RehearsalMark.break-align-symbols = #'(clef)
4047 % リハーサル記号は拍子記号の上に中央揃えされます
4048 \override Score.RehearsalMark.break-align-symbols = #'(time-signature)
4054 % リハーサル記号はブレス記号の上に中央揃えされます
4055 \override Score.RehearsalMark.break-align-symbols = #'(breathing-sign)
4064 揃えの対象となり得るオブジェクトのリストを指定することができます。@c
4065 揃えを行う時点で対象リストの中にあるオブジェクトのいくつかが不可視である
4066 -- @code{break-visibility} の設定や、@c
4067 調号と音部に対する明示的な可視性の設定により --
4068 場合、リハーサル記号あるいは小節番号はリストの中にある@c
4069 最初の可視のオブジェクトに揃えられます。@c
4070 リストの中にあるオブジェクトがすべて不可視である場合、小節線に揃えられます。@c
4071 小節線が不可視である場合、小節線があるはずの場所に揃えられます。
4074 @lilypond[verbatim,quote,relative=1]
4075 % リハーサル記号は調号の上に中央揃えされます
4076 \override Score.RehearsalMark.break-align-symbols = #'(key-signature clef)
4081 % リハーサル記号は音部記号の上に中央揃えされます
4082 \set Staff.explicitKeySignatureVisibility = #all-invisible
4083 \override Score.RehearsalMark.break-align-symbols = #'(key-signature clef)
4088 % リハーサル記号は小節線の上に中央揃えされます
4089 \set Staff.explicitKeySignatureVisibility = #all-invisible
4090 \set Staff.explicitClefVisibility = #all-invisible
4091 \override Score.RehearsalMark.break-align-symbols = #'(key-signature clef)
4099 記譜オブジェクトに対するリハーサル記号の揃えを変更することができます。@c
4100 複数の譜を持つ楽譜では、この設定はすべての譜に適用されます。
4103 @lilypond[verbatim,quote,relative=1]
4104 % RehearsalMark は KeySignature の上に中央揃えされます
4105 \override Score.RehearsalMark.break-align-symbols = #'(key-signature)
4111 % RehearsalMark は KeySignature の左端に揃えられます
4112 \once \override Score.KeySignature.break-align-anchor-alignment = #LEFT
4116 % RehearsalMark は KeySignature の右端に揃えられます
4117 \once \override Score.KeySignature.break-align-anchor-alignment = #RIGHT
4123 また、リハーサル記号を左端に揃えて、@c
4124 さらに任意の量だけ右あるいは左にずらすことができます。@c
4128 @lilypond[verbatim,quote,relative=1]
4129 % リハーサル記号は調号の左端に揃えられて
4130 % さらに 3.5 譜スペース右にずらされます
4131 \override Score.RehearsalMark.break-align-symbols = #'(key-signature)
4132 \once \override Score.KeySignature.break-align-anchor = #3.5
4136 % リハーサル記号は調号の左端に揃えられて
4137 % さらに 2 譜スペース左にずらされます
4138 \once \override Score.KeySignature.break-align-anchor = #-2
4145 @node グラフィカル オブジェクトを垂直方向にグループ化する
4146 @subsection グラフィカル オブジェクトを垂直方向にグループ化する
4147 @translationof Vertical grouping of grobs
4149 @c FIXME Expand this section
4151 VerticalAlignment グラフィカル オブジェクトと
4152 VerticalAxisGroup グラフィカル オブジェクトは対で機能します。@c
4153 VerticalAxisGroup は Staff, Lyrics, 等のような@c
4154 異なるグラフィカル オブジェクトをグループにまとめます。@c
4155 それから、VerticalAlignment が
4156 VerticalAxisGroup によってグループ化されたグラフィカル オブジェクトを@c
4158 通常、楽譜には VerticalAlignment は 1 つしかありませんが、@c
4159 Staff, Lyrics 等はそれ自体でそれぞれに VerticalAxisGroup を持ちます。
4163 @subsection ステンシルを変更する
4164 @translationof Modifying stencils
4166 すべてのレイアウト オブジェクトは、@c
4167 @code{grob-interface} の一部である @code{stencil} プロパティを持ちます。@c
4168 通常、デフォルトでこのプロパティには、@c
4169 出力でそのオブジェクトを具現化する記号を描画するための@c
4171 例えば、@code{MultiMeasureRest} オブジェクトの @code{stencil} プロパティに@c
4172 対する標準設定は、@code{ly:multi-measure-rest::print} です。
4174 @code{stencil} プロパティを変更して異なる描画関数を参照させることにより、@c
4175 オブジェクトの標準記号を置き換えることができます。@c
4176 これには LilyPond 内部機能についての高い知識が求められます。@c
4177 しかしながら、多くの場合にまずまずの結果を生み出すもっと簡単な方法があります。
4179 簡単な方法では、@code{stencil} プロパティにテキストを描画する関数
4180 -- @code{ly:text-interface::print} -- をセットし、@c
4181 必要な記号を生み出すマークアップ テキストを保持するよう設定された
4182 @code{text} プロパティ与えます。@c
4183 マークアップの自由度の高さにより、多くのことを達成できます。@c
4184 詳細は、@ref{マークアップ内部でのグラフィック記譜法} を参照してください。
4186 以下の例では、この方法を用いて符頭記号を内部に×を持つ円に変更しています。
4188 @lilypond[verbatim,quote]
4190 \once \override NoteHead.stencil = #ly:text-interface::print
4191 \once \override NoteHead.text = \markup {
4193 \halign #-0.7 \draw-circle #0.85 #0.2 ##f
4194 \musicglyph #"noteheads.s2cross"
4202 @code{\musicglyph} マークアップ コマンドには、@c
4203 Feta フォントに含まれる任意の図柄を提供することができます。@c
4204 @ref{The Feta font} を参照してください。
4206 @c TODO Add inserting eps files or ref to later
4208 @c TODO Add inserting Postscript or ref to later
4212 @ref{マークアップ内部でのグラフィック記譜法},
4213 @ref{テキストをフォーマットする},
4214 @ref{Text markup commands},
4220 @translationof Modifying shapes
4226 @node タイとスラーの形状を変更する
4227 @unnumberedsubsubsec タイとスラーの形状を変更する
4228 @translationof Modifying ties and slurs
4230 @cindex slurs, modifying (スラーの形状を変更する)
4231 @cindex ties, modifying (タイの形状を変更する)
4232 @cindex Bézier curves (ベジエ曲線)
4233 @cindex Bézier control points (ベジエ曲線の制御ポイント)
4235 @code{Tie}, @code{Slur}, @code{PhrasingSlur}, @code{LaissezVibrerTie},
4236 それに @code{RepeatTie} はすべて 3 次のベジエ曲線として描かれます。@c
4237 自動的に算出されるタイやスラーの形状が最適ではない場合、以下の 2 つの@c
4238 方法を用いて手動で形状を変更することができます:@c
4242 自動的に算出されるベジエ曲線の制御ポイントの移動させる
4245 求める曲線を定義するのに必要な 4 つの制御ポイントの位置を明示的に指定する
4248 2 つの方法について以下で説明します。@c
4249 曲線の調節がわずかであれば、最初の方法が適しています。@c
4250 2 番目の方法は単一の音符に関連付けられる曲線を作り出す場合に適しています。
4252 @subsubsubheading 3 次ベジエ曲線
4254 3 次あるいは 3 乗のベジエ曲線は、4 つの制御ポイントによって定義されます。@c
4255 1 番目と 4 番目の制御ポイントは曲線の始点と終点になります。@c
4256 間にある 2 つの制御ポイントは曲線の形状を定義します。@c
4257 Web でベジエ曲線が描かれる様子を示すアニメーションを@c
4259 しかしながら、以下の記述も役に立つかもしれません。@c
4260 ベジエ曲線は最初の制御ポイントから 2 番目の制御ポイントに進み、@c
4261 徐々に 3 番目の制御ポイントの方へ向きを変えながら
4262 4 番目の制御ポイントの方へ向かい続け、@c
4263 3 番目の制御ポイントから 4 番目の制御ポイントに到達します。@c
4264 ベジエ曲線は 4 つの制御ポイントからなる四角形の中に納まります。@c
4265 制御ポイントの平行移動、回転、伸縮はすべて同じ操作です。
4267 @subsubsubheading 制御ポイントを移動させる
4269 @cindex shaping slurs and ties (スラーとタイの形状)
4272 以下の例では、タイの自動配置が最適ではなく、@code{\tieDown} も役に@c
4275 @lilypond[verbatim,quote,relative=1]
4279 { r4 <g c,> <g c,> <g c,> }
4283 @code{\shape} でタイの制御ポイントを調節することで衝突を避けることが@c
4286 @code{\shape} の構文は以下の通りです:
4289 [-]@code{\shape} @var{displacements} @var{item}
4292 これは @var{item} の制御ポイントを @var{displacements} だけ移動させます。@c
4293 引数 @var{displacements} は数のペアのリスト、あるいはそのようなリストの@c
4295 ペアの要素は制御ポイントの座標の移動量を表しています。@c
4296 @var{item} が文字列の場合、指定されたグラフィカル オブジェクト タイプ@c
4297 に @code{\once \override} で適用されます。@c
4298 @var{item} が音楽表記の場合、その音楽表記に調節が適用されます。
4300 言い換えると、@code{\shape} 関数は、引数 @var{item} が @qq{Slur}
4301 のようなグラフィカル オブジェクト名であるか @qq{(} のような音楽表記@c
4302 であるかによって、@code{\once \override} コマンドあるいは @code{\tweak}
4304 引数 @var{displacements} は 4 つの (dx . dy) ペアのリストで 4 つの@c
4305 制御ポイントの移動を指定します -- 値の単位は譜スペースです。
4306 (曲線が複数のセグメントを持つ場合、引数 @var{displacements} は 4 つの@c
4309 @code{\tweak} 形式で用いる場合にのみ、先頭にハイフン @code{-} を付ける@c
4312 それでは、上記の例に @code{\once \override} 形式の @code{\shape} を@c
4313 使ってタイを 0.5 譜スペースだけ上に移動させてみましょう:
4315 @lilypond[verbatim,quote,relative=1]
4318 \shape #'((0 . 0.5) (0 . 0.5) (0 . 0.5) (0 . 0.5)) Tie
4322 { r4 <g c,> <g c,> <g c,> }
4326 タイの位置は改善されましたが、中央部分をもっと持ち上げるべきです。@c
4327 以下の例で @code{\tweak} 形式でそれを行っています:
4329 @lilypond[verbatim,quote,relative=1]
4332 e1-\shape #'((0 . 0.5) (0 . 1) (0 . 1) (0 . 0.5)) ~ e
4335 { r4 <g c,> <g c,> <g c,> }
4339 同じ方法で制御ポイントを水平方向に移動させることもできて、同じ音楽@c
4340 タイミングで発生する 2 つの曲線をうまく配置することができます:
4342 @lilypond[verbatim,quote,ragged-right,relative=2]
4344 \shape #'((0.7 . -0.4) (0.5 . -0.4) (0.3 . -0.3) (0 . -0.2)) Slur
4345 \shape #'((0 . 0) (0 . 0.5) (0 . 0.5) (0 . 0)) PhrasingSlur
4349 @code{\shape} 関数は改行を跨ぐ曲線の制御ポイントを移動させることも@c
4351 分割される曲線それぞれにリストを与えて制御ポイントを移動させます。@c
4352 片方の曲線は変更する必要がない場合、空のリストを渡します。@c
4353 以下の例では、1 つのスラーが改行で 2 つに分割されています:
4355 @lilypond[verbatim,quote,ragged-right,relative=1]
4361 分割されたスラーの形状を変更することで、改行を跨いで続くスラーである@c
4365 @lilypond[verbatim,quote,ragged-right,relative=1]
4366 % 片方のスラーを変更する必要がない場合、
4367 % () を ((0 . 0) (0 . 0) (0 . 0) (0 . 0)) の短縮形として使うことができます
4369 (( 0 . 0) (0 . 0) (0 . 0) (0 . 1))
4370 ((0.5 . 1.5) (1 . 0) (0 . 0) (0 . -1.5))
4377 S 字曲線が求められた場合は、常に制御ポイントを手動で調節する必要があります
4378 --- LilyPond が自動的にそのような形状を選択することはありません。
4380 @lilypond[verbatim,quote,relative=2]
4381 c8( e b-> f d' a e-> g)
4382 \shape #'((0 . -1) (5.5 . -0.5) (-5.5 . -10.5) (0 . -5.5)) PhrasingSlur
4383 c8\( e b-> f d' a e-> g\)
4386 @subsubsubheading 制御ポイントの位置を明示的に指定する
4388 ベジエ曲線の制御ポイントの座標を指定します -- 単位は譜スペースです。@c
4389 X@tie{}座標はタイあるいはスラーを取り付ける音符の参照ポイントからの@c
4390 相対位置で、X@tie{}座標は譜の中央線からの相対位置です。@c
4391 制御ポイントの座標をリストで指定します -- リストは数のペアを 4 つ持ちます。@c
4392 両端の座標を推測して、それから 2 つ中間点の座標を推測します。@c
4393 最適値はトライ&エラーで見つけます。@c
4394 音楽やレイアウトに変更が加えられた場合、手動で値を調節する必要がある@c
4397 制御ポイントを移動させるよりも、位置を明示的に指定する方が望ましい@c
4398 シチュエーションの 1 つは、単一の音符に関連付けられる曲線の場合です。@c
4400 繰り返しの差し替え部分まで延びるスラーを表示する方法を示しています。
4403 @lilypond[verbatim,quote,relative=2]
4405 \repeat volta 3 { c4 d( e f }
4410 % スラーを作成して、新しい位置に移動させます
4411 % <> はスラーを終わらせるための空の和音です
4412 -\tweak control-points #'((-2 . 3.8) (-1 . 3.9) (0 . 4) (1 . 3.4)) ( <> )
4417 % スラーを作成して、新しい位置に移動させます
4418 -\tweak control-points #'((-2 . 3) (-1 . 3.1) (0 . 3.2) (1 . 2.4)) ( <> )
4425 同じ音楽タイミングに複数のタイあるいはスラーが存在する場合、@c
4426 @code{control-points} プロパティを変更しても@c
4427 それらの形状を変更することはできません。@c
4428 @code{\tweak} コマンドを用いたとしても変更できません。@c
4429 しかしながら、@code{TieColumn} の @code{tie-configuration} プロパティを@c
4430 オーバライドすることで、タイの垂直方向の位置と領域を変更することができます。
4434 @rinternals{TieColumn}
4437 @node unpure-pure コンテナ
4438 @subsection unpure-pure コンテナ
4439 @translationof Unpure-pure containers
4441 @cindex Scheme, pure containers (Scheme pure コンテナ)
4442 @cindex Scheme, unpure containers (Scheme unpure コンテナ)
4443 @cindex pure containers, Scheme (Scheme pure コンテナ)
4444 @cindex unpure containers, Scheme (Scheme unpure コンテナ)
4445 @cindex horizontal spacing, overriding (水平方向のスペースを上書きする)
4447 unpure-pure コンテナは @emph{Y-axis} スペース - 特に @code{Y-offset} と
4448 @code{Y-extent} - の算出を文字 (つまり、数字やペア) ではなく、Scheme 関数で@c
4451 ある特定のグラフィカル オブジェクトでは、@code{Y-extent} は @code{stencil}
4452 プロパティをベースにしていて、それらの @code{stencil} プロパティを上書きする場合は
4453 unpure-pure コンテナで @code{Y-extent} も上書きする必要があります。@c
4454 関数が @code{Y-offset} と/または @code{Y-extent} を上書きした場合、@c
4455 その関数はコンパイルの最中に改行の算出を早すぎるタイミングで引き起こすと見なされます。@c
4456 そのため、その関数はまったく評価されず (通常、@samp{0} または @samp{'(0 . 0)} の@c
4457 値を返します)、結果として衝突を引き起こすことがあります。@c
4458 @q{pure} 関数はプロパティ、オブジェクト、あるいはグラフィカル オブジェクトの消失に@c
4459 影響を与えないため、その関数の Y-axis に関する評価は常に正しく行われます。
4461 現在のところ @q{pure} と見なされる関数が約 30 あり、Unpure-pure コンテナを用いて
4462 @q{pure} ではない関数を @q{pure} な関数としてセットすることができます。@c
4463 @q{pure} 関数は改行の @emph{前に} 評価されるため、水平方向のスペースを
4464 @q{正しいタイミングで} 調節することができます。@c
4465 @q{unpure} 関数は改行の @emph{後に} 評価されます。
4467 @warning{@q{pure} な関数を常に把握していることは困難なので、作成する @q{pure}
4468 関数ではグラフィカル オブジェクト @code{Beam} や @code{VerticalAlignment} を@c
4471 unpure-pure コンテナは以下のように構築します:
4473 @code{(ly:make-unpure-pure-container f0 f1)}
4475 ここで @code{f0} は @var{n} (@var{n >= 1}) 個の引数を取る関数であり、最初の引数@c
4476 は常にグラフィカル オブジェクトである必要があります。@c
4478 @code{f1} は @q{pure} であると見なされる関数であり、@var{n + 2} 個の引数を@c
4480 @code{f1} も最初の引数は常にグラフィカル オブジェクトである必要があり、2 番目と
4481 3 番目の引数は @q{start} と @q{end} です。
4483 @q{start} と @q{end} は事実上、@code{Spanners} (つまり、@code{Hairpin} や
4484 @code{Beam}) だけで問題となるダミー値であり、
4485 @var{start} and @var{end} are, for all intents and purposes, dummy
4486 values that only matter for @code{Spanners} (i.e @code{Hairpin} or
4487 @code{Beam}), that can return different height estimations based on a
4488 starting and ending column.
4490 @code{f1} の残りの引数は @code{f0} の引数と同じです (@var{n = 1} である場合は@c
4493 関数 @code{f1} の結果は概算であり、@code{f0} が実際の値を得るのに用いられます。@c
4494 @code{f0} の結果はもっと後のスペースの処理で微調整に用いられます。
4496 @lilypond[verbatim,quote,ragged-right]
4497 #(define (square-line-circle-space grob)
4498 (let* ((pitch (ly:event-property (ly:grob-property grob 'cause) 'pitch))
4499 (notename (ly:pitch-notename pitch)))
4500 (if (= 0 (modulo notename 2))
4501 (make-circle-stencil 0.5 0.0 #t)
4502 (make-filled-box-stencil '(0 . 1.0)
4505 squareLineCircleSpace = {
4506 \override NoteHead.stencil = #square-line-circle-space
4509 smartSquareLineCircleSpace = {
4510 \squareLineCircleSpace
4511 \override NoteHead.Y-extent =
4512 #(ly:make-unpure-pure-container
4513 ly:grob::stencil-height
4514 (lambda (grob start end) (ly:grob::stencil-height grob)))
4517 \new Voice \with { \remove "Stem_engraver" }
4519 \squareLineCircleSpace
4521 \smartSquareLineCircleSpace
4526 最初の小節では unpure-pure コンテナを用いていないため、スペース算出エンジンは符頭の@c
4527 幅を知ることができず、符頭と臨時記号が衝突しています。@c
4528 次の小節では unpure-pure コンテナを用いているため、スペース算出エンジンは符頭の幅を@c
4529 知ることができ、それに応じて小節の幅を増やすことで衝突を回避しています。
4531 通常、簡単な計算では、unpure-pure コンテナの @q{unpure} パートと @q{pure} パート@c
4532 の両方に、引数の数とスコープを変えただけのほとんど同じ関数を用いることができます。
4534 @warning{@q{pure} と見なした関数が @q{pure} でなかった場合、予期しない結果となる@c
4540 @translationof Using music functions
4542 @c TODO -- add @seealso, etc. to these subsections
4544 調整を異なる音楽表記に再利用する必要がある場合、@c
4545 その調整を音楽関数にしておくと便利です。@c
4546 このセクションでは、@emph{置換} 関数についてだけ議論します。@c
4547 置換関数は変数を LilyPond 入力コードに置き換えます。@c
4548 他のもっと複雑な関数については、@rextend{Music functions} で記述されています。
4557 @translationof Substitution function syntax
4559 変数を LilyPond コードに置換する関数を作成することは簡単にできます。@c
4560 置換関数の一般的な形式は以下のようなものです:
4564 #(define-music-function
4565 (parser location @var{arg1} @var{arg2} @dots{})
4566 (@var{type1?} @var{type2?} @dots{})
4568 @var{@dots{}music@dots{}}
4575 @multitable @columnfractions .33 .66
4576 @item @code{@var{argN}}
4579 @item @code{@var{typeN?}}
4580 @tab @code{@var{argN}} が @code{#t} を返す Scheme の @emph{型述語} (type predicate)。
4582 @item @code{@var{@dots{}music@dots{}}}
4583 @tab 通常の LilyPond 入力。引数を参照するには @code{$} (LilyPond 構造が@c
4584 許可されている場合のみ) や @code{#} (引数を Scheme 値、音楽関数の引数、@c
4585 あるいは音楽リスト内部の音楽として使う場合) を用います
4591 引数 @code{parser} と @code{location} を省略することはできず、@c
4592 @rextend{Music functions} で記述されている高度な状況で@c
4594 置換関数において、必ずこれらの引数を記述してください。
4596 引数として、型述語のリストも必須です。@c
4597 音楽関数で用いられる一般的な型述語には下記のものがあります:
4601 cheap-list? @emph{(}@q{list?}@emph{ の代わりに用いることで、処理を高速にします)}
4612 @ref{Predefined type predicates} を参照してください。@c
4613 ユーザが型述語を定義することもできます。
4617 @ref{Predefined type predicates}
4620 @rextend{Music functions}
4623 @file{lily/music-scheme.cc},
4630 @translationof Substitution function examples
4632 このセクションでは、置換関数の例をいくつか紹介します。@c
4633 高度なことはしていませんが、シンプルな置換関数を実現する方法を示しています。
4636 @code{TextScript} のパディング設定を容易にするための関数が定義されています:
4638 @lilypond[quote,verbatim,ragged-right]
4640 #(define-music-function
4641 (parser location padding)
4644 \once \override TextScript.padding = $padding
4648 c4^"piu mosso" b a b
4650 c4^"piu mosso" d e f
4652 c4^"piu mosso" fis a g
4656 数値のほかに、音符などの音楽表記を音楽関数への引数にすることができます:
4658 @lilypond[quote,verbatim,ragged-right]
4660 #(define-music-function
4661 (parser location note)
4664 \tweak NoteHead.stencil #ly:text-interface::print
4665 \tweak NoteHead.text
4666 \markup \musicglyph #"custodes.mensural.u0"
4667 \tweak Stem.stencil ##f
4671 \relative c' { c4 d e f \custosNote g }
4674 複数の引数をとる置換関数を定義することもできます:
4676 @lilypond[quote,verbatim,ragged-right]
4678 #(define-music-function
4679 (parser location padding tempotext)
4682 \once \override Score.MetronomeMark.padding = $padding
4683 \tempo \markup { \bold #tempotext }
4687 \tempo \markup { "Low tempo" }
4689 \tempoPadded #4.0 "High tempo"
4694 @c TODO: add appropriate @@ref's here.