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: Tomohiro Tatejima, 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]
325 \new Staff \relative {
326 % 暗黙的に Voice コンテキストが作成されます
329 \new Staff \relative {
336 そして、1 つの譜に複数のボイスが配置されます:
338 @lilypond[quote,verbatim]
340 \new Voice \relative {
344 \new Voice \relative {
354 @c @code{\new} should always be used to specify unnamed contexts.
356 @code{\new} と @code{\context} は動作が異なります:
360 @code{\new} はコンテキスト名を持っているか、いないかにかかわらず、@c
361 例え同じ名前を持つコンテキストが存在していたとしても、常に全く新たな@c
364 @lilypond[quote,verbatim]
366 \new Voice = "A" \relative {
370 \new Voice = "A" \relative {
378 コンテキスト名を持つ @code{\context} は、階層、名前、それにタイプが@c
379 同じコンテキストが存在しない場合にのみ、新たなコンテキスを作成します。@c
380 存在する場合、@code{\context} はすでに作成されているコンテキストへの@c
381 参照となり、音楽表記はそのコンテキストに渡されて処理されます。
383 名前を持つコンテキストの用途の 1 つとして、楽譜レイアウトと音楽コンテンツ@c
388 @lilypond[quote,verbatim]
402 \context Voice = "one" {
407 \context Voice = "two" {
417 @lilypond[quote,verbatim]
422 \context Voice = "one" {
425 \context Voice = "two" {
431 \context Voice = "one" {
436 \context Voice = "two" {
445 名前付きコンテキストの他の使用例として、2 つの音楽表記をつなげて
446 1 つのコンテキストにすることができます。@c
447 以下の例では、アーティキュレーションと音符は別々に入力されています:
450 @rlearning{Organizing pieces with variables} を参照してください。
453 コンテキスト名を持たない @code{\context} は、階層とタイプが一致する@c
454 コンテキストのうち最初に作成されたものに適用され
455 (例えそのコンテキストが名前を持っていたとしても適用されます)、@c
456 音楽表記はそのコンテキストに渡されて処理されます。@c
458 しかしながら、コンテキスト名と音楽表記を持たない @code{\context}
459 は、コンテキスト内で @code{\applyContext} で記述した Scheme
460 プロシージャを実行させるのに用いられます:
463 \new Staff \relative @{
466 \applyContext #(lambda (ctx)
468 (display (ly:context-current-moment ctx)))
475 後で参照するコンテキストには名前を付ける必要があります。@c
476 例えば、歌詞を音楽に関連付けるような場合です:
479 \new Voice = "tenor" @var{music}
481 \new Lyrics \lyricsto "tenor" @var{lyrics}
485 歌詞を音楽に関連付ける方法についての詳細は
486 @ref{Automatic syllable durations} を参照してください。
488 ある特定のタイプのすべてのコンテキストのプロパティを @code{\layout}
489 ブロックで変更することができます (構文は異なります)
490 -- @ref{Changing all contexts of the same type} を参照してください。@c
491 この構造でもレイアウトを音楽コンテンツから分離させることができます。@c
492 単一のコンテキストを変更するのであれば、@code{\with} ブロックを用いる@c
493 必要があります -- @ref{Changing just one specific context} を参照@c
499 @rlearning{Organizing pieces with variables}
502 @ref{Changing just one specific context},
503 @ref{Automatic syllable durations}
507 @subsection コンテキストを残しておく
508 @translationof Keeping contexts alive
510 @cindex contexts, keeping alive (コンテキストを残しておく)
511 @cindex contexts, lifetime (コンテキストのライフタイム)
513 通常、コンテキストは何もすることが無くなった最初の音楽的タイミングで@c
515 そのため、@code{Voice} コンテキストはすべてのイベントを終えるとすぐに消滅し、@c
516 @code{Staff} コンテキストは保持しているすべての @code{Voice} コンテキストの@c
517 イベントが終了するとすぐに消滅する、などとなっています。@c
518 このことは、早い段階のすでに消滅したコンテキスを参照する必要がある場合に、@c
520 例えば、@code{\change} コマンドで譜を変更する場合、@c
521 @code{\lyricsto} コマンドで歌詞をボイスに結び付ける場合、@c
522 あるいは、早い段階で登場したコンテキストに音楽イベントを追加する場合に@c
526 @code{Staff} コンテキストや @code{<<...>>} 構造の中にある @code{Voice}
527 コンテキストのうち 1 つだけは、例え途中ですることが無くなったとしても、@c
528 @code{Staff} コンテキストあるいは
529 @code{<<...>>} 構造の終わりまで維持されます。@c
530 このように維持されるコンテキストは、最初の @code{@{...@}} 構造の中にある@c
531 最初のコンテキストであり、@code{<<...>>} 構造の中にあるものは無視されます。
533 各音楽タイミングで何かすることを持たせることにより、@c
534 任意のコンテキストを残しておくことができます。@c
535 @code{Staff} コンテキストを残しておくには、それに含まれるボイスの 1 つが@c
536 維持されることを保証する必要があります。@c
537 ボイスを残しておく方法の 1 つに、ボイスに含まれる実際の音楽と並列に、@c
538 空白休符をそのボイスに付け加えるという方法があります。@c
539 残しておく必要があるすべての @code{Voice} コンテキストに対して、@c
541 ところどころで使用されるボイスがある場合、@c
542 前述の例外によって必要なボイスを残そうとするよりは、@c
543 それらのボイスすべてを残しておく方が安全です。
545 以下の例では、空白休符の追加を用いる方法で、@c
546 ボイス A とボイス B の両方が楽曲全体を通して維持されます:
549 @lilypond[quote,verbatim]
550 musicA = \relative { d''4 d d d }
551 musicB = \relative { g'4 g g g }
554 \new Voice = "A" { s1*5 } % Voice "A" を 5 小節の間、維持する
555 \new Voice = "B" { s1*5 } % Voice "B" を 5 小節の間、維持する
560 \context Voice = "A" {
564 \context Voice = "B" {
568 \context Voice = "A" { \musicA }
569 \context Voice = "B" { \musicB }
570 \context Voice = "A" { \musicA }
581 @cindex lyrics, aligning with sporadic melody (途切れ途切れのメロディに歌詞を揃える)
584 途切れ途切れのメロディに歌詞を持たせる方法を示しています。@c
586 メロディや伴奏は複数のセクションによって構成されることになります。
589 @lilypond[quote,verbatim]
590 melody = \relative { a'4 a a a }
591 accompaniment = \relative { d'4 d d d }
592 words = \lyricmode { These words fol -- low the mel -- o -- dy }
595 \new Staff = "music" {
597 \new Voice = "melody" {
599 s1*4 % Voice "melody" を 4 小節の間、残します
602 \new Voice = "accompaniment" {
607 \context Voice = "melody" { \melody }
608 \context Voice = "accompaniment" { \accompaniment }
610 \context Voice = "accompaniment" { \accompaniment }
612 \context Voice = "melody" { \melody }
613 \context Voice = "accompaniment" { \accompaniment }
618 \new Lyrics \with { alignAboveContext = #"music" }
619 \lyricsto "melody" { \words }
624 これに代わる方法として、メロディに直接空白休符を付け加えて、@c
625 メロディが伴奏と揃うようにする方法があります
626 -- 多くの場合、こちらの方法の方が良いかもしれません:
629 @lilypond[quote,verbatim]
636 accompaniment = \relative {
642 words = \lyricmode { These words fol -- low the mel -- o -- dy }
646 \new Staff = "music" {
648 \new Voice = "melody" {
652 \new Voice = "accompaniment" {
658 \new Lyrics \with { alignAboveContext = #"music" }
659 \lyricsto "melody" { \words }
665 @node コンテキストのプラグインを変更する
666 @subsection コンテキストのプラグインを変更する
667 @translationof Modifying context plug-ins
669 @c TODO Should this be Modifying engravers or Modifying contexts?
671 記譜コンテキスト (@code{Score} や @code{Staff} のような) は@c
673 @q{エングラーバ} と呼ばれる記譜要素を作成するプラグインを保持します。@c
674 例えば、@code{Voice} コンテキストは @code{Note_head_engraver} を保持し、@c
675 @code{Staff} コンテキストは @code{Key_engraver} を保持します。
679 @rinternals{Engravers and Performers}.
682 Internals Reference @expansion{} Translation @expansion{} Engravers.
686 @rinternals{Contexts}
689 Internals Reference @expansion{} Translation @expansion{} Context.
691 の中にある各コンテキストについての説明では、@c
692 そのコンテキストで使用されるエングラーバがリストアップされています。
694 これらのプラグインを入れ換えると有用な場合があります。@c
695 プラグインを入れ換えるには、新たに作成するコンテキストを
696 @code{\new} あるいは @code{\context} で開始し、@c
697 そのコンテキストを以下のように変更します:
702 \new @var{context} \with @{
715 ここで、@dots{} はエングラーバの名前になります。@c
716 ここで、@code{Staff} コンテキストから @code{Time_signature_engraver} と
717 @code{Clef_engraver} を削除する簡単な例を示します:
719 @lilypond[quote,relative=1,verbatim,fragment]
725 \remove "Time_signature_engraver"
726 \remove "Clef_engraver"
733 2 番目の譜には、拍子記号と音部記号がありません。@c
734 この方法は、オブジェクトを不可視にするよりも乱暴な方法です。@c
735 なぜなら、譜全体に影響を与えるからです。@c
736 さらに、望む望まないに係わらず、この方法はスペースにも影響を与えます。@c
737 オブジェクトを消すもっと洗練された方法については、@c
738 @rlearning{オブジェクトの可視性と色} を参照してください。
741 通常、小節線と拍子記号は楽譜全体で同期されます。@c
742 これは @code{Timing_translator} と @code{Default_bar_line_engraver}
744 このプラグインは拍子記号の管理や、小節内の配置の管理などを行います。@c
745 これらのエングラーバを @code{Score} コンテキストから
746 @code{Staff} コンテキストへ異動させることにより、@c
747 楽譜の各譜に独自の拍子記号を持たせることが可能になります。
749 @cindex polymetric scores (多拍子の楽譜)
750 @cindex Time signatures, multiple (複数の拍子記号)
752 @lilypond[quote,relative=1,ragged-right,verbatim,fragment]
754 \remove "Timing_translator"
755 \remove "Default_bar_line_engraver"
758 \consists "Timing_translator"
759 \consists "Default_bar_line_engraver"
765 \consists "Timing_translator"
766 \consists "Default_bar_line_engraver"
776 エングラーバを指定する順序は、エングラーバが処理を行う順序です。@c
777 通常、エングラーバが指定される順序は問題にはなりません。@c
778 しかしながら、いくつかの特殊なケースでは、この順序が重要になります。@c
779 例えば、あるエングラーバがプロパティを記述して、@c
780 それを他のエングラーバが読む場合、あるいは、@c
781 あるエングラーバがグラフィカル オブジェクトを作成し、@c
782 それを他のエングラーバが処理しなければならない場合です。@c
788 通常、@code{Bar_engraver} を最初にする必要があります。
791 @code{New_fingering_engraver} を @code{Script_column_engraver} の前に@c
795 @code{Timing_translator} を @code{Bar_number_engraver} の前に配置する@c
802 @file{ly/engraver-init.ly}
805 @node コンテキストのデフォルト設定を変更する
806 @subsection コンテキストのデフォルト設定を変更する
807 @translationof Changing context default settings
809 @cindex default context properties, changing (デフォルトのコンテキスト プロパティを変更する)
810 @cindex context properties, changing defaults (デフォルトのコンテキスト プロパティを変更する)
812 @ref{Modifying properties} で説明したように、コンテキストとグラフィカル
813 オブジェクトのプロパティを @code{\set} コマンドや @code{\override}
815 これらのコマンドは音楽イベントを生成して、楽譜処理中にコマンドが出現する@c
818 対照的に、このセクションではコンテキストが作成された時点でコンテキストと@c
819 グラフィカル オブジェクトのプロパティの @emph{デフォルト} 値を変更する@c
822 1 つはある特定のタイプの全コンテキストのデフォルト値を変更する方法で、@c
823 もう 1 つはただ 1 つのコンテキストのインスタンスのデフォルト値を変更する@c
827 * 同じタイプの全コンテキストを変更する::
828 * 指定したコンテキストだけを変更する::
832 @node 同じタイプの全コンテキストを変更する
833 @unnumberedsubsubsec 同じタイプの全コンテキストを変更する
834 @translationof Changing all contexts of the same type
836 @cindex \context in \layout block (\layout ブロックの中の \context)
840 @code{Score}, @code{Staff}, @code{Voice}, その他のコンテキストにおいて@c
841 デフォルトで使用されるコンテキスト設定は、@code{\layout} ブロックの中の@c
842 @code{\context} ブロックでで指定することができます。@c
843 @code{\layout} ブロックは、それを適用する @code{\score} ブロックの中で、@c
844 かつ、音楽表記の後に配置する必要があります。
850 [すべての Voice コンテキストのコンテキスト設定]
854 [context settings for all Staff contexts]
859 以下のタイプの設定を指定することができます:
863 @code{\override} コマンド -- コンテキスト名を省略します
865 @lilypond[quote,verbatim]
868 a'4^"Thicker stems" a a a
874 \override Stem.thickness = #4.0
883 @lilypond[quote,verbatim]
886 a'4^"Smaller font" a a a
899 @code{\dynamicUp} や @code{\accidentalStyle dodecaphonic} のような音楽@c
902 @lilypond[quote,verbatim]
905 a'4^"Dynamics above" a a a
915 \accidentalStyle dodecaphonic
922 @code{\with} ブロックを有するユーザ定義変数 -- @code{\with} ブロックの@c
923 詳細は @ref{Changing just one specific context} を参照してください。
925 @lilypond[quote,verbatim]
926 StaffDefaults = \with {
933 a'4^"Smaller font" a a a
948 プロパティ設定コマンドは、@code{\context} ブロックで囲まずに、@c
949 @code{\layout} ブロックの中に配置することができます。@c
950 そのような設定は、指定されたタイプの任意のコンテキストの開始時に@c
951 プロパティ設定コマンドをインクルードするのと等価です。@c
952 コンテキストを指定しない場合、@emph{すべての} 下位コンテキストに影響を@c
953 与えます -- @ref{Bottom-level contexts - voices} を参照してください。@c
954 @code{\layout} ブロックの中でのプロパティ設定コマンドの構文は、@c
955 音楽ストリームの中で同じコマンドを記述するのと同じです。
957 @lilypond[quote,verbatim]
961 a'4^"Smaller font" a a a
966 \accidentalStyle dodecaphonic
968 \override Voice.Stem.thickness = #4.0
974 @node 指定したコンテキストだけを変更する
975 @unnumberedsubsubsec 指定したコンテキストだけを変更する
976 @translationof Changing just one specific context
981 @code{\with} ブロックで指定したコンテキスト インスタンスのコンテキスト
982 プロパティだけを変更することができます。@c
983 他の全ての同じタイプのコンテキスト インスタンスは、LilyPond に組み込まれて@c
984 スコープ内の @code{\layout} ブロックによって変更されたデフォルト設定の@c
986 @code{\with} ブロックは @code{\new} @var{context-type} コマンドの直後に@c
992 [このコンテキスト インスタンスだけに適用されるコンテキスト設定]
998 以下のタイプの設定を指定することができます:
1002 @code{\override} コマンド -- コンテキスト名を省略します
1004 @lilypond[quote,verbatim]
1009 \override Stem.thickness = #4.0
1013 a'4^"Thick stems" a a a
1022 コンテキスト プロパティを直接設定します
1024 @lilypond[quote,verbatim]
1029 a'4^"Default font" a a a
1038 a'4^"Smaller font" a a a
1047 @code{\dynamicUp} 等のあらかじめ定義されているコマンド
1049 @lilypond[quote,verbatim]
1055 a'4^"Dynamics below" a a a
1061 \with { \accidentalStyle dodecaphonic }
1064 \with { \dynamicUp }
1067 a'4^"Dynamics above" a a a
1079 @unnumberedsubsubsec 適用順序
1080 @translationof Order of precedence
1082 ある特定のタイミングで適用されるプロパティの値は以下のように決定されます:
1086 入力ストリームの中の @code{\override} コマンドや @code{\set} コマンドが
1090 さもなければ、コンテキスト初期宣言の @code{\with} から取得したデフォルト値@c
1094 さもなければ、@code{\layout} ブロックの中にある直近で適切な @code{\context}
1095 ブロックから取得したデフォルト値が用いられます。
1098 さもなければ、LilyPond の組み込みデフォルト値が用いられます。
1103 @rlearning{Modifying context properties}
1106 @ref{Contexts explained},
1107 @ref{Bottom-level contexts - voices},
1108 @ref{The set command},
1109 @ref{The override command},
1110 @ref{The \layout block}
1113 @node 新しいコンテキストを定義する
1114 @subsection 新しいコンテキストを定義する
1115 @translationof Defining new contexts
1117 @cindex contexts, defining new (新しいコンテキストを定義する)
1118 @cindex engravers, including in contexts (エングラーバをコンテキストに含める)
1127 @code{Staff} や @code{Voice} のようなコンテキストは、@c
1128 簡単なブロックの組み合わせで構成されています。
1129 エングラーバ プラグインの組み合わせを変えることで、@c
1130 新しいタイプのコンテキスを作成することができます。
1132 次の例は、ゼロからタイプの異なる @code{Voice} コンテキストを作り上げる方法を@c
1134 このコンテキストは @code{Voice} コンテキストに似ていますが、@c
1135 音符の代わりにスラッシュを譜の中央に譜刻します。@c
1136 これはジャズで即興を表すのに使うことができます。
1138 @lilypond[quote,ragged-right]
1139 \layout { \context {
1141 \type "Engraver_group"
1142 \consists "Note_heads_engraver"
1143 \consists "Rhythmic_column_engraver"
1144 \consists "Text_engraver"
1145 \consists "Pitch_squash_engraver"
1146 squashedPosition = #0
1147 \override NoteHead.style = #'slash
1152 \accepts "ImproVoice"
1156 a'4 d8 bes8 \new ImproVoice { c4^"ad lib" c
1157 c4 c^"undress" c_"while playing :)" c }
1163 これらの設定は @code{\layout} ブロック内部の @code{\context} ブロック@c
1174 以下では、上記の例の @dots{} に入るべき入力について議論します。
1176 最初に、新しいコンテキストの名前を定義する必要があります:
1182 このコンテキストは @code{Voice} に似せる必要があるため、@c
1183 (既存の) @code{Voice} と同じ機能を実現するコマンドが必要です。@c
1184 これは、新しいコンテキストにエイリアス @code{Voice} を与えることで実現できます。
1190 このコンテキストは音符と指示テキストを譜刻しますので、@c
1191 それらの機能を提供するエングラーバを付け加える必要があります:
1194 \consists "Note_heads_engraver"
1195 \consists "Text_engraver"
1198 しかしながら、音符の代わりにスラッシュを譜の中央線上に配置します:
1201 \consists "Pitch_squash_engraver"
1202 squashedPosition = #0
1205 @rinternals{Pitch_squash_engraver} は
1206 (@rinternals{Note_heads_engraver} によって作成される) 符頭を変更し、@c
1207 符頭の垂直位置を @code{squashedPosition} にセットします
1208 -- 今回は @code{0}、つまり中央線上です。
1213 \override NoteHead.style = #'slash
1217 これらのプラグインすべてが共同する必要があり、@c
1218 それには特殊なプラグインが必要です。@c
1219 このプラグインは常に @code{Engraver_group} であり、@c
1220 キーワード @code{\type} を付ける必要があります。
1223 \type "Engraver_group"
1231 \type "Engraver_group"
1232 \consists "Note_heads_engraver"
1233 \consists "Text_engraver"
1234 \consists "Pitch_squash_engraver"
1235 squashedPosition = #0
1236 \override NoteHead.style = #'slash
1244 通常の @code{Voice} と同様に、@c
1245 @code{ImproVoice} を @code{Staff} の下に置く必要があります。@c
1246 それゆえ、@code{Staff} 定義を @code{\accepts} コマンドで変更します:
1256 @code{\accepts} の反対は @code{\denies} です。@c
1257 これは既存のコンテキスト定義を再利用する場合に必要となります。
1259 以下のように、両方を @code{\layout} ブロックの中に置きます:
1269 \accepts "ImproVoice"
1274 それから、このサブセクションの最初にあった出力を入力します:
1282 c c_"while playing :)"
1290 @subsection コンテキストの配置順序
1291 @translationof Context layout order
1293 @cindex contexts, layout order (コンテキストの配置順序)
1297 通常、コンテキストは入力ファイルの中で記述した順に楽譜の段の上から下に@c
1299 コンテキストがネストされている場合、外側のコンテキストは入力ファイルの@c
1300 中で指定されたコンテキストを内側に保持して、内側のコンテキストは外側の@c
1301 コンテキストの @qq{accepts} リストに含まれます。@c
1302 ネストされたコンテキストのうち外側のコンテキストの @qq{accepts} リスト@c
1303 に含まれないものは、ネストされずに外側のコンテキストの下に再配置されます。
1305 コンテキストの @qq{accepts} リストを @code{\accepts} コマンドと
1306 @code{\denies} コマンドで変更することができます。@c
1307 @code{\accepts} はコンテキストを @qq{accepts} リストに追加して、@c
1308 @code{\denies} は @qq{accepts} リストからコンテキストを削除します。@c
1309 例えば、通常、コード ネームは @code{Staff} コンテキストの中にネスト@c
1310 されないため、@code{ChordNames} コンテキストはデフォルトでは @code{Staff}
1311 コンテキストの @qq{accepts} リストには含まれませんが、リストに含める必要が@c
1314 @lilypond[verbatim,quote]
1318 \chords { d1:m7 b1:min7.5- }
1323 @lilypond[verbatim,quote]
1327 \chords { d1:m7 b1:min7.5- }
1332 \accepts "ChordNames"
1338 @code{\denies} は主に、他のコンテキストをベースに新しいコンテキストを@c
1339 作成した時に、中にネストするコンテキストを変更するために用いられます。
1341 例えば、@code{VaticanaStaff} コンテキストは @code{Staff} コンテキストを@c
1342 ベースにしていますが、@qq{accepts} リストでは @code{Voice} コンテキスト@c
1343 の代わりに @code{VaticanaVoice} コンテキストを保持しています。
1345 コンテキストに保持されるべきコマンドが出現して、それを保持するための@c
1346 適切なコンテキストが存在しない場合、コンテキストが暗黙的に作成される@c
1348 これは予期しない譜や楽譜を生み出す可能性があります。
1350 @cindex alignAboveContext
1351 @cindex alignBelowContext
1352 @funindex alignAboveContext
1353 @funindex alignBelowContext
1355 短い期間、あるコンテキストを存在させる必要がある場合があります。@c
1356 オッシアの譜コンテキストが良い例です。@c
1357 通常、これは主音楽の対応するセクションと並列に、適切な場所でコンテキスト@c
1359 デフォルトでは、一時コンテキストは既存のすべてのコンテキストの下に配置@c
1361 @qq{main} というコンテキストの上に配置し直すには以下のようにします:
1364 \new Staff \with @{ alignAboveContext = #"main" @}
1367 @code{ChoirStaff} のような複数の譜のレイアウトで一時的な歌詞を配置する場合
1368 -- 例えば、繰り返しセクションに 2 番目の歌詞を追加する場合 --
1370 デフォルトでは、一時的な歌詞は下段の譜の下に配置されます。@c
1371 一時的な歌詞コンテキストを @code{alignBelowContext} で定義することにより、@c
1372 1 番目の歌詞を保持する (名前付きの) 歌詞コンテキストの下に配置することが@c
1375 一時コンテキストを再配置する例は他にもあります
1376 -- @rlearning{Nesting music expressions}、+@ref{Modifying single staves}、@c
1377 それに @ref{Techniques specific to lyrics} を参照してください。
1381 @rlearning{Nesting music expressions}
1384 @ref{Modifying single staves},
1385 @ref{Techniques specific to lyrics}
1388 @rprogram{An extra staff appears}
1391 @file{ly/engraver-init.ly}
1395 @section 内部リファレンスの説明
1396 @translationof Explaining the Internals Reference
1402 * グラフィカル オブジェクト プロパティを決定する::
1406 @node 内部リファレンスを使いこなす
1407 @subsection 内部リファレンスを使いこなす
1408 @translationof Navigating the program reference
1410 @c TODO remove this (it's in the LM)
1411 @c Replace with more factual directions
1413 以下の譜面の運指記号を移動させたいとします:
1415 @lilypond[quote,relative=2,verbatim]
1421 運指指示のドキュメント (@ref{運指の指示}) を見ると、@c
1422 以下のようなセクションがあることに気付くはずです:
1427 内部リファレンス: @rinternals{Fingering}
1432 @c outdated info; probably will delete.
1434 This fragment points to two parts of the program reference: a page
1435 on @code{FingeringEvent} and one on @code{Fingering}.
1437 The page on @code{FingeringEvent} describes the properties of the music
1438 expression for the input @code{-2}. The page contains many links
1439 forward. For example, it says
1442 Accepted by: @rinternals{Fingering_engraver},
1446 That link brings us to the documentation for the Engraver, the
1450 This engraver creates the following layout objects: @rinternals{Fingering}.
1453 In other words, once the @code{FingeringEvent}s are interpreted, the
1454 @code{Fingering_engraver} plug-in will process them.
1458 @c I can't figure out what this is supposed to mean. -gp
1460 The @code{Fingering_engraver} is also listed to create
1461 @rinternals{Fingering} objects,
1463 @c old info? it doesn't make any sense to me with our current docs.
1465 second bit of information listed under @b{See also} in the Notation
1470 内部リファレンスは HTML ドキュメント形式で入手可能です。@c
1471 内部リファレンスは、オンラインか HTML ドキュメントをダウンロードするかして、@c
1472 HTML 形式で読むことを強く推奨します。@c
1473 PDF マニュアルを使用していると、@c
1474 このセクションを理解するのはずっと困難になります。@c
1475 (訳者: 日本語では PDF 形式での提供はありません。)
1478 @rinternals{Fingering} へのリンクを辿ってください。@c
1479 ページの先頭に、以下のような記述があります:
1482 Fingering objects are created by: @rinternals{Fingering_engraver} and
1483 @rinternals{New_fingering_engraver}.
1486 内部リファレンスの中にある関連リンクを辿っていくことで、@c
1487 プログラム内部の情報フローを追っていくことができます:
1491 @item @rinternals{Fingering}:
1492 @rinternals{Fingering} objects are created by:
1493 @rinternals{Fingering_engraver}
1495 (@rinternals{Fingering}:
1496 @rinternals{Fingering} オブジェクトを作成するのは:
1497 @rinternals{Fingering_engraver})
1500 @item @rinternals{Fingering_engraver}:
1501 Music types accepted:
1502 @rinternals{fingering-event}
1504 (@rinternals{Fingering_engraver}:
1505 受け取る音楽タイプは: @rinternals{fingering-event})
1507 @item @rinternals{fingering-event}:
1508 Music event type @code{fingering-event} is in
1509 Music expressions named @rinternals{FingeringEvent}
1511 (@rinternals{fingering-event}:
1512 音楽イベント タイプ @code{fingering-event} は
1513 @rinternals{FingeringEvent} という名前の音楽表記の中にあります)
1516 このパスは、プログラム内部での情報フローとは逆向きです:
1517 出力からスタートして、入力イベントで終わっています。@c
1518 入力イベントからスタートして、情報フローを読み進め、@c
1519 最後は出力オブジェクトに辿り着くこともできます。
1521 内部リファレンスを通常のドキュメントのように読むこともできます。@c
1524 @rinternals{Music definitions},
1527 @code{Music definitions},
1529 @rinternals{Translation}, それに @rinternals{Backend} です。
1530 各章は、使用されているすべての定義と調整可能なすべてのプロパティを@c
1534 @node レイアウト インターフェイス
1535 @subsection レイアウト インターフェイス
1536 @translationof Layout interfaces
1538 @cindex interface, layout (レイアウト インターフェイス)
1539 @cindex layout interface (レイアウト インターフェイス)
1540 @cindex grob (グラフィカル オブジェクト)
1542 前のセクションで見た HTML ページには、@c
1543 @rinternals{Fingering} と呼ばれるレイアウト オブジェクトについての@c
1545 そのようなオブジェクトは楽譜で記号となります。@c
1546 レイアウト オブジェクトは (太さや向きのような) 数値を保持する@c
1548 関連オブジェクトへのポインタも持っています。@c
1549 レイアウト オブジェクトは @emph{Grob}
1550 -- これはグラフィカル オブジェクトを縮めたものです --
1552 Grob についての詳細は、@rinternals{grob-interface} を参照してください。
1554 @code{Fingering} のページは、@c
1555 @code{Fingering} オブジェクトの定義をリストアップしています。@c
1556 例えば、このページには以下のような記述があります:
1559 @code{padding} (dimension, in staff space):
1565 これは、この数値は少なくとも符頭の 0.5 倍の距離を保つということを意味します。
1568 各レイアウト オブジェクトは、記譜要素あるいは写植要素としての機能を@c
1570 例えば、@code{Fingering} オブジェクトは以下の側面を持っています:
1574 Its size is independent of the horizontal spacing, unlike slurs or beams.
1576 (このオブジェクトのサイズは、スラーや連桁と異なり、@c
1580 It is a piece of text. Granted, it is usually a very short text.
1582 (このオブジェクトはテキストです。通常、これは非常に短いテキストです。)
1585 That piece of text is typeset with a font, unlike slurs or beams.
1587 (このテキストは、スラーや連桁と異なり、フォントで写植されます。)
1590 Horizontally, the center of the symbol should be aligned to the
1591 center of the note head.
1593 (水平方向では、この記号の中心は符頭の中心に揃えられます。)
1596 Vertically, the symbol is placed next to the note and the staff.
1598 (垂直方向では、この記号は音符や譜の近く配置されます。)
1601 The vertical position is also coordinated with other superscript
1602 and subscript symbols.
1604 (また、垂直方向の位置は、他の上付き記号や下付き記号との調整によって決まります。)
1607 これらの側面はそれぞれ、いわゆる @emph{インターフェイス}
1609 それらは、@rinternals{Fingering} ページの最下部でリストアップされています。
1612 This object supports the following interfaces:
1614 (このオブジェクトは以下のインターフェイスをサポートします:)
1616 @rinternals{item-interface},
1617 @rinternals{self-alignment-interface},
1618 @rinternals{side-position-interface}, @rinternals{text-interface},
1619 @rinternals{text-script-interface}, @rinternals{font-interface},
1620 @rinternals{finger-interface}, and @rinternals{grob-interface}.
1624 それぞれのオブジェクト インターフェイスのページに行くことができます。@c
1625 各インターフェイスはいくつかのプロパティを持ちます。@c
1626 それらプロパティの中には、ユーザにとって役に立たないもの
1627 (@q{内部プロパティ}) もありますが、それ以外は変更可能です。
1629 これまで @code{Fingering} オブジェクトについて話してきましたが、@c
1630 これは実際にはそれほど多くのことをしているわけではありません。@c
1631 初期化ファイル (@rlearning{その他の情報源} を参照してください)
1632 @file{scm/define-grobs.scm} がこの @q{オブジェクト} の本質を示しています:
1637 (avoid-slur . around)
1638 (slur-padding . 0.2)
1639 (staff-padding . 0.5)
1640 (self-alignment-X . 0)
1641 (self-alignment-Y . 0)
1642 (script-priority . 100)
1643 (stencil . ,ly:text-interface::print)
1644 (direction . ,ly:script-interface::calc-direction)
1645 (font-encoding . fetaText)
1646 (font-size . -5) ; don't overlap when next to heads.
1647 (meta . ((class . Item)
1648 (interfaces . (finger-interface
1650 text-script-interface
1652 side-position-interface
1653 self-alignment-interface
1654 item-interface))))))
1659 @code{Fingering} オブジェクトは変数設定の塊に過ぎず、@c
1660 内部リファレンスの中にある Web ページは、@c
1661 この定義から直接生成されたに過ぎません。
1664 @node グラフィカル オブジェクト プロパティを決定する
1665 @subsection グラフィカル オブジェクト プロパティを決定する
1666 @translationof Determining the grob property
1668 @c TODO remove this (it's in the LM)
1669 @c Replace with more factual directions
1671 以下の @b{2} の位置を変更しようとしていたことを思い出してください:
1673 @lilypond[quote,fragment,relative=2,verbatim]
1679 垂直方向で見て、@b{2} は元の音符の隣に配置されるのですから、@c
1680 この配置に関連するインターフェイスに干渉する必要があります。@c
1681 これは @code{side-position-interface} を用いて行います。@c
1682 このインターフェイスについてのページには、以下のように記述されています:
1685 @code{side-position-interface}
1687 Position a victim object (this one) next to other objects (the
1688 support). The property @code{direction} signifies where to put the
1689 victim object relative to the support (left or right, up or down?)
1691 (対象オブジェクトを他のオブジェクト (サポート オブジェクト)
1693 このプロパティ @code{direction} は、@c
1694 対象オブジェクトをどこに配置するかを@c
1695 サポート オブジェクトからの相対位置で示します
1701 この記述の下に、以下のような変数 @code{padding} についての記述があります:
1706 (dimension, in staff space)
1709 Add this much extra space between objects that are next to each other.
1710 (隣り合うオブジェクトの間にスペースを付け加えます)
1714 @code{padding} の値を増やすことで、@c
1715 運指記号を符頭から離すことができます。@c
1716 以下のコマンドは、音符と運指記号の間に 3 譜スペースを挿入します:
1719 \once \override Voice.Fingering.padding = #3
1722 このコマンドを @code{Fingering} オブジェクトが作成される前に挿入する
1723 -- つまり @code{c2} の前に挿入する -- と、以下のような結果が得られます:
1725 @lilypond[quote,relative=2,fragment,verbatim]
1726 \once \override Voice.Fingering.padding = #3
1733 このケースでは、調整されるコンテキストは @code{Voice} です。@c
1734 このことは、内部リファレンスの @rinternals{Fingering_engraver}
1735 プラグインについてのページからわかります。@c
1736 このページには、以下のような記述があります:
1739 Fingering_engraver is part of contexts: @dots{} @rinternals{Voice}
1741 (Fingering_engraver は次のコンテキストの一部です: @dots{} @rinternals{Voice})
1747 @translationof Naming conventions
1749 内部リファレンスについて他に説明しておくべき事柄として、@c
1750 さまざまな命名規約についての概要があります:
1753 @item Scheme スタイル: 小文字の単語をハイフンでつなぎます
1754 (1 単語の名前を含みます) -- 例: lowercase-with-hyphens
1755 @item Scheme 関数: Scheme スタイルの先頭に @code{ly:} を付けます
1756 -- 例: ly:plus-scheme-style
1757 @item 音楽イベント、音楽クラス、それに音楽プロパティ: Scheme スタイルです
1758 -- 例: as-scheme-functions
1759 @item グラフィカル オブジェクト インターフェイス: Scheme スタイルです
1761 @item バックエンド プロパティ: Scheme スタイルです (が、X と Y があります!)
1762 @item コンテキスト (それに、音楽表記とグラフィカル オブジェクト):
1763 大文字で始まる単語、あるいはそれらをつなげます
1764 -- 例: Capitalized, CamelCase
1766 小文字で始まる単語に、大文字で始まる単語をつなげます
1767 -- 例: lowercaseFollowedByCamelCase
1769 大文字で始まる単語に、小文字で始まる単語をアンダスコアでつなげます
1770 -- 例: Capitalized_followed_by_lowercase_and_with_underscores
1775 @item 命名規約のうち、慣習なのはどれで、規則なのはどれか?
1776 @item 命名規約のうち、どれが基本言語の規則で、@c
1777 どれが LP (訳者: LilyPond?) 特有の規則なのか?
1783 @translationof Modifying properties
1785 @c TODO change the menu and subsection node names to use
1786 @c backslash once the new macro to handle the refs
1787 @c is available. Need to find and change all refs at
1788 @c the same time. -td
1801 @subsection プロパティ変更の概要
1802 @translationof Overview of modifying properties
1804 各コンテキストは、ある特定のタイプのグラフィカル オブジェクトを作成することに@c
1806 それらのオブジェクトを表示するために使用される設定も、@c
1808 それらの設定を変更することにより、オブジェクトの見た目を変えることができます。
1810 コンテキストに保存されるプロパティには 2 種類あります:
1811 コンテキスト プロパティとグラフィカル オブジェクト プロパティです。@c
1812 コンテキスト プロパティは、コンテキスト全体に適用され、@c
1813 コンテキスト自体をどのように表示するかを制御します。@c
1814 対照的に、グラフィカル オブジェクト プロパティは、コンテキストの中に表示される@c
1815 ある特定のタイプのグラフィカル オブジェクトに適用されます。
1817 @code{\set} コマンドと @code{\unset} コマンドは、@c
1818 コンテキスト プロパティの値を変更するために使用されます。@c
1819 @code{\override} コマンドと @code{\revert} コマンドは、@c
1820 グラフィカル オブジェクト プロパティの値を変更するために使用されます。
1823 The syntax for this is
1826 \override @var{context}.@var{name} #'@var{property} = #@var{value}
1829 Here @var{name} is the name of a graphical object, like
1830 @code{Stem} or @code{NoteHead}, and @var{property} is an internal
1831 variable of the formatting system (@q{grob property} or @q{layout
1832 property}). The latter is a symbol, so it must be quoted. The
1833 subsection @ref{Modifying properties}, explains what to fill in
1834 for @var{name}, @var{property}, and @var{value}. Here we only
1835 discuss the functionality of this command.
1840 \override Staff.Stem.thickness = #4.0
1844 makes stems thicker (the default is 1.3, with staff line thickness as a
1845 unit). Since the command specifies @code{Staff} as context, it only
1846 applies to the current staff. Other staves will keep their normal
1847 appearance. Here we see the command in action:
1849 @lilypond[quote,verbatim,relative=2,fragment]
1851 \override Staff.Stem.thickness = #4.0
1857 The @code{\override} command changes the definition of the @code{Stem}
1858 within the current @code{Staff}. After the command is interpreted
1859 all stems are thickened.
1861 Analogous to @code{\set}, the @var{context} argument may be left out,
1862 causing the default context @code{Voice} to be used. Adding
1863 @code{\once} applies the change during one timestep only.
1865 @lilypond[quote,fragment,verbatim,relative=2]
1867 \once \override Stem.thickness = #4.0
1872 The @code{\override} must be done before the object is
1873 started. Therefore, when altering @emph{Spanner} objects such as slurs
1874 or beams, the @code{\override} command must be executed at the moment
1875 when the object is created. In this example,
1877 @lilypond[quote,fragment,verbatim,relative=2]
1878 \override Slur.thickness = #3.0
1880 \override Beam.beam-thickness = #0.6
1885 the slur is fatter but the beam is not. This is because the command for
1886 @code{Beam} comes after the Beam is started, so it has no effect.
1888 Analogous to @code{\unset}, the @code{\revert} command for a context
1889 undoes an @code{\override} command; like with @code{\unset}, it only
1890 affects settings that were made in the same context. In other words, the
1891 @code{\revert} in the next example does not do anything.
1894 \override Voice.Stem.thickness = #4.0
1895 \revert Staff.Stem.thickness
1898 Some tweakable options are called @q{subproperties} and reside inside
1899 properties. To tweak those, use commands of the form
1901 @c leave this as a long long
1903 \override @var{context}.@var{name} #'@var{property} #'@var{subproperty} = #@var{value}
1910 \override Stem.details.beamed-lengths = #'(4 4 3)
1917 @rinternals{Backend},
1918 @rinternals{All layout objects},
1919 @rinternals{OverrideProperty},
1920 @rinternals{RevertProperty},
1921 @rinternals{PropertySet}
1926 バックエンドはオブジェクト プロパティのタイプ チェックを@c
1928 Scheme 値の循環参照は、ハング アップまたはクラッシュ、@c
1929 あるいは両方を引き起こす可能性があります。
1934 @subsection @code{\set} コマンド
1935 @translationof The set command
1937 @cindex properties (プロパティ)
1939 @cindex changing properties (プロパティを変更する)
1941 各コンテキストは @emph{プロパティ} の集合を持ちます。@c
1942 プロパティとは、コンテキストの中に保持されている変数です。@c
1943 コンテキスト プロパティは、@code{\set} コマンドによって変更されます。@c
1944 @code{\set} コマンドは以下のような構文を持ちます:
1947 \set @var{context}.@var{property} = #@var{value}
1950 @var{value} は Scheme オブジェクトですので、@c
1951 @code{#} 文字を前に置く必要があります。
1953 通常、コンテキスト プロパティの名前は、@c
1954 小文字で始まる単語に大文字で始まる単語をつなげたものです。@c
1955 これらはたいてい音楽から記譜への翻訳を制御します
1956 -- 例えば、@code{localAlterations} (臨時記号を表示するかどうかを決定します)
1957 や、@code{measurePosition} (小節線を表示するタイミングを決定します) です。@c
1958 コンテキスト プロパティは、楽曲の解釈をしている間、@c
1959 ずっと値を変更しておくことができます。@c
1960 @code{measurePosition} がその良い例です。@c
1961 コンテキスト プロパティは @code{\set} で変更されます。
1963 例えば、コンテキスト プロパティ @code{skipBars} が
1964 @code{#t} にセットされていれば、@c
1965 複小節休符は 1 つの小節に統合されます:
1967 @lilypond[quote,verbatim,relative=2,fragment]
1969 \set Score.skipBars = ##t
1973 @var{context} 引数が省略されている場合、@c
1974 プロパティはカレントの最下位のコンテキストにセットされます
1975 (一般に、@code{ChordNames}, @code{Voice}, @code{TabVoice},
1976 あるいは @code{Lyrics} です)。
1978 @lilypond[quote,fragment,verbatim]
1979 \set Score.autoBeaming = ##f
1982 \set autoBeaming = ##t
1990 変更は @q{オンザフライ} (その場、その時々) で適用されるため、@c
1991 設定 @code{\set autoBeaming = ##t} は 2 番目の 8 分音符グループだけに@c
1994 最下位コンテキストが常に変更しようとしているプロパティを持っているとは@c
1996 -- 例えば、@code{skipBars} プロパティをデフォルトの最下位コンテキスト
1997 (この場合は、@code{Voice} です) にセットしようと試みても、効果はありません。@c
1998 なぜなら、@code{skipBars} は @code{Score} コンテキストのプロパティだからです。
2000 @lilypond[quote,fragment,verbatim]
2006 コンテキストは階層構造をとるため、音楽表記を囲っているコンテキスト
2007 -- 例えば、@code{Staff} -- が指定された場合、@c
2008 変更はカレントの @code{Staff} の中にあるすべての @code{Voice} に適用されます。
2015 \unset @var{context}.@var{property}
2019 は、@var{context} から @var{property} の定義を削除するために使用されます。@c
2020 このコマンドは、@var{context} の中にセットされた場合にのみ、定義を削除します。@c
2021 音楽表記を囲っているコンテキストにセットされたプロパティは、@c
2022 囲まれているコンテキストの中にある @code{\unset} では変更されません:
2024 @lilypond[quote,fragment,verbatim]
2025 \set Score.autoBeaming = ##t
2029 \unset Score.autoBeaming
2038 最下位コンテキストに対しては @var{context} 引数を指定する必要はありません。@c
2042 \set Voice.autoBeaming = ##t
2043 \set autoBeaming = ##t
2047 は、カレントの最下位コンテキストが @code{Voice} であれば、等価です。
2051 @code{\set} の前に @code{\once} を置くと、@c
2052 その設定は単一の時間ステップにだけ適用されます:
2054 @lilypond[quote,fragment,verbatim]
2056 \once \set fontSize = #4.7
2061 利用可能なすべてのコンテキスト プロパティについての完全な記述は、@c
2065 @rinternals{Tunable context properties}.
2068 Translation @expansion{} Tunable context properties.
2073 @rinternals{Tunable context properties}
2077 @subsection @code{\override} コマンド
2078 @translationof The override command
2080 @cindex grob properties (グラフィカル オブジェクト プロパティ)
2081 @cindex properties, grob (グラフィカル オブジェクト プロパティ)
2084 特殊なタイプのコンテキスト プロパティがあります:
2085 グラフィカル オブジェクト記述です。@c
2086 グラフィカル オブジェクト記述には @code{StudlyCaps} という名前
2087 (大文字で始まります) が付けられています。@c
2088 これらは、関連リストとして、ある特定の種類のグラフィカル オブジェクト用の
2089 @q{デフォルト設定} を保持します。@c
2090 各グラフィカル オブジェクト記述の設定を調べるには、@c
2091 @file{scm/define-grobs.scm} を参照してください。@c
2092 各グラフィカル オブジェクト記述は @code{\override} を用いて変更します。
2094 @code{\override} コマンドの構文は以下の通りです:
2097 \override [@var{context}.]@var{GrobName}.@var{property} = #@var{value}
2100 例えば、@code{Stem} オブジェクトの @code{thickness} プロパティを@c
2101 オーバライドすることによって、符幹の太さを太くすることができます:
2103 @lilypond[quote,fragment,verbatim]
2105 \override Voice.Stem.thickness = #3.0
2109 @code{\override} でコンテキストが指定されていない場合、その下にある@c
2112 @lilypond[quote,fragment,verbatim]
2113 \override Staff.Stem.thickness = #3.0
2117 \override Stem.thickness = #0.5
2126 調整可能なオプションには @q{サブプロパティ} があり、これはプロパティの@c
2128 これを調整するには、以下のような形式のコマンドを用います:
2131 \override Stem.details.beamed-lengths = #'(4 4 3)
2134 また、スパナの端を変更するには、以下のようにします:
2137 \override TextSpanner.bound-details.left.text = #"left text"
2138 \override TextSpanner.bound-details.right.text = #"right text"
2142 @cindex reverting overrides (オーバライドを元に戻す)
2143 @cindex overrides, reverting (オーバライドを元に戻す)
2145 @code{\override} の効果は、@code{\revert} によって元に戻すことができます。
2147 @code{\revert} の構文は以下の通りです:
2150 \revert [@var{context}.]@var{GrobName}.@var{property}
2155 @lilypond[quote,verbatim]
2158 \override Voice.Stem.thickness = #3.0
2160 \revert Voice.Stem.thickness
2165 @code{\override} と @code{\revert} の効果は、@c
2166 その時点から影響を受けるコンテキストの中にある@c
2167 すべてのグラフィカル オブジェクトに適用されます:
2169 @lilypond[quote,verbatim]
2173 \override Staff.Stem.thickness = #3.0
2178 \revert Staff.Stem.thickness
2185 @cindex overriding for only one moment (一時的にオーバライドする)
2187 @code{\once} を @code{\override} と共に用いることで、@c
2188 カレントの時間ステップだけに効果を与えることができます:
2190 @lilypond[quote,verbatim]
2193 \override Stem.thickness = #3.0
2198 \once \override Stem.thickness = #3.0
2206 Commands which change output generally look like
2209 \override Voice.Stem.thickness = #3.0
2213 To construct this tweak we must determine these bits of information:
2216 @item the context: here @code{Voice}.
2217 @item the layout object: here @code{Stem}.
2218 @item the layout property: here @code{thickness}.
2219 @item a sensible value: here @code{3.0}.
2222 @cindex internal documentation
2223 @cindex finding graphical objects
2224 @cindex graphical object descriptions
2227 @cindex internal documentation
2229 For many properties, regardless of the data type of the property, setting the
2230 property to false ( @code{##f} ) will result in turning it off, causing
2231 LilyPond to ignore that property entirely. This is particularly useful for
2232 turning off grob properties which may otherwise be causing problems.
2234 We demonstrate how to glean this information from the notation manual
2235 and the program reference.
2240 @rinternals{Backend}
2244 @subsection @code{\tweak} コマンド
2245 @translationof The tweak command
2248 @cindex tweaking (調整)
2250 @code{\tweak} を用いたグラフィカル オブジェクト プロパティの変更は、@c
2251 コンテキストの中にあるすべてのグラフィカル オブジェクトに適用されます。@c
2253 影響を受けるコンテキストの中にあるすべてのグラフィカル オブジェクトではなく、@c
2254 1 つのグラフィカル オブジェクトだけに変更を適用したい場合もあります。@c
2255 そうするには、@code{\tweak} コマンドを用います。@c
2256 @code{\tweak} コマンドは以下のような構文を持ちます:
2259 \tweak [@var{layout-object}.]@var{grob-property} @var{value}
2262 @code{layout-object} の指定はオプションです。@c
2263 @code{\tweak} コマンドは、音楽の流れの中で
2264 @code{value} のすぐ後に現れる音楽オブジェクトに変更を適用します。
2267 In some cases, it is possible to take a short-cut for tuning
2268 graphical objects. For objects that are created directly from
2269 an item in the input file, you can use the @code{\tweak} command.
2272 @lilypond[verbatim,quote]
2278 \tweak duration-log #1
2288 The main use of the @code{\tweak} command is to modify just
2289 one of a number of notation elements which start at the same musical
2290 moment, like the notes of a chord, or tuplet brackets which start
2293 The @code{\tweak} command sets a property in the following object
2294 directly, without requiring the grob name or context to be
2295 specified. For this to work, it is necessary for the @code{\tweak}
2296 command to remain immediately adjacent to the object to which it is
2297 to apply after the input file has been converted to a music stream.
2298 This is often not the case, as many additional elements are inserted
2299 into the music stream implicitly. For example, when a note which is
2300 not part of a chord is processed, LilyPond implicitly inserts a
2301 @code{ChordEvent} event before the note, so separating the tweak
2302 from the note. However, if chord symbols are placed round the
2303 tweak and the note, the @code{\tweak} command comes after the
2304 @code{ChordEvent} in the music stream, so remaining adjacent to the
2305 note, and able to modify it.
2309 @lilypond[verbatim,fragment,quote]
2310 <\tweak color #red c''>4
2316 @lilypond[verbatim,fragment,quote]
2317 \tweak color #red c''4
2322 調整コマンドの構文と使用方法についての紹介は、@c
2323 @rlearning{調整手段} を参照してください。
2325 同じようなオブジェクトがいくつか、同じ音楽タイミングで配置されている場合、@c
2326 @code{\override} コマンドでそれらの 1 つだけを変更することはできません
2327 -- @code{\tweak} コマンドを用いる必要があります。@c
2328 同じ音楽タイミングで複数出現する可能性があるオブジェクトには、@c
2331 @c TODO expand to include any further uses of \tweak
2334 @item 1 つの音符に付けられるアーティキュレーション記号
2335 @item 和音の中にある音符の間に付けられるタイ
2339 @c TODO add examples of these
2341 @cindex chord, modifying one note in (和音の中にある音符の 1 つを変更する)
2343 以下の例では、和音の中にある符頭の 1 つの色を変更し、@c
2344 さらに他の符頭のタイプを変更しています:
2346 @lilypond[verbatim,fragment,quote]
2351 \tweak duration-log #1
2356 @code{\tweak} を用いて、スラーを変更することができます:
2358 @lilypond[verbatim,quote]
2359 \relative { c'-\tweak thickness #5 ( d e f) }
2363 @code{\tweak} コマンドが機能するためには、@c
2364 入力ファイルが音楽の流れに変換されたときに、@c
2365 @code{\tweak} コマンドのすぐ後に@c
2366 変更が適用されるオブジェクトが配置されている必要があります。
2367 和音全体に対する調整は何の効果もありません。@c
2368 なぜなら、和音の音楽イベントはコンテナと機能するだけで、すべてのレイアウト
2369 オブジェクトは @code{EventChord} の内部にあるイベントによって作成される@c
2372 @lilypond[verbatim,fragment,quote]
2373 \tweak color #red c''4
2374 \tweak color #red <c'' e''>4
2375 <\tweak color #red c'' e''>4
2378 単純な @code{\tweak} コマンドでは入力から直接作成されないオブジェクトを@c
2380 特に、符幹、自動連桁、それに臨時記号には効果を持ちません。@c
2381 なぜなら、それらは入力ストリームの中の音楽要素によって生成される@c
2382 のではなく、後になって @code{NoteHead} レイアウト オブジェクトによって@c
2385 そのような直接作成されないレイアウト オブジェクトは、グラフィカル
2386 オブジェクト名を明示的に指定した @code{\tweak} コマンドを用いることで@c
2389 @lilypond[fragment,verbatim,quote]
2390 \tweak Stem.color #red
2391 \tweak Beam.color #green c''8 e''
2392 <c'' e'' \tweak Accidental.font-size #-3 ges''>4
2395 @code{\tweak} コマンドで音部記号や拍子記号を変更することはできません。@c
2396 なぜなら、コンテキストを指定するために必要とされる追加要素の自動挿入に@c
2397 より、それらは前に配置された @code{\tweak} コマンドとは分離されるから@c
2400 記譜要素の前に複数の @code{\tweak} コマンドを配置することができます
2403 @lilypond[verbatim,fragment,quote]
2405 -\tweak style #'dashed-line
2406 -\tweak dash-fraction #0.2
2407 -\tweak thickness #3
2413 入力ファイルのあるセクションから生成される音楽の流れ
2414 -- 自動的に挿入される要素も含めて --
2416 @rextend{Displaying music expressions} を参照してください。@c
2417 これは、@code{\tweak} コマンドによって変更されるオブジェクトを決定するとき、@c
2419 @code{\tweak} の適用で入力を調整する方法を決定するときに役に立つかもしれません。
2426 @rextend{Displaying music expressions}
2429 @code{\tweak} コマンドで和音の中にある複数のタイのうち 1 つだけの位置を@c
2431 入力ファイルの中で最初に遭遇したタイの位置を変更してしまいます。
2433 @node set 対 override
2434 @subsection @code{\set} 対 @code{\override}
2435 @translationof set versus override
2437 @c TODO -- This section is probably unnecessary now.
2440 We have seen two methods of changing properties: @code{\set} and
2441 @code{\override}. There are actually two different kinds of
2444 @code{fontSize} is a special property: it is equivalent to
2445 entering @code{\override ... #'font-size} for all pertinent
2446 objects. Since this is a common change, the special
2447 property (modified with @code{\set}) was created.
2453 @subsection 連想配列を変更する
2454 @translationof Modifying alists
2456 ユーザが変更可能なプロパティの中には、@c
2457 内部的には @emph{連想配列} として存在しているものがあります
2458 -- 連想配列は @emph{キー} と @emph{値} のペアの配列を保持します。@c
2462 '((@var{キー1} . @var{値1})
2463 (@var{キー2} . @var{値2})
2464 (@var{キー3} . @var{値3})
2468 ある連想配列がグラフィカル オブジェクト プロパティまたは
2469 @code{\paper} 変数である場合、@c
2470 その連想配列の個々のキーを、他のキーに影響を与えることなく、@c
2473 例えば、譜グループの中にある隣り合う譜間のスペースを減らすには、@c
2474 @code{StaffGrouper} グラフィカル オブジェクトの
2475 @code{staff-staff-spacing} プロパティを使用します。@c
2477 -- @code{basic-distance}, @code{minimum-distance},
2478 @code{padding}, それに @code{stretchability} --
2481 内部リファレンスの @qq{Backend} セクションでリストアップされています
2482 (@rinternals{StaffGrouper} を参照してください):
2485 '((basic-distance . 9)
2486 (minimum-distance . 7)
2488 (stretchability . 5))
2491 譜間のスペースを小さくする方法の 1 つは、@c
2492 @code{basic-distance} キーの値 (@code{9}) を
2493 @code{minimum-distance} キーの値 (@code{7}) 近くまで減らすことです。@c
2494 個々のキーを変更するには、@emph{ネストされた宣言} を使います:
2497 @lilypond[quote,verbatim]
2500 \new Staff { \clef treble c''1 }
2501 \new Staff { \clef bass c1 }
2505 \new PianoStaff \with {
2506 % this is the nested declaration
2507 \override StaffGrouper.staff-staff-spacing.basic-distance = #7
2509 \new Staff { \clef treble c''1 }
2510 \new Staff { \clef bass c1 }
2514 ネストされた宣言は、プロパティの他のキーに変更を加えることなく、@c
2515 指定されたキー (上の例では @code{basic-distance}) を更新します。
2517 今度は、譜を重ならない範囲でできる限り近づけたいとします。@c
2518 最も簡単な方法は、連想配列の 4 つのキーすべてを 0 にセットすることです。@c
2519 しかしながら、4 つのネストされた宣言を記述する必要はありません。@c
2520 1 つの宣言でプロパティを丸ごと再定義することができます:
2522 @lilypond[quote,verbatim]
2523 \new PianoStaff \with {
2524 \override StaffGrouper.staff-staff-spacing =
2525 #'((basic-distance . 0)
2526 (minimum-distance . 0)
2528 (stretchability . 0))
2530 \new Staff { \clef treble c''1 }
2531 \new Staff { \clef bass c1 }
2535 連想配列の再定義でリストアップされなかったキーは、@c
2536 @emph{セットされなかった場合のデフォルト値} にリセットされます。@c
2537 @code{staff-staff-spacing} の場合、@c
2538 セットされなかったキーは 0 にリセットされます
2539 (@code{stretchability} は例外で、セットされなかった場合、@c
2540 @code{basic-distance} にリセットされます)。@c
2541 このため、以下の 2 つの宣言は等価です:
2544 \override StaffGrouper.staff-staff-spacing =
2545 #'((basic-distance . 7))
2547 \override StaffGrouper.staff-staff-spacing =
2548 #'((basic-distance . 7)
2549 (minimum-distance . 0)
2551 (stretchability . 7))
2554 連想配列の再定義でリストアップされなかったキーがあることにより、@c
2556 入力ファイルがコンパイルされるときに読み込まれた@c
2557 標準設定が (意図せずに) 削除される可能性があります。@c
2558 上の例では、@code{padding} と @code{minimum-distance} の標準設定
2559 (@file{scm/define-grobs.scm} で定義されます) は、@c
2560 @emph{セットされなかった場合のデフォルト値} (両方とも 0) にリセットされます。@c
2561 プロパティや (任意のサイズ) 連想配列を定義した場合、@c
2562 セットされなかったキー値はすべて @emph{セットされなかった場合のデフォルト値}
2564 そうすることを意図しているのでない限り、@c
2565 ネストされた宣言を用いてキー値を個々に更新する方が安全です。
2567 @warning{ネストされた宣言は、コンテキスト プロパティ連想配列
2568 (@code{beamExceptions}, @code{keyAlterations}, @code{timeSignatureSettings} 等)
2571 連想配列として丸ごと再定義するしかありません。}
2574 @node 役に立つコンセプトとプロパティ
2575 @section 役に立つコンセプトとプロパティ
2576 @translationof Useful concepts and properties
2593 @translationof Input modes
2595 入力ファイルの中に保持されている記譜を解釈する方法は、@c
2596 カレントの入力モードによって決定されます。
2600 このモードは @code{\chordmode} コマンドで有効になり、@c
2601 入力はコード記譜法の構文で解釈されるようになります。@c
2602 @ref{Chord notation} を参照してください。@c
2603 コードは、譜面上に音符として描画されます。
2605 和音モードは @code{\chords} コマンドでも有効になります。@c
2606 このコマンドは新たに @code{ChordNames} コンテキストも作成します。@c
2607 入力はコード記譜法の構文で解釈され、@c
2608 さらに @code{ChordNames} コンテキストの中にコード ネームとして描画されます。@c
2609 @ref{Printing chord names} を参照してください。
2613 このモードは @code{\drummode} コマンドで有効になり、@c
2614 入力はドラム記譜法の構文で解釈されるようになります。@c
2615 @ref{Basic percussion notation} を参照してください。
2617 また、ドラム モードは @code{\drums} コマンドでも有効になります。@c
2618 このモードも新たに @code{DrumStaff} コンテキストを作成し、@c
2619 コマンドの後に続く入力をドラム記譜法の構文で解釈して、@c
2620 ドラム譜上にドラム記号として描画します。@c
2621 @ref{Basic percussion notation} を参照してください。
2625 このモードは @code{\figuremode} コマンドで有効になり、@c
2626 入力は通奏低音の構文で解釈されるようになります。@c
2627 @ref{Entering figured bass} を参照してください。
2629 また、音型モードは @code{\figures} コマンドでも有効になります。@c
2630 このモードも新たに @code{FiguredBass} コンテキストを作成し、@c
2631 コマンドの後に続く入力を通奏低音の構文で解釈して、@c
2632 @code{FiguredBass} コンテキストの中に通奏低音記号として描画します。@c
2633 @ref{Introduction to figured bass} を参照してください。
2635 @strong{フレットとタブ モード}
2637 フレット記号とタブ記号を入力するための特別な入力モードはありません。
2639 タブ図を作成するには、音符モードで音符や和音を入力して、@c
2640 それらを @code{TabStaff} コンテキストの中に描画します。@c
2641 @ref{Default tablatures} を参照してください。
2643 譜の上にフレット図を作成するには、2 つの方法があります。@c
2644 @code{FretBoards} コンテキスト
2645 (@ref{Automatic fret diagrams} を参照してください) を用いるか、@c
2646 あるいは、音符の上に @code{\fret-diagram} コマンド
2647 (@ref{Fret diagram markups}) を用いてフレット図をマークアップとして@c
2652 このモードは @code{\lyricmode} コマンドで有効になり、@c
2653 入力はオプションで演奏時間を持つ歌詞音節として解釈され、@c
2655 通奏低音の構文で解釈されるようになります。@c
2656 @ref{Vocal music} を参照してください。
2658 また、歌詞モードは @code{\addlyrics} コマンドでも有効になります。@c
2659 このモードも新たに @code{Lyrics} コンテキストを作成し、@c
2660 暗黙的に @code{lyricsto} コマンドを作成します。@c
2661 @code{lyricsto} は、後に続く歌詞を、前にある音楽に関連付けします。
2665 このモードは @code{\markup} コマンドで有効になり、@c
2666 入力はマークアップの構文で解釈されるようになります。@c
2667 @ref{Text markup commands} を参照してください。
2669 @c silly work-around for texinfo broken-ness
2670 @c (@strong{Note...} causes a spurious cross-reference in Info)
2673 このモードはデフォルトのモードであり、@c
2674 @code{\notemode} コマンドで有効にすることもできます。@c
2675 入力はピッチ、演奏時間、マークアップなどとして解釈され、@c
2678 通常、音符モードを明示的に指定する必要はありません。@c
2680 -- 例えば、歌詞モード、和音モード、あるいは他のモードを使っていて、@c
2681 音符モードの構文でしか入力できないものを入力しようとしている場合 --
2682 では、音符モードを明示的に指定することが有用な場合があります。
2684 例えば、合唱曲で節ごとに強弱記号を指定するには、@c
2685 音符モードで入力して記号を解釈させる必要があります:
2687 @lilypond[verbatim,relative=2,quote]
2690 \notemode{\set stanza = \markup{ \dynamic f 1. } }
2694 \notemode{\set stanza = \markup{ \dynamic p 2. } }
2702 @translationof Direction and placement
2704 楽譜を写植しているとき、多くの要素の向きと配置には選択の余地があります。@c
2705 例えば、音符の符幹は上向きあるいは下向きにすることができ、@c
2706 歌詞、強弱記号、他の表現記号は譜の上あるいは下に配置することができ、@c
2707 テキストは左揃え、右揃え、あるいは中央揃えにすることができる、などです。@c
2708 これらの選択のほとんどは LilyPond によって自動的に決定されますが、@c
2709 強制的に向きや配置を指定することが望ましい場合もあります。
2712 * アーティキュレーションの方向指示子::
2716 @node アーティキュレーションの方向指示子
2717 @unnumberedsubsubsec アーティキュレーションの方向指示子
2718 @translationof Articulation direction indicators
2720 デフォルトでは、アーティキュレーションのいくつかの向きは常に上または下に@c
2721 なっています (例えば、強弱記号やフェルマータ)。@c
2722 一方、他のアーティキュレーションは、符幹の向きによって、@c
2723 向きが上下します (スラーやアクセントなど)。
2725 @c TODO Add table showing these
2727 アーティキュレーションの前に @emph{方向指示子} を置くことで、@c
2728 デフォルトの向きをオーバライドすることができます。@c
2729 3 つの方向指示子があります: @code{^} (@qq{上向き} を意味します)、@c
2730 @code{_} (@qq{下向き} を意味します)、@c
2731 それに @code{-} (@qq{デフォルトの向き} を意味します) です。@c
2732 通常、方向指示子は省略することができ、その場合は @code{-} と見なされます。@c
2733 しかしながら、以下のものの前には @strong{常に} 方向指示子を置く必要があります:
2736 @item @code{\tweak} コマンド
2737 @item @code{\markup} コマンド
2738 @item @code{\tag} コマンド
2739 @item 文字列マークアップ。例えば、-"string"
2740 @item 運指指示。例えば、@code{-1}
2741 @item アーティキュレーションの短縮記法。例えば、@code{-.}, @code{->}, @code{--}
2744 方向指示子は、その後にくる音符だけに効果を持ちます:
2746 @lilypond[verbatim,quote]
2756 @unnumberedsubsubsec 方向プロパティ
2757 @translationof The direction property
2759 多くのレイアウト オブジェクトの位置や向きは、@c
2760 @code{direction} プロパティによって制御されます。
2762 @code{direction} プロパティの値は、@c
2763 @code{1} (@qq{上向き} あるいは @qq{上} を意味します)、@c
2764 @code{-1} (@qq{下向き} あるいは @qq{下} を意味します)
2766 記号 @code{UP} と @code{DOWN} は、@c
2767 それぞれ @code{1} と @code{-1} の代わりに用いることができます。@c
2769 @code{direction} を @code{0} あるいは @code{CENTER} にセットします。@c
2771 多くの場合で、向きを指定するための前置コマンドが存在しています。@c
2772 それらはすべて以下のような形式をとります:
2775 @code{\xxxUp}, @code{xxxDown}, @code{xxxNeutral}
2778 ここで、@code{xxxNeutral} は @qq{デフォルトの向きを使用する}
2780 @rlearning{譜内部オブジェクト} を参照してください。
2783 -- 一般的な例としてはアルペジオしかありません --
2784 @code{direction} プロパティの値は、@c
2785 オブジェクトが親オブジェクトの左右どちらに配置されるかを指定します。
2786 この場合、@code{-1} あるいは @code{LEFT} は @qq{左側} を意味し、@c
2787 @code{1} あるいは @code{RIGHT} は @qq{右側} を意味します。@c
2788 @code{0} あるいは @code{CENTER} は、前のケースと同様に、@c
2789 @qq{デフォルトの向きを使用する} ことを意味します。
2792 These all have side-axis set to #X
2793 AmbitusAccidental - direction has no effect
2795 StanzaNumber - not tried
2796 TrillPitchAccidental - not tried
2797 TrillPitchGroup - not tried
2800 これらの指示子は、キャンセルされるまで効果を持ちます。
2802 @lilypond[verbatim,quote]
2813 多声の音楽では、一般的にオブジェクトの向きを変えるよりも明示的に
2814 @code{voice} を指定した方が良いです。@c
2815 更なる情報は、@ref{Multiple voices} を参照してください。
2819 @rlearning{Within-staff objects}
2822 @ref{Multiple voices}
2826 @subsection 距離と距離の単位
2827 @translationof Distances and measurements
2829 @cindex distances, absolute (絶対距離)
2830 @cindex distances, scaled (相対距離)
2837 LilyPond における距離には 2 つのタイプがあります: 絶対距離と相対距離です。
2839 絶対距離は、マージン、インデント、それにその他の詳細なページ レイアウトを@c
2840 指定するために使用され、デフォルトではミリメートルで指定されます。
2841 距離は以下の単位で指定することもできます: @code{\mm}, @code{\cm},
2842 @code{\inch} (インチ), それに @code{\pt} (ポイント。1/73.27 インチ) です。@c
2843 また、ページ レイアウトにおける距離は、@c
2844 値の後ろに @code{\staff-space} を付けることにより、
2845 比率で指定することもできます (次の段落を参照してください)。@c
2846 ページ レイアウトについての詳細は、@c
2847 @ref{Page layout} に記述されています。
2849 相対距離は常に譜スペースを単位として指定されます
2850 -- 稀に、半譜スペースが使用されます。@c
2851 譜スペースは隣り合う 2 本の譜線間の距離です。@c
2852 グローバル譜サイズを設定することにより、@c
2853 デフォルト値をグローバルに変更することができます。@c
2854 また、@code{StaffSymbol} の @code{staff-space} プロパティを@c
2855 変更することにより、譜スペースをローカルにオーバライドすることもできます。@c
2856 相対距離は、グローバル譜サイズや @code{StaffSymbol} の @code{staff-space}
2857 プロパティのいずれかが変更されると、自動的に変更されます。@c
2858 しかしながら、フォントの比率はグローバル譜サイズが変更された場合にのみ、@c
2861 容易に描画される楽譜全体のサイズを変更することができます。@c
2862 グローバル譜サイズを設定するための手段については、@c
2863 @ref{譜サイズを設定する} を参照してください。
2867 楽譜のある部分だけの比率を変更したいのなら
2868 -- 例えば、オッシア セクションや脚注で --
2869 単純にグローバル譜サイズを変更するわけにはいきません。@c
2870 なぜなら、グローバル譜サイズを変更すると、楽譜全体が影響を受けるからです。@c
2871 そのような場合、@code{StaffSymbol} の @code{staff-space} プロパティと@c
2872 フォントのサイズをオーバライドすることにより、サイズを変更します。@c
2873 フォント サイズの変更を @code{staff-space} 単位の変更に変換するには、@c
2874 Scheme 関数 @code{magstep} を使用することができます。@c
2876 @rlearning{オブジェクトの長さと太さ} を参照してください。
2880 @rlearning{オブジェクトの長さと太さ}
2887 @c 2017-9-22 このノードのみ先に翻訳
2888 @c 第1章のxrefを正しく動作させるため。
2891 @translationof Dimensions
2893 @cindex dimensions (寸法)
2894 @cindex bounding box (バウンディング ボックス)
2896 グラフィカル オブジェクトの寸法 (大きさ) は、オブジェクトの@c
2897 バウンディング ボックスの左右端の位置、上下端の位置を指定します。@c
2898 これらはオブジェクトの参照ポイントからの距離で指定し、単位は譜スペースです。@c
2899 これらの位置は通常 2 つの Scheme ペアで表現します。@c
2900 例えば、テキスト マークアップ コマンド @code{\with-dimensions} は
2901 3 つの引数を取り、最初の 2 つが左右端の位置と上下端の位置を示す
2905 \with-dimensions #'(-5 . 10) #'(-3 . 15) @var{arg}
2908 これは @var{arg} のバウンディング ボックスの@c
2909 左端を -5, 右端を 10, 下端を -3, 上端を 15 に指定しています。@c
2910 全てオブジェクトの参照ポイントから、譜スペースの単位で計測されています。
2918 @subsection 譜記号プロパティ
2919 @translationof Staff symbol properties
2921 @cindex adjusting staff symbol (譜記号を調節する)
2922 @cindex drawing staff symbol (譜記号を描画する)
2923 @cindex staff symbol, setting of (譜記号の設定)
2925 @c TODO Extend or remove this section. See also NR 1.6.2 Staff symbol
2926 @c Need to think of uses for these properties. Eg 'line-positions
2927 @c is used in a snippet to thicken centre line.
2928 @c If retained, add @ref to here in 1.6.2 -td
2930 譜線の垂直位置と譜線の本数を同時に定義することができます。@c
2931 以下の例が示すように、音符の位置は譜線の位置には影響されません。
2933 @warning{@code{'line-positions} プロパティは @code{'line-count} を@c
2935 譜線の本数は、@code{'line-positions} の値リストの中にある要素数によって、@c
2938 @lilypond[verbatim,quote]
2940 \override StaffSymbol.line-positions = #'(7 3 0 -4 -6 -7)
2942 \relative { a4 e' f b | d1 }
2947 譜内部のオブジェクトのスペースは、この設定によって影響を受けません。
2949 @lilypond[verbatim,quote]
2951 \override StaffSymbol.width = #23
2953 \relative { a4 e' f b | d1 }
2959 @translationof Spanners
2961 多くの音楽記譜オブジェクトは、複数の音符あるいは複数の小節にまたがって、@c
2963 例としては、スラー、連桁、連譜の囲み、volta 繰り返しの囲み、クレッシェンド、@c
2964 トリル、それにグリッサンドがあります。@c
2965 そのようなオブジェクトは総称して @qq{スパナ} と呼ばれ、@c
2966 それらの見た目と振る舞いを制御するための特殊なプロパティを持ちます。@c
2967 これらのプロパティのいくつかは、すべてのスパナに共通しています。@c
2968 他のプロパティはスパナの部分集合に限定されています。
2970 すべてのスパナは @code{spanner-interface} をサポートします。@c
2971 いくつかのスパナ -- 2 つのオブジェクトの間に直線を描くもの -- は、さらに、@c
2972 @code{line-spanner-interface} をサポートします。
2975 * spanner-interface を使用する::
2976 * line-spanner-interface を使用する::
2979 @node spanner-interface を使用する
2980 @unnumberedsubsubsec @code{spanner-interface} を使用する
2981 @translationof Using the spanner-interface
2984 いくつかのスパナに適用される 2 つのプロパティを提供します。
2986 @subsubsubheading The @code{minimum-length} プロパティ
2988 スパナの最短の長さは、@code{minimum-length} プロパティによって指定されます。@c
2989 通常、このプロパティを増加させると、@c
2990 スパナの両端の間にある音符の間隔は増加します。@c
2991 しかしながら、このオーバライドは多くのスパナで効果を持ちません。@c
2992 なぜなら、それらの長さは他の要素によって決定されるからです。@c
2993 以下に効果を持つ例を 2, 3 示します。
3003 Works as long as callback is made:
3007 Works not at all for:
3017 @lilypond[verbatim,quote,fragment]
3021 -\tweak minimum-length #5
3026 @lilypond[verbatim,quote,relative=2]
3028 \compressFullBarRests
3031 \once \override MultiMeasureRest.minimum-length = #20
3037 @lilypond[verbatim,quote]
3041 \override Hairpin.minimum-length = #20
3046 さらに、このオーバライドはスラーとフレージング スラーの長さを@c
3049 @lilypond[verbatim,quote]
3053 -\tweak minimum-length #5
3058 -\tweak minimum-length #5
3063 いくつかのレイアウト オブジェクトでは、@c
3064 @code{minimum-length} プロパティは、@c
3065 @code{set-spacing-rods} プロシージャが明示的に呼び出された場合にのみ@c
3067 このプロシージャを呼び出すには、@code{springs-and-rods} プロパティに@c
3068 @code{ly:spanner::set-spacing-rods} をセットしておく必要があります。@c
3070 @code{springs-and-rods} プロパティが設定されていない限り、@c
3074 @lilypond[verbatim,fragment,quote]
3079 \once \override Glissando.minimum-length = #20
3082 % 以下の両方のオーバライドが存在する場合にのみ、効果を持ちます
3083 \once \override Glissando.minimum-length = #20
3084 \once \override Glissando.springs-and-rods = #ly:spanner::set-spacing-rods
3088 @code{Beam} オブジェクトでも同じことが言えます:
3091 @lilypond[verbatim,fragment,quote]
3093 \once \override Beam.minimum-length = #20
3096 % 以下の両方のオーバライドが存在する場合にのみ、効果を持ちます
3097 \once \override Beam.minimum-length = #20
3098 \once \override Beam.springs-and-rods = #ly:spanner::set-spacing-rods
3102 @subsubsubheading The @code{to-barline} プロパティ
3104 @code{spanner-interface} の 2 番目に有用なプロパティは
3105 @code{to-barline} です。@c
3106 デフォルトではこのプロパティは真であり、@c
3107 小節の最初の音符のところで終了するヘアピンや他のスパナは@c
3108 直前の小節線のところで終了させられます。@c
3109 偽に設定すると、スパナは小節線を越えて、音符のところで終了します:
3111 @lilypond[verbatim,quote]
3113 a' \< a a a a \! a a a \break
3114 \override Hairpin.to-barline = ##f
3115 a \< a a a a \! a a a
3119 このプロパティはすべてのスパナに対して効果を持つわけではありません。@c
3120 例えば、スラーやフレージング スラー、@c
3121 あるいは小節線で終了させることに意味が無い他のスパナに対して、@c
3122 このプロパティを @code{#t} に設定しても効果がありません。
3124 @node line-spanner-interface を使用する
3125 @unnumberedsubsubsec @code{line-spanner-interface} を使用する
3126 @translationof Using the line-spanner-interface
3128 @code{line-spanner-interface} をサポートするオブジェクトには@c
3132 @item @code{DynamicTextSpanner}
3133 @item @code{Glissando}
3134 @item @code{TextSpanner}
3135 @item @code{TrillSpanner}
3136 @item @code{VoiceFollower}
3139 これらのスパナのステンシルを描画する責任を持つルーチンは
3140 @code{ly:line-interface::print} です。@c
3141 このルーチンはスパナの両端の位置を綿密に決定し、@c
3142 求めに応じたスタイルでそれらの間に線を描きます@c
3143 スパナの両端の位置はオンザフライ (その場、その時々) で算出されますが、@c
3144 それらの Y 座標をオーバライドすることができます。@c
3146 プロパティ階層内で 2 階層下にネストされていますが、@c
3147 この @code{\override} コマンドは非常にシンプルです:
3149 @lilypond[quote,fragment,verbatim]
3151 \once \override Glissando.bound-details.left.Y = #3
3152 \once \override Glissando.bound-details.right.Y = #-2
3156 @code{Y} プロパティの単位は @code{staff-space} であり、@c
3158 グリッサンドでは、スパナの両端は各符頭の中心であり、@c
3159 @code{Y} はそれらの点を上下させます。
3161 @code{Y} が設定されていない場合、@c
3162 値はスパナの両端の垂直位置から算出されます。
3164 改行の場合、終点の @code{Y} の値は @code{bound-details} の@c
3165 部分リスト @code{left-broken} や @code{right-broken} のによって指定されます。@c
3168 @lilypond[relative=2,ragged-right,verbatim,fragment]
3169 \override Glissando.breakable = ##t
3170 \override Glissando.bound-details.right-broken.Y = #-3
3171 c1 \glissando \break
3176 @code{bound-details} プロパティの部分リスト @code{left} や @code{right} の@c
3177 下位プロパティのいくつかは、@code{Y} と同じ方法で変更することができます:
3182 譜の中央線からの @code{staff-space} オフセットで、設定します。@c
3183 デフォルトでは、終点オブジェクトの中心です。@c
3184 ですから、グリッサンドは符頭の中心に向かって進みます。
3186 水平方向に広がるスパナ -- テキスト スパナやトリル スパナなど --
3187 では、この値は 0 に固定されています。
3190 スパナのラインがオブジェクトの左右どちらから始まり、終わるのかを決定します。@c
3191 @code{-1} (あるいは @code{LEFT}) であれば、@c
3192 ラインは符頭の左側から開始あるいは終了します。
3196 通常、オンザフライ (その場、その時々) で算出され、@c
3197 これをオーバライドしてもあまり意味がありません。
3200 ライン スパナは開始点や終了点で記号を持つ場合があり、@c
3201 その記号はこのサブ プロパティに保持されています。@c
3202 このサブ プロパティは内部で使用するためのものです。@c
3203 このサブ プロパティの代わりに @code{text} を使用することを推奨します。
3206 ステンシルを作成するために評価されるマークアップです。@c
3207 水平スパナに @i{cresc.}, @i{tr} それに他のテキストを配置するために使用されます。
3209 @lilypond[quote,ragged-right,fragment,relative=2,verbatim]
3210 \override TextSpanner.bound-details.left.text
3211 = \markup { \small \bold Slower }
3212 c2\startTextSpan b c a\stopTextSpan
3215 @item stencil-align-dir-y
3216 @item stencil-offset
3218 ステンシルは、@code{X} と @code{Y} サブ プロパティで定義されたとおりに、@c
3219 ラインに中央揃えで、終点に配置されます。@c
3220 @code{stencil-align-dir-y} あるいは @code{stencil-offset} の@c
3224 @lilypond[relative=1,fragment,verbatim]
3225 \override TextSpanner.bound-details.left.stencil-align-dir-y = #-2
3226 \override TextSpanner.bound-details.right.stencil-align-dir-y = #UP
3228 \override TextSpanner.bound-details.left.text = #"ggg"
3229 \override TextSpanner.bound-details.right.text = #"hhh"
3230 c4^\startTextSpan c c c \stopTextSpan
3234 負の値はテキストを @emph{上げる} ということに注意してください。@c
3235 なぜなら、@code{-1} あるいは @code{DOWN} は@c
3236 テキストの @emph{下端} をスパナ ラインに揃え、
3237 @code{1} あるいは @code{UP} は@c
3238 テキストの @emph{上端} をスパナ ラインに揃えるからです。
3241 このサブ プロパティに @code{#t} をセットするとラインの終点に矢印が描かれます。
3244 このサブ プロパティはラインの終点と実際の終点の間のスペースを制御します。@c
3245 パディングがなければ、グリッサンドは両端の符頭の中心から描かれます。
3249 音楽関数 @code{\endSpanners} は@c
3250 直後の音符から始まるスパナをすぐに終了させます。@c
3251 ちょうど 1 音符分でスパナを終了させますが、@c
3252 @code{to-barline} が真で、かつ、次の音符の前に小節線がある場合は@c
3253 その小節線のところでスパナを終了させます。
3255 @lilypond[verbatim,quote,ragged-right,relative=2,fragment]
3257 c2 \startTextSpan c2 c2
3262 @code{\endSpanners} を使用している場合、@c
3263 @code{\startTextSpan} を @code{\endTextSpan} で閉じる必要はなく、@c
3264 ヘアピンを @code{\!} で閉じる必要もありません。
3268 @rinternals{TextSpanner},
3269 @rinternals{Glissando},
3270 @rinternals{VoiceFollower},
3271 @rinternals{TrillSpanner},
3272 @rinternals{line-spanner-interface}
3276 @subsection オブジェクトの可視性
3277 @translationof Visibility of objects
3279 @cindex objects, visibility of (オブジェクトの可視性)
3280 @cindex grobs, visibility of (グラフィカル オブジェクトの可視性)
3281 @cindex visibility of objects (オブジェクトの可視性)
3283 レイアウト オブジェクトの可視性を制御する主な方法は 4 つあります:
3284 オブジェクトのステンシルを削除する方法、オブジェクトを透明にする方法、@c
3285 オブジェクトの色を白にする方法、あるいは、@c
3286 オブジェクトの @code{break-visibility} プロパティをオーバライドする方法です。
3287 最初の 3 つの方法はすべてのレイアウト オブジェクトに適用されますが、@c
3288 最後の方法はいくつかの -- @emph{改行可能な} オブジェクト --
3290 学習マニュアルでは、これら 4 つのテクニックについて紹介しています。@c
3291 @rlearning{オブジェクトの可視性と色} を参照してください。
3293 さらに、特定のレイアウト オブジェクト特有のテクニックがいくつかあります。@c
3294 それらについては、特別な考慮でカバーされています。
3300 * break-visibility を用いる::
3306 @unnumberedsubsubsec ステンシルを削除する
3307 @translationof Removing the stencil
3309 @cindex stencil, removing (ステンシルを削除する)
3311 レウアウト オブジェクトはそれぞれステンシル プロパティを持ちます。@c
3313 このプロパティはそのオブジェクトを描画する特殊な関数にセットされています。@c
3314 このプロパティが @code{#f} にオーバライドされた場合、@c
3315 関数は呼び出されず、そのオブジェクトは描画されません。@c
3316 @code{\rever} でデフォルトの動作に戻すことができます。
3318 @lilypond[quote,fragment,verbatim]
3322 \undo \omit Score.BarLine
3327 @unnumberedsubsubsec オブジェクトを透明にする
3328 @translationof Making objects transparent
3330 @cindex transparent, making objects (オブジェクトを透明にする)
3332 レイアウト オブジェクトはそれぞれ @code{transparent} プロパティを持っていて、@c
3333 デフォルトでは @code{#f} にセットされています。@c
3334 @code{#t} にセットされると、そのオブジェクトはスペースを占めたままですが、@c
3337 @lilypond[quote,fragment,verbatim]
3339 \once \hide NoteHead
3344 @unnumberedsubsubsec オブジェクトを白で描く
3345 @translationof Painting objects white
3347 @cindex objects, coloring (オブジェクトに色を付ける)
3348 @cindex coloring objects (オブジェクトに色を付ける)
3349 @cindex layers (レイヤ)
3350 @cindex printing order (描画の順番)
3351 @cindex overwriting objects (オブジェクトを上書きする)
3352 @cindex objects, overwriting (オブジェクトを上書きする)
3353 @cindex grobs, overwriting (グラフィカル オブジェクトを上書きする)
3355 レイアウト オブジェクトはそれぞれ @code{color} プロパティを持っていて、@c
3356 デフォルトでは @code{black} にセットされています。@c
3357 このプロパティが @code{white} にセットされてると、@c
3358 そのオブジェクトは白い背景と区別が付かなくなります。@c
3359 しかしながら、そのオブジェクトが他のオブジェクトと交差している場合、@c
3360 交差している場所の色はオブジェクトの描画順序によって決定されます。@c
3362 白いオブジェクトの画像が幽霊のように浮かび上がることがあります:
3364 @lilypond[quote,fragment,verbatim]
3365 \override Staff.Clef.color = #white
3369 オブジェクトの描画順序を変更することにより、これを回避することができます。@c
3370 すべてのレイアウト オブジェクトは @code{layer} プロパティを持っており、@c
3371 このプロパティには整数がセットされています。@c
3372 より小さな値の @code{layer} を持つオブジェクトが最初に描画され、@c
3373 より大きな値の @code{layer} を持つオブジェクトが後になってから描画されます。@c
3375 より大きな値を持つオブジェクトがより小さな値を持つオブジェクトを上書きします。@c
3377 たいていのオブジェクトの @code{layer} には @code{1} が代入されています。@c
3379 -- @code{StaffSymbol} や @code{BarLine} など --
3380 には @code{0} が代入されています。@c
3381 同じ値の @code{layer} を持つオブジェクトを描画する順番は不確定です。
3384 (この @code{layer} のデフォルト値は @code{1} です)
3386 (この @code{layer} のデフォルト値は @code{0} です)
3388 そのため、音部記号は譜線を上書きしています。@c
3389 これを変更するには、@code{Clef} オブジェクトの @code{layer} に@c
3390 より小さな値 -- 例えば、@code{-1} -- を与えて、@c
3391 音部記号を先に描画させる必要があります:
3393 @lilypond[quote,fragment,verbatim]
3394 \override Staff.Clef.color = #white
3395 \override Staff.Clef.layer = #-1
3399 @node break-visibility を用いる
3400 @unnumberedsubsubsec break-visibility を用いる
3401 @translationof Using break-visibility
3403 @c TODO Add making other objects breakable
3405 @cindex break-visibility
3407 たいていのレイアウト オブジェクトは 1 回だけ描画されます。@c
3408 しかしながら、小節線、音部記号、拍子記号、それに調号などのオブジェクトは、@c
3409 改行が起こると 2 回描画する必要があります
3410 -- 行の最後で 1 回、次の行の最初でもう 1 回。@c
3411 そのようなオブジェクトは @emph{改行可能} と呼ばれ、@c
3412 それらのオブジェクトが描画される可能性がある 3 つの場所
3413 -- 行の先頭、行の途中 (それらが変更された場合)、@c
3414 それに、行の最後 (そこで変更が行われた場合) --
3415 における可視性を制御する @code{break-visibility} プロパティを持ちます。
3417 例えば、デフォルトでは拍子記号は最初の行の先頭で描画されますが、@c
3418 変更されない限り他の場所には描画されません。@c
3419 変更された場合、拍子記号は変更が行われた場所に描画されます。@c
3420 この変更が行の最後で行われた場合、新しい拍子記号は次の行の先頭に描画され、@c
3421 その前の行の最後にも忠告の拍子記号が描画されます。
3423 この振る舞いは @code{break-visibility} プロパティによって制御されます。@c
3425 @c Leave this ref on a newline - formats incorrectly otherwise -td
3426 @rlearning{オブジェクトの可視性と色}
3428 このプロパティは 3 つのブール値からなるベクトルをとり、@c
3429 順に、そのオブジェクトが行の最後で描画されるかどうか、@c
3431 そして、行の先頭で描画されるかどうかを決定します。@c
3432 より正確には、改行の前、改行がない場合、改行の後です。
3434 @code{break-visibility} プロパティによって制御する代わりに、@c
3435 これら 8 通りの組み合わせを @file{scm/output-lib.scm} で定義されている@c
3436 定義済み関数によって指定することもできます。@c
3437 このファイルの中で、最後の 3 列がその列のヘッダで示される場所での@c
3440 @multitable {@code{begin-of-line-invisible}} {@code{'#(#t #t #t)}} {改行前} {改行なし} {改行後}
3441 @headitem 関数形式 @tab ベクトル形式 @tab 改行前 @tab 改行なし @tab 改行後
3443 @item @code{all-visible} @tab @code{'#(#t #t #t)} @tab yes @tab yes @tab yes
3444 @item @code{begin-of-line-visible} @tab @code{'#(#f #f #t)} @tab no @tab no @tab yes
3445 @item @code{center-visible} @tab @code{'#(#f #t #f)} @tab no @tab yes @tab no
3446 @item @code{end-of-line-visible} @tab @code{'#(#t #f #f)} @tab yes @tab no @tab no
3447 @item @code{begin-of-line-invisible} @tab @code{'#(#t #t #f)} @tab yes @tab yes @tab no
3448 @item @code{center-invisible} @tab @code{'#(#t #f #t)} @tab yes @tab no @tab yes
3449 @item @code{end-of-line-invisible} @tab @code{'#(#f #t #t)} @tab no @tab yes @tab yes
3450 @item @code{all-invisible} @tab @code{'#(#f #f #f)} @tab no @tab no @tab no
3453 @code{break-visibility} のデフォルト設定は@c
3454 レイアウト オブジェクトによって異なります。@c
3455 以下の表は、@code{break-visibility} によって影響をうける@c
3456 すべてのレイアウト オブジェクトと、そのプロパティのデフォルト設定を示しています:
3458 @multitable @columnfractions .3 .3 .4
3460 @headitem レイアウト オブジェクト @tab 通常のコンテキスト @tab デフォルト設定
3462 @c omit Ambitus as it appears not to be affected by break-visibility -td
3463 @c @item @code{Ambitus} @tab as specified @tab @code{begin-of-line-visible}
3464 @item @code{BarLine} @tab @code{Score} @tab calculated
3465 @item @code{BarNumber} @tab @code{Score} @tab @code{begin-of-line-visible}
3466 @c omit the following item until it can be explained -td
3467 @c @item @code{BreakAlignGroup} @tab @code{Score} @tab calculated
3468 @item @code{BreathingSign} @tab @code{Voice} @tab @code{begin-of-line-invisible}
3469 @item @code{Clef} @tab @code{Staff} @tab @code{begin-of-line-visible}
3470 @item @code{Custos} @tab @code{Staff} @tab @code{end-of-line-visible}
3471 @item @code{DoublePercentRepeat} @tab @code{Voice} @tab @code{begin-of-line-invisible}
3472 @item @code{KeyCancellation} @tab @code{Staff} @tab @code{begin-of-line-invisible}
3473 @item @code{KeySignature} @tab @code{Staff} @tab @code{begin-of-line-visible}
3474 @c omit LeftEdge until it can be explained -td
3475 @c @item @code{LeftEdge} @tab @code{Score} @tab @code{center-invisible}
3476 @item @code{ClefModifier} @tab @code{Staff} @tab @code{begin-of-line-visible}
3477 @item @code{RehearsalMark} @tab @code{Score} @tab @code{end-of-line-invisible}
3478 @item @code{TimeSignature} @tab @code{Staff} @tab @code{all-visible}
3482 以下の例は、小節線の可視性を制御するベクトルの使用方法を示しています:
3485 @lilypond[quote,verbatim,ragged-right]
3489 % カレント行の最後で小節線を削除します
3490 \once \override Score.BarLine.break-visibility = #'#(#f #t #t)
3497 @code{break-visibility} をオーバライドするために使用される@c
3498 ベクトルの要素 3 つをすべて記述する必要がありますが、@c
3499 それらすべてが各レイアウト オブジェクトに対して効果を持つわけではなく、@c
3500 組み合わせによってはエラーになる場合もあります。@c
3504 @item 小節線を行の先頭に描画することはできません。
3505 @item 小節番号は 1 から始まるのでなければ、@c
3506 最初の行の先頭に描画することはできません。
3507 @item 音部記号 -- 以下を参照してください
3508 @item 2 重線のパーセント繰り返しはすべて描画するか、@c
3510 描画するには @code{begin-of-line-invisible} を用い、@c
3511 描画しないのなら @code{all-invisible} を用います。
3512 @item Key signature -- 以下を参照してください
3513 @item ClefModifier -- 以下を参照してください
3517 @unnumberedsubsubsec 特別な考慮を必要とするもの
3518 @translationof Special considerations
3520 @subsubsubheading 明示的な変更の後の可視性
3522 @cindex key signature, visibility following explicit change (明示的な変更の後の調号の可視性)
3523 @cindex explicitKeySignatureVisibility
3524 @cindex clef, visibility following explicit change (明示的な変更の後の音部記号の可視性)
3525 @cindex explicitClefVisibility
3527 @code{break-visibility} プロパティが調号の可視性と音部記号の変更を@c
3528 制御するのは、行の先頭 -- つまり、改行の後 -- においてだけです。@c
3529 行の途中や終わりでの明示的な調の変更や音部記号の変更の後に出現する@c
3530 調号や音部記号の可視性には効果を持ちません。@c
3531 以下の例では、@code{all-invisible} がセットされていますが、@c
3532 B フラット メジャーへの明示的な変更の後に出現する調号は可視のままです。
3535 @lilypond[quote,verbatim,ragged-right]
3540 \override Staff.KeySignature.break-visibility = #all-invisible
3549 そのような明示的な調号や音部記号の変更の可視性は
3550 @code{explicitKeySignatureVisibility} プロパティや
3551 @code{explicitClefVisibility} プロパティによって制御されます。@c
3552 これらは @code{break-visibility} プロパティと等価であり、@c
3553 どちらも @code{break-visibility} と同様に 3 つのブール値からなるベクトルか@c
3554 上でリストアップした定義済み関数をとります。@c
3555 どちらも @code{Staff} コンテキストのプロパティであり、@c
3556 レイアウト オブジェクト自体のプロパティではありません。@c
3557 ですから、これらは @code{\set} コマンドでセットします。@c
3558 どちらもデフォルトでは @code{all-visible} がセットされています。@c
3559 これらのプロパティは明示的な変更の結果として生じる@c
3560 調号と音部記号の可視性だけを制御し、@c
3561 行の先頭での調号や音部記号には効果を持ちませんので、@c
3562 オブジェクトを削除するには適切な @code{break-visibility}
3565 @lilypond[quote,verbatim,ragged-right]
3569 \set Staff.explicitKeySignatureVisibility = #all-invisible
3570 \override Staff.KeySignature.break-visibility = #all-invisible
3578 @subsubsubheading 前の調をキャンセルする臨時記号の可視性
3580 明示的な調の変更で描画される前の調をキャンセルする臨時記号を削除するには、@c
3581 @code{Staff} コンテキスト プロパティ @code{printKeyCancellation} に
3584 @lilypond[quote,verbatim,ragged-right]
3588 \set Staff.explicitKeySignatureVisibility = #all-invisible
3589 \set Staff.printKeyCancellation = ##f
3590 \override Staff.KeySignature.break-visibility = #all-invisible
3598 このオーバライドによって、調の変更を示す臨時記号だけが残ります。
3600 調を C@tie{}メジャーや A@tie{}マイナーに変更する時、前の調をキャンセル@c
3601 する臨時記号は前の調のキャンセルしている @emph{だけ} であることに@c
3603 そのようなケースでは、@code{printKeyCancellation} を @code{#f} に@c
3606 @lilypond[quote,verbatim,ragged-right]
3610 \set Staff.explicitKeySignatureVisibility = #all-invisible
3611 \set Staff.printKeyCancellation = ##f
3619 調を C@tie{}メジャーや A@tie{}マイナーに変更する場合に、@c
3620 前の調をキャンセルする臨時記号を消すには、@code{KeyCancellation}
3621 グラフィカル オブジェクトの可視性をオーバライドします:
3623 @lilypond[quote,verbatim,ragged-right]
3627 \set Staff.explicitKeySignatureVisibility = #all-invisible
3628 \override Staff.KeyCancellation.break-visibility = #all-invisible
3636 @c TODO Add visibility of cautionary accidentals before notes
3638 @subsubsubheading 自動小節線
3640 @cindex automaticBars
3641 @cindex bar lines, suppressing (小節線を消す)
3644 @code{Score} コンテキストの @code{automaticBars} プロパティを@c
3645 設定することにより、小節線の描画を Off にすることもできます。@c
3646 @code{#f} をセットされた場合、小節線は自動的には描画されなくなり、@c
3647 @code{\bar} コマンドで明示的に作成しなければならなくなります。@c
3648 定義済みコマンド @code{\cadenzaOn} とは異なり、小節数はカウントされ続けます。@c
3649 後になってこのプロパティに @code{#t} がセットされると、@c
3650 このカウントに従って小節線の生成が再開されます。@c
3651 @code{#f} がセットされている場合、@c
3652 改行が起こりえるのは明示的な @code{\bar} コマンドがある場所でだけになります。
3656 @subsubsubheading オクターブ移調付きの音部記号
3658 @cindex transposed clefs, visibility of (オクターブ移調付きの音部記号の可視性)
3659 @cindex visibility of transposed clefs (オクターブ移調付きの音部記号の可視性)
3660 @cindex clefs, visibility of transposition (オクターブ移調付きの音部記号の可視性)
3662 オクターブ移調付きの音部記号上の小さなオクターブ記号は
3663 @code{ClefModifier} レイアウト オブジェクトによって作り出されます。@c
3665 @code{Clef} オブジェクトの可視性とは独立して制御されます。@c
3666 そのため、各行の先頭においてそのような音部記号を完全に消そうとするなら、@c
3667 @code{Clef} オブジェクトと @code{ClefModifier} オブジェクトの両方に対して@c
3668 必要な @code{break-visibility} のオーバライドを行う必要があります。
3671 @code{explicitClefVisibility} プロパティが@c
3672 音部記号とそれに関連するオクターブ記号の両方を制御します。
3676 @rlearning{オブジェクトの可視性と色}
3680 @subsection ライン スタイル
3681 @translationof Line styles
3684 -- 例えば、@i{rallentando}, @i{accelerando} それに @i{trills} など --
3686 線で (点線や波線の場合もあります) でいくつもの小節にわたって広がります。
3688 これらはすべてグリッサンドと同じルーチンを用いてテキストと線を描きます。@c
3689 そのため、それらの振る舞いの調整も同じように行います。@c
3690 これらはスパナによって実現され、スパナを描くルーチンは
3691 @code{ly:line-interface::print} です。@c
3692 このルーチンは 2 つの @i{スパン ポイント} の位置を決定し、@c
3693 要求されたスタイルに応じてそれら 2 点の間に線を描きます。
3695 利用可能なライン スタイルと、それらをどのように調整するかを示す例を挙げます。
3697 @lilypond[relative=2,ragged-right,verbatim,fragment]
3699 \once \override Glissando.style = #'dashed-line
3701 \override Glissando.style = #'dotted-line
3703 \override Glissando.style = #'zigzag
3705 \override Glissando.style = #'trill
3709 スパナの終点の位置は各グラフィック オブジェクトごとに@c
3710 オンザフライ (その場、その時々) で計算されますが、@c
3711 それらをオーバライドすることもできます:
3714 @lilypond[ragged-right,verbatim,quote]
3717 \once \override Glissando.bound-details.right.Y = #-2
3722 グリッサンドの終点の @code{Y} には @code{-2} がセットされています。@c
3723 @code{right} の代わりに @code{left} を指定することにより、@c
3724 始点も同じように調整することができます。
3726 @code{Y} がセットされていない場合、@c
3727 その値はスパナが取り付けられるポイントの垂直位置から算出されます。
3729 スパナに他の調整を行うことも可能です。@c
3730 詳細は @ref{スパナ} を参照してください。
3734 @subsection オブジェクトを回転させる
3735 @translationof Rotating objects
3737 レイアウト オブジェクトとマークアップ テキストの要素はどちらも@c
3738 任意のポイントを中心にして任意の角度で回転させることができます。@c
3739 しかしながら、回転させる方法はまったく異なります。
3742 * レイアウト オブジェクトを回転させる::
3746 @node レイアウト オブジェクトを回転させる
3747 @unnumberedsubsubsec レイアウト オブジェクトを回転させる
3748 @translationof Rotating layout objects
3750 @cindex rotating objects (オブジェクトを回転させる)
3751 @cindex objects, rotating (オブジェクトを回転させる)
3753 @code{grob-interface} をサポートするすべてのレイアウト オブジェクトは、@c
3754 それらのオブジェクトの @code{rotation} プロパティを設定することにより、@c
3756 これは 3 要素のリストをとります: 反時計回りの回転の角度、@c
3757 オブジェクトの参照ポイントからの相対座標 x と y
3758 (この座標が回転の中心になります) です。@c
3759 回転の角度は @q{°}で指定し、座標は譜スペースで指定します。
3761 回転の角度と回転の中心座標は、トライ&エラーで決定する必要があります。
3763 @cindex hairpins, angled (回転させられたヘアピン)
3764 @cindex angled hairpins (回転させられたヘアピン)
3766 レイアウト オブジェクトを回転させることが有用な状況はあまりありません。@c
3767 以下の例は、有用であるかもしれないシチュエーションの 1 つを示しています:
3769 @lilypond[quote,fragment,verbatim]
3771 \override Hairpin.rotation = #'(20 -1 0)
3776 @unnumberedsubsubsec マークアップを回転させる
3777 @translationof Rotating markup
3779 すべてのマークアップ テキストは、@code{\rotate} コマンドを前に置くことにより、@c
3780 任意の角度に回転させることができます。@c
3781 このコマンドは 2 つの引数をとります: 反時計回りの回転の角度 @q{°} と、@c
3784 テキストの領域は回転させられるテキストの四隅になります。@c
3785 以下の例では、自動衝突回避を不可にするために@c
3786 テキストの @code{outside-staff-priority} プロパティに @code{#f} を@c
3788 そうしなければテキストのいくつかは高く押し上げられてしまいます。
3790 @lilypond[quote,fragment,verbatim]
3791 \override TextScript.outside-staff-priority = ##f
3792 g4^\markup { \rotate #30 "a G" }
3793 b^\markup { \rotate #30 "a B" }
3794 des'^\markup { \rotate #30 "a D-Flat" }
3795 fis'^\markup { \rotate #30 "an F-Sharp" }
3801 @translationof Advanced tweaks
3804 楽譜の見た目を細かく調節するためのさまざまなアプローチについて議論します。
3808 * グラフィカル オブジェクトを垂直方向にグループ化する::
3811 * unpure-pure コンテナ::
3816 @rlearning{出力を調整する},
3824 @rextend{Interfaces for programmers}
3827 @file{scm/define-grobs.scm}
3830 @rlsr{Tweaks and overrides}
3833 @rinternals{All layout objects}
3837 @subsection オブジェクトを揃える
3838 @translationof Aligning objects
3840 @code{self-alignment-interface} と/あるいは @code{side-position-interface} を@c
3841 サポートするグラフィカル オブジェクトは、@c
3842 さまざまな形式で配置済みのオブジェクトに揃えることができます。@c
3843 そのようなオブジェクトのリストは、@rinternals{self-alignment-interface} と
3844 @rinternals{side-position-interface} を参照してください。@c
3846 すべてのグラフィカル オブジェクトは参照ポイント、水平方向の広がり、@c
3849 参照ポイントから左端と右端までの距離を意味する数値のペアであり、@c
3852 参照ポイントから下端と上端までの距離を意味する数値のペアであり、@c
3855 あるオブジェクトの譜面上の位置は、@code{X-offset} プロパティと
3856 @code{Y-offset} プロパティの値によって与えられます。@c
3857 @code{X-offset} の値は、親オブジェクトの参照ポイントの X 座標からの@c
3859 @code{Y-offset} の値は、譜の中央線からの距離を意味します。@c
3860 @code{X-offset} と @code{Y-offset} の値は直接設定されることもありますし、@c
3861 いくつかの形式で親オブジェクトと揃えるために@c
3862 プロシージャによって算出されることもあります。
3864 @c positioning considerations: 配置のための考慮 -> 配置規則
3865 @warning{多くのオブジェクトは特殊な配置規則を持っています。@c
3866 そのため、そのオブジェクトが @code{self-alignment-interface} を@c
3868 @code{X-offset} あるいは @code{Y-offset} の設定は無視されたり、@c
3871 例えば、臨時記号は @code{Y-offset} を設定することにより@c
3872 垂直方向の位置を変更することができますが、@code{X-offset} は効果を持ちません。
3874 リハーサル記号は、小節線、音部記号、拍子記号それに調号などの@c
3875 改行可能なオブジェクトに揃えることができます。@c
3876 リハーサル記号をそのようなオブジェクトに合わせて配置するために、@c
3877 @code{break-aligned-interface} の中に特別なプロパティがあります。
3881 @ref{break-alignable-interface を使用する},
3884 @rextend{Callback functions}
3887 * X-offset と Y-offset を直接設定する::
3888 * side-position-interface を使用する::
3889 * self-alignment-interface を使用する::
3890 * break-alignable-interface を使用する::
3893 @node X-offset と Y-offset を直接設定する
3894 @unnumberedsubsubsec @code{X-offset} と @code{Y-offset} を直接設定する
3895 @translationof Setting X-offset and Y-offset directly
3897 多くのオブジェクトの @code{X-offset} プロパティと @code{Y-offset} プロパティに@c
3899 以下の例は、3 つの音符を示していて、1 つはデフォルト配置の運指記号を持ち、@c
3900 他の 2 つの運指記号は @code{X-offset} と @code{Y-offset} が変更されています。
3902 @lilypond[verbatim,fragment,quote]
3909 -\tweak X-offset #-1
3916 @node side-position-interface を使用する
3917 @unnumberedsubsubsec @code{side-position-interface} を使用する
3918 @translationof Using the @code{side-position-interface}
3920 @code{side-position-interface} をサポートするオブジェクトは、@c
3921 その親オブジェクトの隣に配置することができ、@c
3923 それら 2 つのオブジェクトの指定された端をくっつけることができます。@c
3924 オブジェクトを親オブジェクトの上、下、右、あるいは左に配置することができます。@c
3925 親オブジェクトを指定することはできません:
3926 親オブジェクトは入力ストリームの中での要素の順序によって決定されます。@c
3927 たいていのオブジェクトの親オブジェクトは、@c
3928 そのオブジェクトに関連する符頭となります。
3930 @code{side-axis} プロパティと @code{direction} プロパティの値は、@c
3931 以下のように、オブジェクトが配置される場所を決定します:
3933 @c TODO add an example of each to the table
3935 @multitable @columnfractions .3 .3 .3
3936 @headitem @code{side-axis} @tab @code{direction} @tab
3937 @headitem property @tab property @tab Placement
3939 @item @code{0} @tab @code{-1} @tab 左
3940 @item @code{0} @tab @code{1} @tab 右
3941 @item @code{1} @tab @code{-1} @tab 下
3942 @item @code{1} @tab @code{1} @tab 上
3946 @code{side-axis} が @code{0} である場合、@code{X-offset} には@c
3947 プロシージャ @code{ly:side-position-interface::x-aligned-side} を@c
3949 このプロシージャは、@code{direction} の値に基づいて@c
3950 親オブジェクトの左あるいは右にオブジェクトを配置するための適切な値を
3951 @code{X-offset} に返します。
3953 @code{side-axis} が @code{1} である場合、@code{Y-offset} には@c
3954 プロシージャ @code{ly:side-position-interface::y-aligned-side} を@c
3956 このプロシージャは、@code{direction} の値に基づいて@c
3957 親オブジェクトの上あるいは下にオブジェクトを配置するための適切な値を
3958 @code{Y-offset} に返します。
3960 @c TODO Add examples
3962 @node self-alignment-interface を使用する
3963 @unnumberedsubsubsec @code{self-alignment-interface} を使用する
3964 @translationof Using the @code{self-alignment-interface}
3966 @subsubsubheading オブジェクトを自動的に水平方向に揃える
3968 @code{self-alignment-interface} をサポートするオブジェクトの水平方向の揃えは、@c
3969 @code{self-alignment-X} プロパティの値によって制御され、@c
3970 そのオブジェクトの @code{X-offset} プロパティには@c
3972 @code{ly:self-alignment-interface::x-aligned-on-self}.
3973 @code{self-alignment-X} がセットされます。@c
3974 与える実数値は、そのオブジェクトの X 方向の広がりの半分を単位とします。@c
3975 負値はオブジェクトを右に移動させ、正値はオブジェクトを左に移動させます。@c
3976 値が @code{0} であればそのオブジェクトは親オブジェクトの参照ポイントに@c
3978 値が @code{-1} であればそのオブジェクトの左端が親オブジェクトの参照ポイントに@c
3980 値が @code{1} であればそのオブジェクトの右端が親オブジェクトの参照ポイントに@c
3982 記号 @code{LEFT}, @code{CENTER}, それに @code{RIGHT} は@c
3983 それぞれ @w{@code{-1}, @code{0}, それに @code{1}} に対応します。
3985 通常、@code{\override} コマンドを用いて @code{self-alignment-X} の値を@c
3987 @code{\tweak} コマンドを用いることで@c
3988 単一の音符に付けられている複数の注釈を個別に揃えることができます:
3990 @lilypond[quote,verbatim,fragment]
3992 -\tweak self-alignment-X #-1
3994 -\tweak self-alignment-X #0
3996 -\tweak self-alignment-X #RIGHT
3998 -\tweak self-alignment-X #-2.5
3999 ^"aligned further to the right"
4002 @subsubsubheading オブジェクトを自動的に垂直方向に揃える
4004 オブジェクトの @code{Y-offset} プロパティに
4005 @code{ly:self-alignment-interface::y-aligned-on-self} がセットされていれば、@c
4006 水平方向の揃えと同じように、垂直方向に揃えることができます。@c
4007 しかしながら、垂直方向の揃えには他のメカニズムも関与します:
4008 @code{Y-offset} の値は、垂直方向の揃えに関与する変数の 1 つに過ぎません。@c
4009 このことにより、いくつかのオブジェクトの @code{Y-offset} 値の調整は@c
4011 単位はそのオブジェクトの垂直方向の広がりの半分です。@c
4012 通常これは非常に小さいため、非常に大きな数値が必要になる可能性があります。@c
4013 値が @code{-1} であればそのオブジェクトの下端が親オブジェクトの参照ポイントに@c
4015 値が @code{0} であればそのオブジェクトの中央が親オブジェクトの参照ポイントに@c
4017 値が @code{1} であればそのオブジェクトの上端が親オブジェクトの参照ポイントに@c
4019 記号 @code{DOWN}, @code{CENTER}, それに @code{UP} は@c
4020 それぞれ @w{@code{-1}, @code{0}, それに @code{1}} に対応します。
4022 @subsubsubheading オブジェクトを自動的に両方向に揃える
4024 @code{X-offset} と @code{Y-offset} の両方の設定を行うことで、@c
4025 オブジェクトの水平方向と垂直方向の揃えを同時に行うことができます。
4027 以下の例は、運指記号を符頭に近づけるための調整方法を示しています。
4030 @lilypond[quote,verbatim,fragment]
4032 -\tweak self-alignment-X #0.5 % 左方向に移動させます
4033 -\tweak Y-offset #ly:self-alignment-interface::y-aligned-on-self
4034 -\tweak self-alignment-Y #-1 % 上方向に移動させます
4039 @unnumberedsubsubsec Using the @code{aligned-on-parent} procedures
4041 @c Cannot document as they do not seem to operate consistently on all objects -td
4042 @c TODO investigate further
4044 The @code{aligned-on-parent} procedures are used in the same way
4045 as the @code{aligned-on-self} procedures, they difference being
4046 that they permit an object to be aligned with the @emph{edges} of
4047 the parent rather than the parent's reference point. The following
4048 example shows the difference:
4052 @lilypond[verbatim,quote]
4058 @unnumberedsubsubsec Using the @code{centered-on-parent} procedures
4060 @c Cannot document as they do not seem to operate consistently on all objects -td
4061 @c TODO investigate further
4065 @c TODO The align-interface, BassFigureAlignment and VerticalAlignment
4067 @node break-alignable-interface を使用する
4068 @unnumberedsubsubsec @code{break-alignable-interface} を使用する
4069 @translationof Using the @code{break-alignable-interface}
4071 @cindex align to objects (オブジェクトに揃える)
4072 @cindex break-align-symbols
4074 リハーサル記号と小節番号を小節線ではなく、@c
4075 記譜オブジェクトに揃えることができます。@c
4076 対象となる記譜オブジェクトには、@code{ambitus},
4077 @code{breathing-sign}, @code{clef}, @code{custos}, @code{staff-bar},
4078 @code{left-edge}, @code{key-cancellation}, @code{key-signature}, それに
4079 @code{time-signature} があります。
4082 リハーサル記号と小節番号はオブジェクトの上で水平方向に中央揃えされます:
4085 @lilypond[verbatim,quote,fragment]
4086 % リハーサル記号は音部記号の上に中央揃えされます
4087 \override Score.RehearsalMark.break-align-symbols = #'(clef)
4092 % リハーサル記号は拍子記号の上に中央揃えされます
4093 \override Score.RehearsalMark.break-align-symbols = #'(time-signature)
4099 % リハーサル記号はブレス記号の上に中央揃えされます
4100 \override Score.RehearsalMark.break-align-symbols = #'(breathing-sign)
4109 揃えの対象となり得るオブジェクトのリストを指定することができます。@c
4110 揃えを行う時点で対象リストの中にあるオブジェクトのいくつかが不可視である
4111 -- @code{break-visibility} の設定や、@c
4112 調号と音部に対する明示的な可視性の設定により --
4113 場合、リハーサル記号あるいは小節番号はリストの中にある@c
4114 最初の可視のオブジェクトに揃えられます。@c
4115 リストの中にあるオブジェクトがすべて不可視である場合、小節線に揃えられます。@c
4116 小節線が不可視である場合、小節線があるはずの場所に揃えられます。
4119 @lilypond[verbatim,quote,fragment]
4120 % リハーサル記号は調号の上に中央揃えされます
4121 \override Score.RehearsalMark.break-align-symbols = #'(key-signature clef)
4126 % リハーサル記号は音部記号の上に中央揃えされます
4127 \set Staff.explicitKeySignatureVisibility = #all-invisible
4128 \override Score.RehearsalMark.break-align-symbols = #'(key-signature clef)
4133 % リハーサル記号は小節線の上に中央揃えされます
4134 \set Staff.explicitKeySignatureVisibility = #all-invisible
4135 \set Staff.explicitClefVisibility = #all-invisible
4136 \override Score.RehearsalMark.break-align-symbols = #'(key-signature clef)
4144 記譜オブジェクトに対するリハーサル記号の揃えを変更することができます。@c
4145 複数の譜を持つ楽譜では、この設定はすべての譜に適用されます。
4148 @lilypond[verbatim,quote,fragment]
4149 % RehearsalMark は KeySignature の上に中央揃えされます
4150 \override Score.RehearsalMark.break-align-symbols = #'(key-signature)
4156 % RehearsalMark は KeySignature の左端に揃えられます
4157 \once \override Score.KeySignature.break-align-anchor-alignment = #LEFT
4161 % RehearsalMark は KeySignature の右端に揃えられます
4162 \once \override Score.KeySignature.break-align-anchor-alignment = #RIGHT
4168 また、リハーサル記号を左端に揃えて、@c
4169 さらに任意の量だけ右あるいは左にずらすことができます。@c
4173 @lilypond[verbatim,quote,fragment]
4174 % リハーサル記号は調号の左端に揃えられて
4175 % さらに 3.5 譜スペース右にずらされます
4176 \override Score.RehearsalMark.break-align-symbols = #'(key-signature)
4177 \once \override Score.KeySignature.break-align-anchor = #3.5
4181 % リハーサル記号は調号の左端に揃えられて
4182 % さらに 2 譜スペース左にずらされます
4183 \once \override Score.KeySignature.break-align-anchor = #-2
4190 @node グラフィカル オブジェクトを垂直方向にグループ化する
4191 @subsection グラフィカル オブジェクトを垂直方向にグループ化する
4192 @translationof Vertical grouping of grobs
4194 @c FIXME Expand this section
4196 VerticalAlignment グラフィカル オブジェクトと
4197 VerticalAxisGroup グラフィカル オブジェクトは対で機能します。@c
4198 VerticalAxisGroup は Staff, Lyrics, 等のような@c
4199 異なるグラフィカル オブジェクトをグループにまとめます。@c
4200 それから、VerticalAlignment が
4201 VerticalAxisGroup によってグループ化されたグラフィカル オブジェクトを@c
4203 通常、楽譜には VerticalAlignment は 1 つしかありませんが、@c
4204 Staff, Lyrics 等はそれ自体でそれぞれに VerticalAxisGroup を持ちます。
4208 @subsection ステンシルを変更する
4209 @translationof Modifying stencils
4211 すべてのレイアウト オブジェクトは、@c
4212 @code{grob-interface} の一部である @code{stencil} プロパティを持ちます。@c
4213 通常、デフォルトでこのプロパティには、@c
4214 出力でそのオブジェクトを具現化する記号を描画するための@c
4216 例えば、@code{MultiMeasureRest} オブジェクトの @code{stencil} プロパティに@c
4217 対する標準設定は、@code{ly:multi-measure-rest::print} です。
4219 @code{stencil} プロパティを変更して異なる描画関数を参照させることにより、@c
4220 オブジェクトの標準記号を置き換えることができます。@c
4221 これには LilyPond 内部機能についての高い知識が求められます。@c
4222 しかしながら、多くの場合にまずまずの結果を生み出すもっと簡単な方法があります。
4224 簡単な方法では、@code{stencil} プロパティにテキストを描画する関数
4225 -- @code{ly:text-interface::print} -- をセットし、@c
4226 必要な記号を生み出すマークアップ テキストを保持するよう設定された
4227 @code{text} プロパティ与えます。@c
4228 マークアップの自由度の高さにより、多くのことを達成できます。@c
4229 詳細は、@ref{マークアップ内部でのグラフィック記譜法} を参照してください。
4231 以下の例では、この方法を用いて符頭記号を内部に×を持つ円に変更しています。
4233 @lilypond[verbatim,quote]
4235 \once \override NoteHead.stencil = #ly:text-interface::print
4236 \once \override NoteHead.text = \markup {
4238 \halign #-0.7 \draw-circle #0.85 #0.2 ##f
4239 \musicglyph #"noteheads.s2cross"
4247 @code{\musicglyph} マークアップ コマンドには、@c
4248 Emmentaler フォントに含まれる任意の図柄を提供することができます。@c
4249 @ref{The Emmentaler font} を参照してください。
4251 @c TODO Add inserting eps files or ref to later
4253 @c TODO Add inserting Postscript or ref to later
4257 @ref{マークアップ内部でのグラフィック記譜法},
4258 @ref{テキストをフォーマットする},
4259 @ref{Text markup commands},
4260 @ref{The Emmentaler font}.
4265 @translationof Modifying shapes
4271 @node タイとスラーの形状を変更する
4272 @unnumberedsubsubsec タイとスラーの形状を変更する
4273 @translationof Modifying ties and slurs
4275 @cindex slurs, modifying (スラーの形状を変更する)
4276 @cindex ties, modifying (タイの形状を変更する)
4277 @cindex Bézier curves (ベジエ曲線)
4278 @cindex Bézier control points (ベジエ曲線の制御ポイント)
4280 @code{Tie}, @code{Slur}, @code{PhrasingSlur}, @code{LaissezVibrerTie},
4281 それに @code{RepeatTie} はすべて 3 次のベジエ曲線として描かれます。@c
4282 自動的に算出されるタイやスラーの形状が最適ではない場合、以下の 2 つの@c
4283 方法を用いて手動で形状を変更することができます:@c
4287 自動的に算出されるベジエ曲線の制御ポイントの移動させる
4290 求める曲線を定義するのに必要な 4 つの制御ポイントの位置を明示的に指定する
4293 2 つの方法について以下で説明します。@c
4294 曲線の調節がわずかであれば、最初の方法が適しています。@c
4295 2 番目の方法は単一の音符に関連付けられる曲線を作り出す場合に適しています。
4297 @subsubsubheading 3 次ベジエ曲線
4299 3 次あるいは 3 乗のベジエ曲線は、4 つの制御ポイントによって定義されます。@c
4300 1 番目と 4 番目の制御ポイントは曲線の始点と終点になります。@c
4301 間にある 2 つの制御ポイントは曲線の形状を定義します。@c
4302 Web でベジエ曲線が描かれる様子を示すアニメーションを@c
4304 しかしながら、以下の記述も役に立つかもしれません。@c
4305 ベジエ曲線は最初の制御ポイントから 2 番目の制御ポイントに進み、@c
4306 徐々に 3 番目の制御ポイントの方へ向きを変えながら
4307 4 番目の制御ポイントの方へ向かい続け、@c
4308 3 番目の制御ポイントから 4 番目の制御ポイントに到達します。@c
4309 ベジエ曲線は 4 つの制御ポイントからなる四角形の中に納まります。@c
4310 制御ポイントの平行移動、回転、伸縮はすべて同じ操作です。
4312 @subsubsubheading 制御ポイントを移動させる
4314 @cindex shaping slurs and ties (スラーとタイの形状)
4317 以下の例では、タイの自動配置が最適ではなく、@code{\tieDown} も役に@c
4320 @lilypond[verbatim,quote,relative=1]
4324 { r4 <g c,> <g c,> <g c,> }
4328 @code{\shape} でタイの制御ポイントを調節することで衝突を避けることが@c
4331 @code{\shape} の構文は以下の通りです:
4334 [-]\shape @var{displacements} @var{item}
4337 これは @var{item} の制御ポイントを @var{displacements} だけ移動させます。@c
4338 引数 @var{displacements} は数のペアのリスト、あるいはそのようなリストの@c
4340 ペアの要素は制御ポイントの座標の移動量を表しています。@c
4341 @var{item} が文字列の場合、指定されたグラフィカル オブジェクト タイプ@c
4342 に @code{\once \override} で適用されます。@c
4343 @var{item} が音楽表記の場合、その音楽表記に調節が適用されます。
4345 言い換えると、@code{\shape} 関数は、引数 @var{item} が @qq{Slur}
4346 のようなグラフィカル オブジェクト名であるか @qq{(} のような音楽表記@c
4347 であるかによって、@code{\once \override} コマンドあるいは @code{\tweak}
4349 引数 @var{displacements} は 4 つの (dx . dy) ペアのリストで 4 つの@c
4350 制御ポイントの移動を指定します -- 値の単位は譜スペースです。
4351 (曲線が複数のセグメントを持つ場合、引数 @var{displacements} は 4 つの@c
4354 @code{\tweak} 形式で用いる場合にのみ、先頭にハイフン @code{-} を付ける@c
4357 それでは、上記の例に @code{\once \override} 形式の @code{\shape} を@c
4358 使ってタイを 0.5 譜スペースだけ上に移動させてみましょう:
4360 @lilypond[verbatim,quote]
4363 \shape #'((0 . 0.5) (0 . 0.5) (0 . 0.5) (0 . 0.5)) Tie
4367 \relative { r4 <g' c,> <g c,> <g c,> }
4371 タイの位置は改善されましたが、中央部分をもっと持ち上げるべきです。@c
4372 以下の例で @code{\tweak} 形式でそれを行っています:
4374 @lilypond[verbatim,quote]
4377 e'1-\shape #'((0 . 0.5) (0 . 1) (0 . 1) (0 . 0.5)) ~ e'
4380 \relative { r4 <g' c,> <g c,> <g c,> }
4384 同じ方法で制御ポイントを水平方向に移動させることもできて、同じ音楽@c
4385 タイミングで発生する 2 つの曲線をうまく配置することができます:
4387 @lilypond[verbatim,quote,ragged-right]
4389 c''8(\( a) a'4 e c\)
4390 \shape #'((0.7 . -0.4) (0.5 . -0.4) (0.3 . -0.3) (0 . -0.2)) Slur
4391 \shape #'((0 . 0) (0 . 0.5) (0 . 0.5) (0 . 0)) PhrasingSlur
4396 @code{\shape} 関数は改行を跨ぐ曲線の制御ポイントを移動させることも@c
4398 分割される曲線それぞれにリストを与えて制御ポイントを移動させます。@c
4399 片方の曲線は変更する必要がない場合、空のリストを渡します。@c
4400 以下の例では、1 つのスラーが改行で 2 つに分割されています:
4402 @lilypond[verbatim,quote,ragged-right]
4410 分割されたスラーの形状を変更することで、改行を跨いで続くスラーである@c
4414 @lilypond[verbatim,quote,ragged-right]
4415 % 片方のスラーを変更する必要がない場合、
4416 % () を ((0 . 0) (0 . 0) (0 . 0) (0 . 0)) の短縮形として使うことができます
4419 (( 0 . 0) (0 . 0) (0 . 0) (0 . 1))
4420 ((0.5 . 1.5) (1 . 0) (0 . 0) (0 . -1.5))
4428 S 字曲線が求められた場合は、常に制御ポイントを手動で調節する必要があります
4429 --- LilyPond が自動的にそのような形状を選択することはありません。
4431 @lilypond[verbatim,quote]
4433 c8( e b-> f d' a e-> g)
4434 \shape #'((0 . -1) (5.5 . -0.5) (-5.5 . -10.5) (0 . -5.5)) PhrasingSlur
4435 c8\( e b-> f d' a e-> g\)
4439 @subsubsubheading 制御ポイントの位置を明示的に指定する
4441 ベジエ曲線の制御ポイントの座標を指定します -- 単位は譜スペースです。@c
4442 X@tie{}座標はタイあるいはスラーを取り付ける音符の参照ポイントからの@c
4443 相対位置で、X@tie{}座標は譜の中央線からの相対位置です。@c
4444 制御ポイントの座標をリストで指定します -- リストは数のペアを 4 つ持ちます。@c
4445 両端の座標を推測して、それから 2 つ中間点の座標を推測します。@c
4446 最適値はトライ&エラーで見つけます。@c
4447 音楽やレイアウトに変更が加えられた場合、手動で値を調節する必要がある@c
4450 制御ポイントを移動させるよりも、位置を明示的に指定する方が望ましい@c
4451 シチュエーションの 1 つは、単一の音符に関連付けられる曲線の場合です。@c
4453 繰り返しの差し替え部分まで延びるスラーを表示する方法を示しています。
4456 @lilypond[verbatim,quote]
4459 \repeat volta 3 { c4 d( e f }
4464 % スラーを作成して、新しい位置に移動させます
4465 % <> はスラーを終わらせるための空の和音です
4466 -\tweak control-points #'((-2 . 3.8) (-1 . 3.9) (0 . 4) (1 . 3.4)) ( <> )
4471 % スラーを作成して、新しい位置に移動させます
4472 -\tweak control-points #'((-2 . 3) (-1 . 3.1) (0 . 3.2) (1 . 2.4)) ( <> )
4480 同じ音楽タイミングに複数のタイあるいはスラーが存在する場合、@c
4481 @code{control-points} プロパティを変更しても@c
4482 それらの形状を変更することはできません。@c
4483 @code{\tweak} コマンドを用いたとしても変更できません。@c
4484 しかしながら、@code{TieColumn} の @code{tie-configuration} プロパティを@c
4485 オーバライドすることで、タイの垂直方向の位置と領域を変更することができます。
4489 @rinternals{TieColumn}
4492 @node unpure-pure コンテナ
4493 @subsection unpure-pure コンテナ
4494 @translationof Unpure-pure containers
4496 @cindex Scheme, pure containers (Scheme pure コンテナ)
4497 @cindex Scheme, unpure containers (Scheme unpure コンテナ)
4498 @cindex pure containers, Scheme (Scheme pure コンテナ)
4499 @cindex unpure containers, Scheme (Scheme unpure コンテナ)
4500 @cindex horizontal spacing, overriding (水平方向のスペースを上書きする)
4502 unpure-pure コンテナは @emph{Y-axis} スペース - 特に @code{Y-offset} と
4503 @code{Y-extent} - の算出を文字 (つまり、数字やペア) ではなく、Scheme 関数で@c
4506 ある特定のグラフィカル オブジェクトでは、@code{Y-extent} は @code{stencil}
4507 プロパティをベースにしていて、それらの @code{stencil} プロパティを上書きする場合は
4508 unpure-pure コンテナで @code{Y-extent} も上書きする必要があります。@c
4509 関数が @code{Y-offset} と/または @code{Y-extent} を上書きした場合、@c
4510 その関数はコンパイルの最中に改行の算出を早すぎるタイミングで引き起こすと見なされます。@c
4511 そのため、その関数はまったく評価されず (通常、@samp{0} または @samp{'(0 . 0)} の@c
4512 値を返します)、結果として衝突を引き起こすことがあります。@c
4513 @q{pure} 関数はプロパティ、オブジェクト、あるいはグラフィカル オブジェクトの消失に@c
4514 影響を与えないため、その関数の Y-axis に関する評価は常に正しく行われます。
4516 現在のところ @q{pure} と見なされる関数が約 30 あり、Unpure-pure コンテナを用いて
4517 @q{pure} ではない関数を @q{pure} な関数としてセットすることができます。@c
4518 @q{pure} 関数は改行の @emph{前に} 評価されるため、水平方向のスペースを
4519 @q{正しいタイミングで} 調節することができます。@c
4520 @q{unpure} 関数は改行の @emph{後に} 評価されます。
4522 @warning{@q{pure} な関数を常に把握していることは困難なので、作成する @q{pure}
4523 関数ではグラフィカル オブジェクト @code{Beam} や @code{VerticalAlignment} を@c
4526 unpure-pure コンテナは以下のように構築します:
4528 @code{(ly:make-unpure-pure-container f0 f1)}
4530 ここで @code{f0} は @var{n} (@var{n >= 1}) 個の引数を取る関数であり、最初の引数@c
4531 は常にグラフィカル オブジェクトである必要があります。@c
4533 @code{f1} は @q{pure} であると見なされる関数であり、@var{n + 2} 個の引数を@c
4535 @code{f1} も最初の引数は常にグラフィカル オブジェクトである必要があり、2 番目と
4536 3 番目の引数は @q{start} と @q{end} です。
4538 @q{start} と @q{end} は事実上、@code{Spanners} (つまり、@code{Hairpin} や
4539 @code{Beam}) だけで問題となるダミー値であり、
4540 @var{start} and @var{end} are, for all intents and purposes, dummy
4541 values that only matter for @code{Spanners} (i.e @code{Hairpin} or
4542 @code{Beam}), that can return different height estimations based on a
4543 starting and ending column.
4545 @code{f1} の残りの引数は @code{f0} の引数と同じです (@var{n = 1} である場合は@c
4548 関数 @code{f1} の結果は概算であり、@code{f0} が実際の値を得るのに用いられます。@c
4549 @code{f0} の結果はもっと後のスペースの処理で微調整に用いられます。
4551 @lilypond[verbatim,quote,ragged-right]
4552 #(define (square-line-circle-space grob)
4553 (let* ((pitch (ly:event-property (ly:grob-property grob 'cause) 'pitch))
4554 (notename (ly:pitch-notename pitch)))
4555 (if (= 0 (modulo notename 2))
4556 (make-circle-stencil 0.5 0.0 #t)
4557 (make-filled-box-stencil '(0 . 1.0)
4560 squareLineCircleSpace = {
4561 \override NoteHead.stencil = #square-line-circle-space
4564 smartSquareLineCircleSpace = {
4565 \squareLineCircleSpace
4566 \override NoteHead.Y-extent =
4567 #(ly:make-unpure-pure-container
4568 ly:grob::stencil-height
4569 (lambda (grob start end) (ly:grob::stencil-height grob)))
4572 \new Voice \with { \remove "Stem_engraver" }
4574 \squareLineCircleSpace
4576 \smartSquareLineCircleSpace
4581 最初の小節では unpure-pure コンテナを用いていないため、スペース算出エンジンは符頭の@c
4582 幅を知ることができず、符頭と臨時記号が衝突しています。@c
4583 次の小節では unpure-pure コンテナを用いているため、スペース算出エンジンは符頭の幅を@c
4584 知ることができ、それに応じて小節の幅を増やすことで衝突を回避しています。
4586 通常、簡単な計算では、unpure-pure コンテナの @q{unpure} パートと @q{pure} パート@c
4587 の両方に、引数の数とスコープを変えただけのほとんど同じ関数を用いることができます。
4589 @warning{@q{pure} と見なした関数が @q{pure} でなかった場合、予期しない結果となる@c
4595 @translationof Using music functions
4597 @c TODO -- add @seealso, etc. to these subsections
4599 調整を異なる音楽表記に再利用する必要がある場合、@c
4600 その調整を音楽関数にしておくと便利です。@c
4601 このセクションでは、@emph{置換} 関数についてだけ議論します。@c
4602 置換関数は変数を LilyPond 入力コードに置き換えます。@c
4603 他のもっと複雑な関数については、@rextend{Music functions} で記述されています。
4612 @translationof Substitution function syntax
4614 変数を LilyPond コードに置換する関数を作成することは簡単にできます。@c
4615 置換関数の一般的な形式は以下のようなものです:
4619 #(define-music-function
4620 (@var{arg1} @var{arg2} @dots{})
4621 (@var{type1?} @var{type2?} @dots{})
4623 @var{@dots{}music@dots{}}
4630 @multitable @columnfractions .33 .66
4631 @item @code{@var{argN}}
4634 @item @code{@var{typeN?}}
4635 @tab @code{@var{argN}} が @code{#t} を返す Scheme の @emph{型述語} (type predicate)。
4637 @item @code{@var{@dots{}music@dots{}}}
4638 @tab 通常の LilyPond 入力。引数を参照するには @code{$} (LilyPond 構造が@c
4639 許可されている場合のみ) や @code{#} (引数を Scheme 値、音楽関数の引数、@c
4640 あるいは音楽リスト内部の音楽として使う場合) を用います
4646 引数 @code{parser} と @code{location} を省略することはできず、@c
4647 @rextend{Music functions} で記述されている高度な状況で@c
4649 置換関数において、必ずこれらの引数を記述してください。
4651 引数として、型述語のリストも必須です。@c
4652 音楽関数で用いられる一般的な型述語には下記のものがあります:
4656 cheap-list? @emph{(}@q{list?}@emph{ の代わりに用いることで、処理を高速にします)}
4667 @ref{Predefined type predicates} を参照してください。@c
4668 ユーザが型述語を定義することもできます。
4672 @ref{Predefined type predicates}
4675 @rextend{Music functions}
4678 @file{lily/music-scheme.cc},
4685 @translationof Substitution function examples
4687 このセクションでは、置換関数の例をいくつか紹介します。@c
4688 高度なことはしていませんが、シンプルな置換関数を実現する方法を示しています。
4691 @code{TextScript} のパディング設定を容易にするための関数が定義されています:
4693 @lilypond[quote,verbatim,ragged-right]
4695 #(define-music-function
4699 \once \override TextScript.padding = $padding
4703 c'''4^"piu mosso" b a b
4705 c4^"piu mosso" d e f
4707 c4^"piu mosso" fis a g
4711 数値のほかに、音符などの音楽表記を音楽関数への引数にすることができます:
4713 @lilypond[quote,verbatim,ragged-right]
4715 #(define-music-function
4719 \tweak NoteHead.stencil #ly:text-interface::print
4720 \tweak NoteHead.text
4721 \markup \musicglyph #"custodes.mensural.u0"
4722 \tweak Stem.stencil ##f
4726 \relative { c'4 d e f \custosNote g }
4729 複数の引数をとる置換関数を定義することもできます:
4731 @lilypond[quote,verbatim,ragged-right]
4733 #(define-music-function
4737 \once \override Score.MetronomeMark.padding = $padding
4738 \tempo \markup { \bold #tempotext }
4742 \tempo \markup { "Low tempo" }
4744 \tempoPadded #4.0 "High tempo"
4749 @c TODO: add appropriate @@ref's here.