1 @c -*- coding: utf-8; mode: texinfo; documentlanguage: ja -*-
4 Translation of GIT committish: ebe492ca408fb0d9abf80b94c56197eef8dc2f09
6 When revising a translation, copy the HEAD committish of the
7 version that you are working on. For details, see the Contributors'
8 Guide, node Updating translation committishes..
13 @c Translators: Yoshiki Sawada
14 @c Translation status: post-GDP
18 @translationof Changing defaults
20 LilyPond はデフォルトで最高品質の出力を提供できるよう設計されています。@c
22 デフォルトのレイアウトを変更する必要が発生する場合もあります。@c
23 レイアウトは、@q{プロパティ} と呼ばれる多数の @q{つまみとスイッチ} によって@c
25 これらのプロパティにアクセスし、変更するための手引は学習マニュアルの中にあります
26 -- @rlearning{出力を調整する} を参照してください。@c
29 よりリファレンス マニュアルに適したスタイルで提供します。
31 @cindex Internals Reference (内部リファレンス)
33 調整のために利用できる制御の定義についての説明は、@c
34 別のドキュメントの中にあります: @rinternalsnamed{Top,内部リファレンス} です。@c
35 このマニュアルは利用可能なすべての変数、関数、それにオプションを@c
37 これは HTML ドキュメントとして記述されていて、@c
38 @uref{http://@/lilypond@/.org/@/doc/@/stable/@/Documentation/@/internals/,オンライン}
40 LilyPond ドキュメント パッケージにも含まれています。
42 内部的には、LilyPond は Scheme (LISP 派生語) を用いて機能を提供しています。@c
43 レイアウトについての決定をオーバライドすることは、@c
44 プログラムの内部にアクセスすることであり、@c
46 Scheme の要素は、@code{.ly} の中で、@c
47 ハッシュ記号 @code{#} を付けて記述します。@footnote{@rextend{Scheme tutorial}
48 の中に、Scheme 形式で数、リスト、文字列、それに記号を入力するための@c
64 @translationof Interpretation contexts
66 このセクションでは、コンテキストとは何なのか、@c
67 それをどのように変更するのかについて説明します。
74 * コンテキストのデフォルト設定を変更する::
82 @rlearning{コンテキストとエングラーバ}
85 @file{ly/@/engraver@/-init@/.ly},
86 @file{ly/@/performer@/-init@/.ly}
89 @rlsr{Contexts and engravers}
92 @rinternals{Contexts},
93 @rinternals{Engravers and Performers}
98 @translationof Contexts explained
101 @c TODO Rethink and rewrite
103 >> > > - list of contexts: my *danger unmaintainable*
104 >> > > alarm just went off. I'm
106 I knew it would... And leaving out some of them is perfectly fine
108 I do think that a list like this, with the main contexts and a
110 description of what they do (perhaps also with a note about what
112 behavior is associated with each of them, but this may be
114 should be there, and then we could simply list the remaining ones
116 further explanation and with links to the IR.
119 @c TODO Improve layout, order and consistency of wording -td
121 @c TODO Add introduction which explains contexts in generality -td
123 @c TODO Describe propagation of property values -td
128 * Score - すべてのコンテキストのマスタ::
134 @node Score - すべてのコンテキストのマスタ
135 @unnumberedsubsubsec Score - すべてのコンテキストのマスタ
136 @translationof Score - the master of all contexts
139 他のコンテキストが Score コンテキストを保持することはできません。@c
140 デフォルトでは、Score コンテキストが拍子記号の管理を扱い、@c
141 音部記号、拍子記号、調号などのアイテムが譜間で揃っていることを保証します。
143 Score コンテキストは、@code{\score @{@dots{}@}} や @code{\layout @{@dots{}@}}
144 ブロックが処理されたときに暗黙的にインスタンス化されます。@c
145 @c また、@code{\new Score} コマンドが実行されたときに@c
149 @node 上位コンテキスト - 譜コンテナ
150 @unnumberedsubsubsec 上位コンテキスト - 譜コンテナ
151 @translationof Top-level contexts - staff containers
153 @strong{@emph{StaffGroup}}
155 譜をグループ化して、左端に角括弧を付けます。@c
156 このコンテキストに保持されている譜の小節線は垂直につながります。@c
157 @code{StaffGroup} は譜のコレクション、@c
158 それに左端の角括弧と延長された小節線だけを保持します。
160 @strong{@emph{ChoirStaff}}
162 保持されている譜の小節線が垂直につながらないことを除けば、@c
163 @code{StaffGroup} と同じです。
165 @strong{@emph{GrandStaff}}
167 譜をグループ化して、左端に波括弧を付けます。@c
168 このコンテキストに保持されている譜の小節線は垂直につながります。@c
170 @strong{@emph{PianoStaff}}
172 @code{GrandStaff} と似ていますが、@c
173 各システムの左端に楽器名を付けることができます。
177 @unnumberedsubsubsec 中位コンテキスト - 譜
178 @translationof Intermediate-level contexts - staves
180 @strong{@emph{Staff}}
182 音部記号、小節線、調、臨時記号を扱います。@c
183 このコンテキストは @code{Voice} コンテキストを保持することができます。
185 @strong{@emph{RhythmicStaff}}
187 @code{Staff} と似ていますが、リズムを表示するためのものです。@c
188 ピッチは無視され、音符は線として表示されます。
190 @strong{@emph{TabStaff}}
192 タブ譜を生成するためのコンテキストです。@c
193 デフォルトでは、音楽表記を 6 線のギター タブ譜として配置します。
195 @strong{@emph{DrumStaff}}
198 @code{DrumVoice} を保持することができます。
200 @strong{@emph{VaticanaStaff}}
202 @code{Staff} と同じですが、@c
203 グレゴリア形式の楽曲を譜刻するためにデザインされている点が異なります。
205 @strong{@emph{MensuralStaff}}
207 @code{Staff} と同じでが、@c
208 定量形式の楽曲を譜刻するためにデザインされている点が異なります。
211 @unnumberedsubsubsec 下位コンテキスト - ボイス
212 @translationof Bottom-level contexts - voices
214 Voice レベルのコンテキストはある特定のプロパティを初期化し、@c
216 下位コンテキストであるため、他のコンテキストを保持することはできません。
218 @strong{@emph{Voice}}
221 このコンテキストは、強弱記号、符幹、連桁、上付き/下付き文字、タイ、@c
223 1 つの譜に複数のボイスを配置する必要がある場合、@c
224 ボイスを明示的にインスタンス化する必要があります。
226 @strong{@emph{VaticanaVoice}}
228 @code{Voice} と同じですが、@c
229 グレゴリア形式の楽曲を譜刻するためにデザインされている点が異なります。
231 @strong{@emph{MensuralVoice}}
233 @code{Voice} と同じですが、@c
234 定量形式の楽曲を譜刻するためにデザインされている点が異なります。
236 @strong{@emph{Lyrics}}
238 歌詞を保持するボイスに相当します。単一行の歌詞の表示を扱います。
240 @strong{@emph{DrumVoice}}
242 打楽器譜で使用されるボイス コンテキストです。
244 @strong{@emph{FiguredBass}}
247 @code{\figuremode} モードで記述された入力から
248 @code{BassFigure} オブジェクトが作成されます。
250 @strong{@emph{TabVoice}}
252 @code{TabStaff} コンテキスト内部で使用されるボイス コンテキストです。@c
255 @strong{@emph{CueVoice}}
257 小さなサイズの音符を描画するために使用されるボイス コンテキストです。@c
258 主に合図音符を譜に付け加えることを目的としています。@c
259 @ref{合図音符をフォーマットする} を参照してください。@c
262 @strong{@emph{ChordNames}}
269 Then the following, which I don't know what to do with:
271 * GregorianTranscriptionVoice
272 * GregorianTranscriptionStaff
275 Engraves fretboards from chords. Not easy... Not
277 There is now some documentation on FretBoards in the NR, under
278 instrument-specific notation -- cds.
283 Hard coded entry point for LilyPond. Cannot be tuned.
285 Silently discards all musical information given to this
291 @subsection コンテキストを作成する
292 @translationof Creating contexts
294 @c TODO more complete descriptions rather than learning style
296 ボイスと譜が 1 つだけの楽譜では、コンテキストは自動的に作成されます。@c
297 もっと複雑な楽譜では、手動でコンテキストを作成する必要があります。@c
298 コンテキスを作成するために 3 つのコマンドがあります。
303 もっとも簡単なコマンドは @code{\new} であり、@c
304 もっとも素早く入力できるコマンドでもあります。@c
305 このコマンドは音楽表記の前に置きます。例えば、以下のように:
308 @cindex new contexts (新しいコンテキスト)
309 @cindex Context, creating (コンテキストを作成する)
312 \new @var{type} @var{music expression}
316 ここで、@var{type} はコンテキスト名 (@code{Staff} や @code{Voice} など) です。@c
317 このコマンドは新しいコンテキストを作成し、@c
318 そのコンテキストに付属する @var{音楽表記} の解釈を開始します。
320 @code{\new} の実際的な使用例には、多くの譜を持つ楽譜があります。@c
321 それぞれの譜に配置される各パートの前に @code{\new Staff} を記述します。
323 @lilypond[quote,verbatim,relative=2,ragged-right,fragment]
330 @code{\new} コマンドは、コンテキストに名前を与えることもできます:
333 \new @var{type} = @var{id} @var{music}
336 しかしながら、ユーザが指定したコンテキスト名は、
337 そのコンテキスト以前に同じ名前を与えられたコンテキストが無い場合にのみ、@c
345 @code{\context} コマンドも音楽表記をコンテキスト オブジェクトに代入します。@c
346 しかしながら、このコマンドはコンテキストに明示的に名前を与えます。@c
350 \context @var{type} = @var{id} @var{music}
353 この構文は @var{id} という名前の @var{type} タイプのコンテキストが@c
355 コンテキストがまだ存在していなければ、@c
356 指定された名前を持つコンテキストが新たに作成されます。@c
357 これは、コンテキストを後で参照する場合に有用です。@c
358 例えば、以下のように名前を付けられたメロディ:
361 \context Voice = "@b{tenor}" @var{music}
365 に、以下のように歌詞を設定すると、テキストは適切に音符に揃えられます:
368 \new Lyrics \lyricsto "@b{tenor}" @var{lyrics}
373 名前付きコンテキストの他の使用例として、2 つの音楽表記をつなげて
374 1 つのコンテキストにすることができます。@c
375 以下の例では、アーティキュレーションと音符は別々に入力されています:
379 arts = @{ s4-. s4-> @}
382 これらを同じ @code{Voice} コンテキストに送ることによって@c
387 \new Staff \context Voice = "A" \music
388 \context Voice = "A" \arts
391 @lilypond[quote,ragged-right]
395 \new Staff \context Voice = "A" \music
396 \context Voice = "A" \arts
400 このメカニズムを用いることで、原典版 (オリジナル版) を定義し、@c
401 オプションとしてそれに異なるアーティキュレーションを付けることができます。
403 @cindex creating contexts (コンテキストを作成する)
406 コンテキストを作成する 3 つ目のコマンドは以下の通りです:
409 \context @var{type} @var{music}
413 これは @code{= @var{id}} を持つ @code{\context} に似ていますが、@c
414 タイプ @var{type} のすべてのコンテキストに適用されます
415 -- そのコンテキストに与えられた名前とは関係なく適用されます。@c
418 異なる階層で解釈される可能性がある音楽表記に対して使用されます。@c
419 例えば、@code{\applyOutput} コマンド
420 (@rextend{Running a function on all layout objects} を参照してください)
422 明示的に @code{\context} を指定しなければ、通常は @code{Voice} に適用されます。
425 \applyOutput #'@var{context} #@var{function} % Voice に適用されます
428 @code{Score} レベルや @code{Staff} レベルで解釈させるには、以下のようにします:
431 \applyOutput #'Score #@var{function}
432 \applyOutput #'Staff #@var{function}
439 @subsection コンテキストを残しておく
440 @translationof Keeping contexts alive
442 @cindex contexts, keeping alive (コンテキストを残しておく)
443 @cindex contexts, lifetime (コンテキストのライフタイム)
445 通常、コンテキストは何もすることが無くなった最初の音楽的タイミングで@c
447 そのため、@code{Voice} コンテキストはすべてのイベントを終えるとすぐに消滅し、@c
448 @code{Staff} コンテキストは保持しているすべての @code{Voice} コンテキストの@c
449 イベントが終了するとすぐに消滅する、などとなっています。@c
450 このことは、早い段階のすでに消滅したコンテキスを参照する必要がある場合に、@c
452 例えば、@code{\change} コマンドで譜を変更する場合、@c
453 @code{\lyricsto} コマンドで歌詞をボイスに結び付ける場合、@c
454 あるいは、早い段階で登場したコンテキストに音楽イベントを追加する場合に@c
458 @code{Staff} コンテキストや @code{<<...>>} 構造の中にある @code{Voice}
459 コンテキストのうち 1 つだけは、例え途中ですることが無くなったとしても、@c
460 @code{Staff} コンテキストあるいは
461 @code{<<...>>} 構造の終わりまで維持されます。@c
462 このように維持されるコンテキストは、最初の @code{@{...@}} 構造の中にある@c
463 最初のコンテキストであり、@code{<<...>>} 構造の中にあるものは無視されます。
465 各音楽タイミングで何かすることを持たせることにより、@c
466 任意のコンテキストを残しておくことができます。@c
467 @code{Staff} コンテキストを残しておくには、それに含まれるボイスの 1 つが@c
468 維持されることを保証する必要があります。@c
469 ボイスを残しておく方法の 1 つに、ボイスに含まれる実際の音楽と並列に、@c
470 空白休符をそのボイスに付け加えるという方法があります。@c
471 残しておく必要があるすべての @code{Voice} コンテキストに対して、@c
473 ところどころで使用されるボイスがある場合、@c
474 前述の例外によって必要なボイスを残そうとするよりは、@c
475 それらのボイスすべてを残しておく方が安全です。
477 以下の例では、空白休符の追加を用いる方法で、@c
478 ボイス A とボイス B の両方が楽曲全体を通して維持されます:
481 @lilypond[quote,verbatim]
482 musicA = \relative c'' { d4 d d d }
483 musicB = \relative c'' { g4 g g g }
486 \new Voice = "A" { s1*5 } % Voice "A" を 5 小節の間、維持する
487 \new Voice = "B" { s1*5 } % Voice "B" を 5 小節の間、維持する
492 \context Voice = "A" {
496 \context Voice = "B" {
500 \context Voice = "A" { \musicA }
501 \context Voice = "B" { \musicB }
502 \context Voice = "A" { \musicA }
513 @cindex lyrics, aligning with sporadic melody (途切れ途切れのメロディに歌詞を揃える)
516 途切れ途切れのメロディに歌詞を持たせる方法を示しています。@c
518 メロディや伴奏は複数のセクションによって構成されることになります。
521 @lilypond[quote,verbatim]
522 melody = \relative c'' { a4 a a a }
523 accompaniment = \relative c' { d4 d d d }
524 words = \lyricmode { These words fol -- low the mel -- o -- dy }
527 \new Staff = "music" {
529 \new Voice = "melody" {
531 s1*4 % Voice "melody" を 4 小節の間、残します
534 \new Voice = "accompaniment" {
539 \context Voice = "melody" { \melody }
540 \context Voice = "accompaniment" { \accompaniment }
542 \context Voice = "accompaniment" { \accompaniment }
544 \context Voice = "melody" { \melody }
545 \context Voice = "accompaniment" { \accompaniment }
550 \new Lyrics \with { alignAboveContext = #"music" }
551 \lyricsto "melody" { \words }
556 これに代わる方法として、メロディに直接空白休符を付け加えて、@c
557 メロディが伴奏と揃うようにする方法があります
558 -- 多くの場合、こちらの方法の方が良いかもしれません:
561 @lilypond[quote,verbatim]
562 melody = \relative c'' {
568 accompaniment = \relative c' {
574 words = \lyricmode { These words fol -- low the mel -- o -- dy }
578 \new Staff = "music" {
580 \new Voice = "melody" {
584 \new Voice = "accompaniment" {
590 \new Lyrics \with { alignAboveContext = #"music" }
591 \lyricsto "melody" { \words }
597 @node コンテキストのプラグインを変更する
598 @subsection コンテキストのプラグインを変更する
599 @translationof Modifying context plug-ins
601 @c TODO Should this be Modifying engravers or Modifying contexts?
603 記譜コンテキスト (@code{Score} や @code{Staff} のような) は@c
605 @q{エングラーバ} と呼ばれる記譜要素を作成するプラグインを保持します。@c
606 例えば、@code{Voice} コンテキストは @code{Note_head_engraver} を保持し、@c
607 @code{Staff} コンテキストは @code{Key_signature_engraver} を保持します。
611 @rinternals{Engravers and Performers}.
614 Internals Reference @expansion{} Translation @expansion{} Engravers.
618 @rinternals{Contexts}
621 Internals Reference @expansion{} Translation @expansion{} Context.
623 の中にある各コンテキストについての説明では、@c
624 そのコンテキストで使用されるエングラーバがリストアップされています。
626 これらのプラグインを入れ換えると有用な場合があります。@c
627 プラグインを入れ換えるには、新たに作成するコンテキストを
628 @code{\new} あるいは @code{\context} で開始し、@c
629 そのコンテキストを以下のように変更します:
634 \new @var{context} \with @{
647 ここで、@dots{} はエングラーバの名前になります。@c
648 ここで、@code{Staff} コンテキストから @code{Time_signature_engraver} と
649 @code{Clef_engraver} を削除する簡単な例を示します:
651 @lilypond[quote,relative=1,verbatim,fragment]
657 \remove "Time_signature_engraver"
658 \remove "Clef_engraver"
665 2 番目の譜には、拍子記号と音部記号がありません。@c
666 この方法は、オブジェクトを不可視にするよりも乱暴な方法です。@c
667 なぜなら、譜全体に影響を与えるからです。@c
668 さらに、望む望まないに係わらず、この方法はスペースにも影響を与えます。@c
669 オブジェクトを消すもっと洗練された方法については、@c
670 @rlearning{オブジェクトの可視性と色} を参照してください。
673 通常、小節線と拍子記号は楽譜全体で同期されます。@c
674 これは @code{Timing_translator} と @code{Default_bar_line_engraver}
676 このプラグインは拍子記号の管理や、小節内の配置の管理などを行います。@c
677 これらのエングラーバを @code{Score} コンテキストから
678 @code{Staff} コンテキストへ異動させることにより、@c
679 楽譜の各譜に独自の拍子記号を持たせることが可能になります。
681 @cindex polymetric scores (多拍子の楽譜)
682 @cindex Time signatures, multiple (複数の拍子記号)
684 @lilypond[quote,relative=1,ragged-right,verbatim,fragment]
686 \remove "Timing_translator"
687 \remove "Default_bar_line_engraver"
690 \consists "Timing_translator"
691 \consists "Default_bar_line_engraver"
697 \consists "Timing_translator"
698 \consists "Default_bar_line_engraver"
708 通常、エングラーバが指定される順序は問題にはなりません。@c
709 しかしながら、いくつかの特殊なケースでは、この順序が重要になります。@c
710 例えば、あるエングラーバがプロパティを記述して、@c
711 それを他のエングラーバが読む場合、あるいは、@c
712 あるエングラーバがグラフィカル オブジェクトを作成し、@c
713 それを他のエングラーバが処理しなければならない場合です。@c
714 エングラーバは指定された順序に従って呼び出され、処理を実行します。
717 通常、@code{Bar_engraver} を最初に指定し、@c
718 @code{New_fingering_engraver} を @code{Script_column_engraver} の前で@c
720 他にも指定順序が問題になるケースがあるかもしれません。
723 @node コンテキストのデフォルト設定を変更する
724 @subsection コンテキストのデフォルト設定を変更する
725 @translationof Changing context default settings
727 @code{Score}, @code{Staff} それに @code{Voice} コンテキストにおいて@c
728 デフォルトで使用されるコンテキスト設定は、以下の例で示すように、@c
729 @code{\layout} ブロックの中で指定することができます。@c
730 @code{\layout} ブロックは、それを適用する @code{\score} ブロックの中で、かつ、@c
733 以下のような方法でコンテキストのデフォルト値を指定する場合、@c
734 @code{\set} コマンドとコンテキストを@c
735 省略する必要があるということに注意してください:
737 @lilypond[quote,verbatim]
740 a4^"Really small, thicker stems, no time signature" a a a
747 \override Stem #'thickness = #4.0
748 \remove "Time_signature_engraver"
754 上記の例の中で、@code{\Staff} コマンドは、@c
755 後に続く記述をその score ブロックの中にあるすべての譜に適用するということを@c
759 @code{Score} コンテキストや @code{Voice} コンテキストに@c
764 変数に加えられたコンテキストの変更を収集すること、それに、@c
765 その変数を参照することでそれらの変更を @code{\context} 定義に@c
768 @code{\RemoveEmptyStaffContext} はカレントの
769 @code{\Staff} 設定を上書きします。@c
770 @code{\RemoveEmptyStaffContext} を使用する staff
771 のデフォルト設定を変更したいのならば、@c
772 @code{\RemoveEmptyStaffContext} を呼び出した後に@c
779 \RemoveEmptyStaffContext
781 \override Stem #'thickness = #4.0
786 @c TODO: add \with in here.
790 @subsection 新しいコンテキストを定義する
791 @translationof Defining new contexts
793 @cindex contexts, defining new (新しいコンテキストを定義する)
794 @cindex engravers, including in contexts (エングラーバをコンテキストに含める)
809 @code{Staff} や @code{Voice} のようなコンテキストは、@c
810 簡単なブロックの組み合わせで構成されています。
811 エングラーバ プラグインの組み合わせを変えることで、@c
812 新しいタイプのコンテキスを作成することができます。
814 次の例は、ゼロからタイプの異なる @code{Voice} コンテキストを作り上げる方法を@c
816 このコンテキストは @code{Voice} コンテキストに似ていますが、@c
817 音符の代わりにスラッシュを譜の中央に譜刻します。@c
818 これはジャズで即興を表すのに使うことができます。
820 @lilypond[quote,ragged-right]
823 \type "Engraver_group"
824 \consists "Note_heads_engraver"
825 \consists "Rhythmic_column_engraver"
826 \consists "Text_engraver"
827 \consists Pitch_squash_engraver
828 squashedPosition = #0
829 \override NoteHead #'style = #'slash
830 \override Stem #'transparent = ##t
831 \override Flag #'transparent = ##t
835 \accepts "ImproVoice"
839 a4 d8 bes8 \new ImproVoice { c4^"ad lib" c
840 c4 c^"undress" c_"while playing :)" c }
846 これらの設定は @code{\layout} ブロック内部の @code{\context} ブロック@c
857 以下では、上記の例の @dots{} に入るべき入力について議論します。
859 最初に、新しいコンテキストの名前を定義する必要があります:
865 このコンテキストは @code{Voice} に似せる必要があるため、@c
866 (既存の) @code{Voice} と同じ機能を実現するコマンドが必要です。@c
867 これは、新しいコンテキストにエイリアス @code{Voice} を与えることで実現できます。
873 このコンテキストは音符と指示テキストを譜刻しますので、@c
874 それらの機能を提供するエングラーバを付け加える必要があります:
877 \consists Note_heads_engraver
878 \consists Text_engraver
881 しかしながら、音符の代わりにスラッシュを譜の中央線上に配置します:
884 \consists Pitch_squash_engraver
885 squashedPosition = #0
888 @rinternals{Pitch_squash_engraver} は
889 (@rinternals{Note_heads_engraver} によって作成される) 符頭を変更し、@c
890 符頭の垂直位置を @code{squashedPosition} にセットします
891 -- 今回は @code{0}、つまり中央線上です。
896 \override NoteHead #'style = #'slash
897 \override Stem #'transparent = ##t
898 \override Flag #'transparent = ##t
901 これらのプラグインすべてが共同する必要があり、@c
903 このプラグインは常に @code{Engraver_group} であり、@c
904 キーワード @code{\type} を付ける必要があります。
907 \type "Engraver_group"
915 \type "Engraver_group"
916 \consists "Note_heads_engraver"
917 \consists "Text_engraver"
918 \consists Pitch_squash_engraver
919 squashedPosition = #0
920 \override NoteHead #'style = #'slash
921 \override Stem #'transparent = ##t
922 \override Flag #'transparent = ##t
929 通常の @code{Voice} と同様に、@c
930 @code{ImproVoice} を @code{Staff} の下に置く必要があります。@c
931 それゆえ、@code{Staff} 定義を @code{\accepts} コマンドで変更します:
941 @code{\accepts} の反対は @code{\denies} です。@c
942 これは既存のコンテキスト定義を再利用する場合に必要となります。
944 以下のように、両方を @code{\layout} ブロックの中に置きます:
954 \accepts "ImproVoice"
959 それから、このサブセクションの最初にあった出力を入力します:
967 c c_"while playing :)"
975 @subsection コンテキストを揃える
976 @translationof Context layout order
978 新しいコンテキストを既存のコンテキストの上または下に揃えることができます。@c
979 これはボーカル譜 (@rlearning{合唱}) を組む場合やオッシアで役に立ちます。
981 @c TODO Better example needed. Ref LM, and expand on it.
984 @funindex alignAboveContext
985 @funindex alignBelowContext
987 @lilypond[quote,ragged-right]
990 \relative c' \new Staff = "main" {
993 \new Staff \with { alignAboveContext = #"main" } \ossia
1000 @cindex nested contexts (ネストされたコンテキスト)
1001 @cindex contexts, nested (ネストされたコンテキスト)
1006 @code{PianoStaff} のようなコンテキストは、@c
1008 他のコンテキストを内部に保持することができます。@c
1009 ネスト構造をとることができるコンテキストは、@c
1010 コンテキストの @qq{accepts} リストによって定義されています。@c
1011 このリストには存在しないコンテキストは、楽譜が譜刻されるとき、@c
1012 (@code{PianoStaff} などの) 親コンテキストの下に配置されます。@c
1013 例えば、@code{PianoStaff} コンテキストは、デフォルトで、@c
1014 @code{Staff} と @code{FiguredBass} コンテキストを内部に受け入れるよう@c
1015 定義されていますが、(例えば) @code{Lyrics} コンテキストは受け入れません。@c
1016 そのため、以下の例では、歌詞は 2 つの譜の間ではなく、@c
1019 @lilypond[verbatim,quote,relative=1]
1022 \new Staff { e4 d c2 }
1023 \addlyrics { Three blind mice }
1031 コンテキストの @qq{accepts} リストを変更することで、
1032 ネストされるコンテキストを追加するができます。@c
1033 ですから、歌詞を 2 つの譜の間に表示させたいのなら、以下のようにします:
1035 @lilypond[verbatim,quote,relative=1]
1036 \new PianoStaff \with { \accepts Lyrics }
1038 \new Staff { e4 d c2 }
1039 \addlyrics { Three blind mice }
1047 @code{\accepts} の反対は @code{\denies} です。@c
1048 これはコンテキストを @qq{accepts} リストから削除します。
1052 @section 内部リファレンスの説明
1053 @translationof Explaining the Internals Reference
1059 * グラフィカル オブジェクトを決定する::
1063 @node 内部リファレンスを使いこなす
1064 @subsection 内部リファレンスを使いこなす
1065 @translationof Navigating the program reference
1067 @c TODO remove this (it's in the LM)
1068 @c Replace with more factual directions
1070 以下の譜面の運指記号を移動させたいとします:
1072 @lilypond[quote,relative=2,verbatim]
1078 運指指示のドキュメント (@ref{運指の指示}) を見ると、@c
1079 以下のようなセクションがあることに気付くはずです:
1084 内部リファレンス: @rinternals{Fingering}
1089 @c outdated info; probably will delete.
1091 This fragment points to two parts of the program reference: a page
1092 on @code{FingeringEvent} and one on @code{Fingering}.
1094 The page on @code{FingeringEvent} describes the properties of the music
1095 expression for the input @code{-2}. The page contains many links
1096 forward. For example, it says
1099 Accepted by: @rinternals{Fingering_engraver},
1103 That link brings us to the documentation for the Engraver, the
1107 This engraver creates the following layout objects: @rinternals{Fingering}.
1110 In other words, once the @code{FingeringEvent}s are interpreted, the
1111 @code{Fingering_engraver} plug-in will process them.
1115 @c I can't figure out what this is supposed to mean. -gp
1117 The @code{Fingering_engraver} is also listed to create
1118 @rinternals{Fingering} objects,
1120 @c old info? it doesn't make any sense to me with our current docs.
1122 second bit of information listed under @b{See also} in the Notation
1127 内部リファレンスは HTML ドキュメント形式で入手可能です。@c
1128 内部リファレンスは、オンラインか HTML ドキュメントをダウンロードするかして、@c
1129 HTML 形式で読むことを強く推奨します。@c
1130 PDF マニュアルを使用していると、@c
1131 このセクションを理解するのはずっと困難になります。@c
1132 (訳者: 日本語では PDF 形式での提供はありません。)
1135 @rinternals{Fingering} へのリンクを辿ってください。@c
1136 ページの先頭に、以下のような記述があります:
1139 Fingering objects are created by: @rinternals{Fingering_engraver} and
1140 @rinternals{New_fingering_engraver}.
1143 内部リファレンスの中にある関連リンクを辿っていくことで、@c
1144 プログラム内部の情報フローを追っていくことができます:
1148 @item @rinternals{Fingering}:
1149 @rinternals{Fingering} objects are created by:
1150 @rinternals{Fingering_engraver}
1152 (@rinternals{Fingering}:
1153 @rinternals{Fingering} オブジェクトを作成するのは:
1154 @rinternals{Fingering_engraver})
1157 @item @rinternals{Fingering_engraver}:
1158 Music types accepted:
1159 @rinternals{fingering-event}
1161 (@rinternals{Fingering_engraver}:
1162 受け取る音楽タイプは: @rinternals{fingering-event})
1164 @item @rinternals{fingering-event}:
1165 Music event type @code{fingering-event} is in
1166 Music expressions named @rinternals{FingeringEvent}
1168 (@rinternals{fingering-event}:
1169 音楽イベント タイプ @code{fingering-event} は
1170 @rinternals{FingeringEvent} という名前の音楽表記の中にあります)
1174 このパスは、プログラム内部での情報フローとは逆向きです:
1175 出力からスタートして、入力イベントで終わっています。@c
1176 入力イベントからスタートして、情報フローを読み進め、@c
1177 最後は出力オブジェクトに辿り着くこともできます。
1179 内部リファレンスを通常のドキュメントのように読むこともできます。@c
1182 @rinternals{Music definitions},
1185 @code{Music definitions},
1187 @rinternals{Translation}, それに @rinternals{Backend} です。
1188 各章は、使用されているすべての定義と調整可能なすべてのプロパティを@c
1192 @node レイアウト インターフェイス
1193 @subsection レイアウト インターフェイス
1194 @translationof Layout interfaces
1196 @cindex interface, layout (レイアウト インターフェイス)
1197 @cindex layout interface (レイアウト インターフェイス)
1198 @cindex grob (グラフィカル オブジェクト)
1200 前のセクションで見た HTML ページには、@c
1201 @rinternals{Fingering} と呼ばれるレイアウト オブジェクトについての@c
1203 そのようなオブジェクトは楽譜で記号となります。@c
1204 レイアウト オブジェクトは (太さや向きのような) 数値を保持する@c
1206 関連オブジェクトへのポインタも持っています。@c
1207 レイアウト オブジェクトは @emph{Grob}
1208 -- これはグラフィカル オブジェクトを縮めたものです --
1210 Grob についての詳細は、@rinternals{grob-interface} を参照してください。
1212 @code{Fingering} のページは、@c
1213 @code{Fingering} オブジェクトの定義をリストアップしています。@c
1214 例えば、このページには以下のような記述があります:
1217 @code{padding} (dimension, in staff space):
1223 これは、この数値は少なくとも符頭の 0.5 倍の距離を保つということを意味します。
1226 各レイアウト オブジェクトは、記譜要素あるいは写植要素としての機能を@c
1228 例えば、@code{Fingering} オブジェクトは以下の側面を持っています:
1232 Its size is independent of the horizontal spacing, unlike slurs or beams.
1234 (このオブジェクトのサイズは、スラーや連桁と異なり、@c
1238 It is a piece of text. Granted, it is usually a very short text.
1240 (このオブジェクトはテキストです。通常、これは非常に短いテキストです。)
1243 That piece of text is typeset with a font, unlike slurs or beams.
1245 (このテキストは、スラーや連桁と異なり、フォントで写植されます。)
1248 Horizontally, the center of the symbol should be aligned to the
1249 center of the note head.
1251 (水平方向では、この記号の中心は符頭の中心に揃えられます。)
1254 Vertically, the symbol is placed next to the note and the staff.
1256 (垂直方向では、この記号は音符や譜の近く配置されます。)
1259 The vertical position is also coordinated with other superscript
1260 and subscript symbols.
1262 (また、垂直方向の位置は、他の上付き記号や下付き記号との調整によって決まります。)
1265 これらの側面はそれぞれ、いわゆる @emph{インターフェイス}
1267 それらは、@rinternals{Fingering} ページの最下部でリストアップされています。
1270 This object supports the following interfaces:
1272 (このオブジェクトは以下のインターフェイスをサポートします:)
1274 @rinternals{item-interface},
1275 @rinternals{self-alignment-interface},
1276 @rinternals{side-position-interface}, @rinternals{text-interface},
1277 @rinternals{text-script-interface}, @rinternals{font-interface},
1278 @rinternals{finger-interface}, and @rinternals{grob-interface}.
1282 それぞれのオブジェクト インターフェイスのページに行くことができます。@c
1283 各インターフェイスはいくつかのプロパティを持ちます。@c
1284 それらプロパティの中には、ユーザにとって役に立たないもの
1285 (@q{内部プロパティ}) もありますが、それ以外は変更可能です。
1287 これまで @code{Fingering} オブジェクトについて話してきましたが、@c
1288 これは実際にはそれほど多くのことをしているわけではありません。@c
1289 初期化ファイル (@rlearning{その他の情報源} を参照してください)
1290 @file{scm/define-grobs.scm} がこの @q{オブジェクト} の本質を示しています:
1295 (avoid-slur . around)
1296 (slur-padding . 0.2)
1297 (staff-padding . 0.5)
1298 (self-alignment-X . 0)
1299 (self-alignment-Y . 0)
1300 (script-priority . 100)
1301 (stencil . ,ly:text-interface::print)
1302 (direction . ,ly:script-interface::calc-direction)
1303 (font-encoding . fetaText)
1304 (font-size . -5) ; don't overlap when next to heads.
1305 (meta . ((class . Item)
1306 (interfaces . (finger-interface
1308 text-script-interface
1310 side-position-interface
1311 self-alignment-interface
1312 item-interface))))))
1317 @code{Fingering} オブジェクトは変数設定の塊に過ぎず、@c
1318 内部リファレンスの中にある Web ページは、@c
1319 この定義から直接生成されたに過ぎません。
1322 @node グラフィカル オブジェクトを決定する
1323 @subsection グラフィカル オブジェクトを決定する
1324 @translationof Determining the grob property
1326 @c TODO remove this (it's in the LM)
1327 @c Replace with more factual directions
1329 以下の @b{2} の位置を変更しようとしていたことを思い出してください:
1331 @lilypond[quote,fragment,relative=2,verbatim]
1337 垂直方向で見て、@b{2} は元の音符の隣に配置されるのですから、@c
1338 この配置に関連するインターフェイスに干渉する必要があります。@c
1339 これは @code{side-position-interface} を用いて行います。@c
1340 このインターフェイスについてのページには、以下のように記述されています:
1343 @code{side-position-interface}
1345 Position a victim object (this one) next to other objects (the
1346 support). The property @code{direction} signifies where to put the
1347 victim object relative to the support (left or right, up or down?)
1349 (対象オブジェクトを他のオブジェクト (サポート オブジェクト)
1351 このプロパティ @code{direction} は、@c
1352 対象オブジェクトをどこに配置するかを@c
1353 サポート オブジェクトからの相対位置で示します
1359 この記述の下に、以下のような変数 @code{padding} についての記述があります:
1364 (dimension, in staff space)
1367 Add this much extra space between objects that are next to each other.
1368 (隣り合うオブジェクトの間にスペースを付け加えます)
1372 @code{padding} の値を増やすことで、@c
1373 運指記号を符頭から離すことができます。@c
1374 以下のコマンドは、音符と運指記号の間に 3 譜スペースを挿入します:
1377 \once \override Voice.Fingering #'padding = #3
1380 このコマンドを @code{Fingering} オブジェクトが作成される前に挿入する
1381 -- つまり @code{c2} の前に挿入する -- と、以下のような結果が得られます:
1383 @lilypond[quote,relative=2,fragment,verbatim]
1384 \once \override Voice.Fingering #'padding = #3
1391 このケースでは、調整されるコンテキストは @code{Voice} です。@c
1392 このことは、内部リファレンスの @rinternals{Fingering_engraver}
1393 プラグインについてのページからわかります。@c
1394 このページには、以下のような記述があります:
1397 Fingering_engraver is part of contexts: @dots{} @rinternals{Voice}
1398 (Fingering_engraver は次のコンテキストの一部です: @dots{} @rinternals{Voice})
1404 @translationof Naming conventions
1406 内部リファレンスについて他に説明しておくべき事柄として、@c
1407 さまざまな命名規約についての概要があります:
1410 @item Scheme スタイル: 小文字の単語をハイフンでつなぎます
1411 (1 単語の名前を含みます) -- 例: lowercase-with-hyphens
1412 @item Scheme 関数: Scheme スタイルの先頭に @code{ly:} を付けます
1413 -- 例: ly:plus-scheme-style
1414 @item 音楽イベント、音楽クラス、それに音楽プロパティ: Scheme スタイルです
1415 -- 例: as-scheme-functions
1416 @item グラフィカル オブジェクト インターフェイス: Scheme スタイルです
1419 @item バックエンド プロパティ: Scheme スタイルです (が、X と Y があります!)
1420 @item コンテキスト (それに、音楽表記とグラフィカル オブジェクト):
1421 大文字で始まる単語、あるいはそれらをつなげます
1422 -- 例: Capitalized, CamelCase
1424 小文字で始まる単語に、大文字で始まる単語をつなげます
1425 -- 例: lowercaseFollowedByCamelCase
1427 大文字で始まる単語に、小文字で始まる単語をアンダスコアでつなげます
1428 -- 例: Capitalized_followed_by_lowercase_and_with_underscores
1433 @item 命名規約のうち、慣習なのはどれで、規則なのはどれか?
1434 @item 命名規約のうち、どれが基本言語の規則で、@c
1435 どれが LP (訳者: LilyPond?) 特有の規則なのか?
1441 @translationof Modifying properties
1443 @c TODO change the menu and subsection node names to use
1444 @c backslash once the new macro to handle the refs
1445 @c is available. Need to find and change all refs at
1446 @c the same time. -td
1459 @subsection プロパティ変更の概要
1460 @translationof Overview of modifying properties
1462 各コンテキストは、ある特定のタイプのグラフィカル オブジェクトを作成することに@c
1464 それらのオブジェクトを表示するために使用される設定も、@c
1466 それらの設定を変更することにより、オブジェクトの見た目を変えることができます。
1468 コンテキストに保存されるプロパティには 2 種類あります:
1469 コンテキスト プロパティとグラフィカル オブジェクト プロパティです。@c
1470 コンテキスト プロパティは、コンテキスト全体に適用され、@c
1471 コンテキスト自体をどのように表示するかを制御します。@c
1472 対照的に、グラフィカル オブジェクト プロパティは、コンテキストの中に表示される@c
1473 ある特定のタイプのグラフィカル オブジェクトに適用されます。
1475 @code{\set} コマンドと @code{\unset} コマンドは、@c
1476 コンテキスト プロパティの値を変更するために使用されます。@c
1477 @code{\override} コマンドと @code{\revert} コマンドは、@c
1478 グラフィカル オブジェクト プロパティの値を変更するために使用されます。
1481 The syntax for this is
1484 \override @var{context}.@var{name} #'@var{property} = #@var{value}
1487 Here @var{name} is the name of a graphical object, like
1488 @code{Stem} or @code{NoteHead}, and @var{property} is an internal
1489 variable of the formatting system (@q{grob property} or @q{layout
1490 property}). The latter is a symbol, so it must be quoted. The
1491 subsection @ref{Modifying properties}, explains what to fill in
1492 for @var{name}, @var{property}, and @var{value}. Here we only
1493 discuss the functionality of this command.
1498 \override Staff.Stem #'thickness = #4.0
1502 makes stems thicker (the default is 1.3, with staff line thickness as a
1503 unit). Since the command specifies @code{Staff} as context, it only
1504 applies to the current staff. Other staves will keep their normal
1505 appearance. Here we see the command in action:
1507 @lilypond[quote,verbatim,relative=2,fragment]
1509 \override Staff.Stem #'thickness = #4.0
1515 The @code{\override} command changes the definition of the @code{Stem}
1516 within the current @code{Staff}. After the command is interpreted
1517 all stems are thickened.
1519 Analogous to @code{\set}, the @var{context} argument may be left out,
1520 causing the default context @code{Voice} to be used. Adding
1521 @code{\once} applies the change during one timestep only.
1523 @lilypond[quote,fragment,verbatim,relative=2]
1525 \once \override Stem #'thickness = #4.0
1530 The @code{\override} must be done before the object is
1531 started. Therefore, when altering @emph{Spanner} objects such as slurs
1532 or beams, the @code{\override} command must be executed at the moment
1533 when the object is created. In this example,
1535 @lilypond[quote,fragment,verbatim,relative=2]
1536 \override Slur #'thickness = #3.0
1538 \override Beam #'thickness = #0.6
1543 the slur is fatter but the beam is not. This is because the command for
1544 @code{Beam} comes after the Beam is started, so it has no effect.
1546 Analogous to @code{\unset}, the @code{\revert} command for a context
1547 undoes an @code{\override} command; like with @code{\unset}, it only
1548 affects settings that were made in the same context. In other words, the
1549 @code{\revert} in the next example does not do anything.
1552 \override Voice.Stem #'thickness = #4.0
1553 \revert Staff.Stem #'thickness
1556 Some tweakable options are called @q{subproperties} and reside inside
1557 properties. To tweak those, use commands of the form
1559 @c leave this as a long long
1561 \override @var{context}.@var{name} #'@var{property} #'@var{subproperty} = #@var{value}
1568 \override Stem #'(details beamed-lengths) = #'(4 4 3)
1575 @rinternals{Backend},
1576 @rinternals{All layout objects},
1577 @rinternals{OverrideProperty},
1578 @rinternals{RevertProperty},
1579 @rinternals{PropertySet}
1584 バックエンドはオブジェクト プロパティのタイプ チェックを@c
1586 Scheme 値の循環参照は、ハング アップまたはクラッシュ、@c
1587 あるいは両方を引き起こす可能性があります。
1592 @subsection @code{\set} コマンド
1593 @translationof The set command
1595 @cindex properties (プロパティ)
1597 @cindex changing properties (プロパティを変更する)
1599 各コンテキストは @emph{プロパティ} の集合を持ちます。@c
1600 プロパティとは、コンテキストの中に保持されている変数です。@c
1601 コンテキスト プロパティは、@code{\set} コマンドによって変更されます。@c
1602 @code{\set} コマンドは以下のような構文を持ちます:
1605 \set @var{context}.@var{property} = #@var{value}
1608 @var{value} は Scheme オブジェクトですので、@c
1609 @code{#} 文字を前に置く必要があります。
1611 通常、コンテキスト プロパティの名前は、@c
1612 小文字で始まる単語に大文字で始まる単語をつなげたものです。@c
1613 これらはたいてい音楽から記譜への翻訳を制御します
1614 -- 例えば、@code{localKeySignature} (臨時記号を表示するかどうかを決定します)
1615 や、@code{measurePosition} (小節線を表示するタイミングを決定します) です。@c
1616 コンテキスト プロパティは、楽曲の解釈をしている間、@c
1617 ずっと値を変更しておくことができます。@c
1618 @code{measurePosition} がその良い例です。@c
1619 コンテキスト プロパティは @code{\set} で変更されます。
1621 例えば、コンテキスト プロパティ @code{skipBars} が
1622 @code{#t} にセットされていれば、@c
1623 複小節休符は 1 つの小節に統合されます:
1625 @lilypond[quote,verbatim,relative=2,fragment]
1627 \set Score.skipBars = ##t
1631 @var{context} 引数が省略されている場合、@c
1632 プロパティはカレントの最下位のコンテキストにセットされます
1633 (一般に、@code{ChordNames}, @code{Voice}, @code{TabVoice},
1634 あるいは @code{Lyrics} です)。
1636 @lilypond[quote,verbatim,relative=2]
1637 \set Score.autoBeaming = ##f
1641 \set autoBeaming = ##t
1649 変更は @q{オンザフライ} (その場、その時々) で適用されるため、@c
1650 設定 @code{\set autoBeaming = ##t} は 2 番目の 8 分音符グループだけに@c
1653 最下位コンテキストが常に変更しようとしているプロパティを持っているとは@c
1655 -- 例えば、@code{skipBars} プロパティをデフォルトの最下位コンテキスト
1656 (この場合は、@code{Voice} です) にセットしようと試みても、効果はありません。@c
1657 なぜなら、@code{skipBars} は @code{Score} コンテキストのプロパティだからです。
1659 @lilypond[quote,verbatim,relative=2]
1665 コンテキストは階層構造をとるため、音楽表記を囲っているコンテキスト
1666 -- 例えば、@code{Staff} -- が指定された場合、@c
1667 変更はカレントの @code{Staff} の中にあるすべての @code{Voice} に適用されます。
1674 \unset @var{context}.@var{property}
1678 は、@var{context} から @var{property} の定義を削除するために使用されます。@c
1679 このコマンドは、@var{context} の中にセットされた場合にのみ、定義を削除します。@c
1680 音楽表記を囲っているコンテキストにセットされたプロパティは、@c
1681 囲まれているコンテキストの中にある @code{\unset} では変更されません:
1683 @lilypond[quote,verbatim,relative=2]
1684 \set Score.autoBeaming = ##t
1689 \unset Score.autoBeaming
1698 最下位コンテキストに対しては @var{context} 引数を指定する必要はありません。@c
1702 \set Voice.autoBeaming = ##t
1703 \set autoBeaming = ##t
1707 は、カレントの最下位コンテキストが @code{Voice} であれば、等価です。
1711 @code{\set} の前に @code{\once} を置くと、@c
1712 その設定は単一の時間ステップにだけ適用されます:
1714 @lilypond[quote,verbatim,relative=2]
1716 \once \set fontSize = #4.7
1721 利用可能なすべてのコンテキスト プロパティについての完全な記述は、@c
1725 @rinternals{Tunable context properties}.
1728 Translation @expansion{} Tunable context properties.
1735 @rinternals{Tunable context properties}
1738 @cindex grob properties (グラフィカル オブジェクト プロパティ)
1739 @cindex properties, grob (グラフィカル オブジェクト プロパティ)
1744 @subsection @code{\override} コマンド
1745 @translationof The override command
1747 特殊なタイプのコンテキスト プロパティがあります:
1748 グラフィカル オブジェクト記述です。@c
1749 グラフィカル オブジェクト記述には @code{StudlyCaps} という名前
1750 (大文字で始まります) が付けられています。@c
1751 これらは、関連リストとして、ある特定の種類のグラフィカル オブジェクト用の
1752 @q{デフォルト設定} を保持します。@c
1753 各グラフィカル オブジェクト記述の設定を調べるには、@c
1754 @file{scm/define-grobs.scm} を参照してください。@c
1755 各グラフィカル オブジェクト記述は @code{\override} を用いて変更します。
1757 @code{\override} は、実際のところ、簡略化した記述です。
1760 \override @var{context}.@var{GrobName} #'@var{property} = #@var{value}
1766 @c leave this long line -gp
1768 \set @var{context}.@var{GrobName} =
1769 #(cons (cons '@var{property} @var{value})
1770 <previous value of @var{context}.@var{GrobName}>)
1773 @code{context}.@code{GrobName} (alist) の値は、@c
1774 個々のグラフィカル オブジェクトのプロパティを初期化するために使用されます。@c
1775 グラフィカル オブジェクトは、Scheme スタイルの名前
1776 (小文字の単語を @code{-} でつないだもの) のプロパティを持ちます。@c
1777 グラフィカル オブジェクト プロパティの値は、@c
1778 フォーマット処理の間ずっと変更されています:
1780 コールバック関数を用いてプロパティを計算することに他なりません。@c
1782 例えば、@code{Stem} オブジェクトの @code{thickness} プロパティを@c
1783 オーバライドすることによって、符幹の太さを太くすることができます:
1785 @lilypond[quote,verbatim,relative=2]
1787 \override Voice.Stem #'thickness = #3.0
1791 If no context is specified in an @code{\override}, the bottom
1794 @lilypond[quote,verbatim,relative=2]
1795 { \override Staff.Stem #'thickness = #3.0
1799 \override Stem #'thickness = #0.5
1809 @cindex reverting overrides (オーバライドを元に戻す)
1810 @cindex overrides, reverting (オーバライドを元に戻す)
1812 @code{\override} の効果は、@code{\revert} によって元に戻すことができます:
1814 @lilypond[quote,verbatim,relative=2]
1816 \override Voice.Stem #'thickness = #3.0
1818 \revert Voice.Stem #'thickness
1822 @code{\override} と @code{\revert} の効果は、@c
1823 その時点から影響を受けるコンテキストの中にある@c
1824 すべてのグラフィカル オブジェクトに適用されます:
1826 @lilypond[quote,verbatim,relative=2]
1831 \override Staff.Stem #'thickness = #3.0
1835 \revert Staff.Stem #'thickness
1843 @cindex overriding for only one moment (一時的にオーバライドする)
1845 @code{\once} を @code{\override} と共に用いることで、@c
1846 カレントの時間ステップだけに効果を与えることができます:
1848 @lilypond[quote,verbatim,relative=2]
1852 \override Stem #'thickness = #3.0
1856 \once \override Stem #'thickness = #3.0
1865 Commands which change output generally look like
1868 \override Voice.Stem #'thickness = #3.0
1872 To construct this tweak we must determine these bits of information:
1875 @item the context: here @code{Voice}.
1876 @item the layout object: here @code{Stem}.
1877 @item the layout property: here @code{thickness}.
1878 @item a sensible value: here @code{3.0}.
1881 Some tweakable options are called @q{subproperties} and reside inside
1882 properties. To tweak those, use commands in the form
1885 \override Stem #'(details beamed-lengths) = #'(4 4 3)
1888 @cindex internal documentation
1889 @cindex finding graphical objects
1890 @cindex graphical object descriptions
1893 @cindex internal documentation
1895 For many properties, regardless of the data type of the property, setting the
1896 property to false ( @code{##f} ) will result in turning it off, causing
1897 LilyPond to ignore that property entirely. This is particularly useful for
1898 turning off grob properties which may otherwise be causing problems.
1900 We demonstrate how to glean this information from the notation manual
1901 and the program reference.
1907 @rinternals{Backend}
1911 @subsection @code{\tweak} コマンド
1912 @translationof The tweak command
1915 @cindex tweaking (調整)
1917 @code{\tweak} を用いたグラフィカル オブジェクト プロパティの変更は、@c
1918 コンテキストの中にあるすべてのグラフィカル オブジェクトに適用されます。@c
1920 影響を受けるコンテキストの中にあるすべてのグラフィカル オブジェクトではなく、@c
1921 1 つのグラフィカル オブジェクトだけに変更を適用したい場合もあります。@c
1922 そうするには、@code{\tweak} コマンドを用います。@c
1923 @code{\tweak} コマンドは以下のような構文を持ちます:
1926 \tweak #'@code{grob-property} #@code{value}
1929 @code{\tweak} コマンドは、音楽の流れの中で
1930 @code{value} のすぐ後に現れるオブジェクトに変更を適用します。
1933 In some cases, it is possible to take a short-cut for tuning
1934 graphical objects. For objects that are created directly from
1935 an item in the input file, you can use the @code{\tweak} command.
1938 @lilypond[relative=2,verbatim,quote]
1943 \tweak #'duration-log #1
1946 -\tweak #'padding #8
1952 But the main use of the @code{\tweak} command is to modify just
1953 one of a number of notation elements which start at the same musical
1954 moment, like the notes of a chord, or tuplet brackets which start
1957 The @code{\tweak} command sets a property in the following object
1958 directly, without requiring the grob name or context to be
1959 specified. For this to work, it is necessary for the @code{\tweak}
1960 command to remain immediately adjacent to the object to which it is
1961 to apply after the input file has been converted to a music stream.
1962 This is often not the case, as many additional elements are inserted
1963 into the music stream implicitly. For example, when a note which is
1964 not part of a chord is processed, LilyPond implicitly inserts a
1965 @code{ChordEvent} event before the note, so separating the tweak
1966 from the note. However, if chord symbols are placed round the
1967 tweak and the note, the @code{\tweak} command comes after the
1968 @code{ChordEvent} in the music stream, so remaining adjacent to the
1969 note, and able to modify it.
1973 @lilypond[relative=2,verbatim,quote]
1974 <\tweak #'color #red c>4
1980 @lilypond[relative=2,verbatim,quote]
1981 \tweak #'color #red c4
1986 調整コマンドの構文と使用方法についての紹介は、@c
1987 @rlearning{調整手段} を参照してください。
1989 同じようなオブジェクトがいくつか、同じ音楽タイミングで配置されている場合、@c
1990 @code{\override} コマンドでそれらの 1 つだけを変更することはできません
1991 -- @code{\tweak} コマンドを用いる必要があります。@c
1992 同じ音楽タイミングで複数出現する可能性があるオブジェクトには、@c
1995 @c TODO expand to include any further uses of \tweak
1998 @item 1 つの音符に付けられるアーティキュレーション記号
1999 @item 和音の中にある音符の間に付けられるタイ
2003 @c TODO add examples of these
2005 @cindex chord, modifying one note in (和音の中にある音符の 1 つを変更する)
2007 以下の例では、和音の中にある符頭の 1 つの色を変更し、@c
2008 さらに他の符頭のタイプを変更しています:
2010 @lilypond[relative=2,verbatim,quote]
2015 \tweak #'duration-log #1
2020 @code{\tweak} を用いて、スラーを変更することができます:
2022 @lilypond[verbatim,quote,relative=1]
2023 c-\tweak #'thickness #5 ( d e f)
2027 @code{\tweak} コマンドが機能するためには、@c
2028 入力ファイルが音楽の流れに変換されたときに、@c
2029 @code{\tweak} コマンドのすぐ後に@c
2030 変更が適用されるオブジェクトが配置されている必要があります。
2031 LilyPond は、構文解釈処理時に、@c
2032 追加のオブジェクトを音楽の流れの中に挿入する場合があります。@c
2033 例えば、明示的には和音の一部になっていない音符を、@c
2034 LilyPond が音符の中に配置する場合があります。@c
2035 そのため、@code{\tweak} で変更される音符は、@c
2036 和音構造の中に配置されている必要があります:
2038 @lilypond[relative=2,verbatim,quote]
2039 \tweak #'color #red c4
2040 <\tweak #'color #red c>4
2043 @code{\tweak} コマンドは、@c
2044 入力ファイルの中で明示的に記述されていないオブジェクトを@c
2045 変更するために用いることはできません。@c
2046 特に、符幹、連桁、あるいは臨時記号を直接変更することはできません。@c
2047 なぜなら、それらは入力の中にある音楽要素の後ではなく、@c
2049 さらに、音部記号や拍子記号を変更することもできません。@c
2050 なぜなら、コンテキストを指定するために必要とされる追加要素の自動挿入により、@c
2051 それらは前に配置された @code{\tweak} コマンドとは分離されるからです。@c
2053 記譜要素の前に複数の @code{\tweak} コマンドを配置することができます
2056 @lilypond[verbatim,quote,relative=1]
2058 -\tweak #'style #'dashed-line
2059 -\tweak #'dash-fraction #0.2
2060 -\tweak #'thickness #3
2061 -\tweak #'color #red
2066 入力ファイルのあるセクションから生成される音楽の流れ
2067 -- 自動的に挿入される要素も含めて --
2069 @rextend{Displaying music expressions} を参照してください。@c
2070 これは、@code{\tweak} コマンドによって変更されるオブジェクトを決定するとき、@c
2072 @code{\tweak} の適用で入力を調整する方法を決定するときに役に立つかもしれません。
2080 @rextend{Displaying music expressions}
2085 @cindex tweaks in a variable (変数の中での調整)
2086 @code{\tweak} コマンドを変数の中で用いることはできません。
2088 @cindex tweaks in lyrics (歌詞の中での調整)
2089 @code{\tweak} コマンドを @code{\lyricmode} の中で用いることはできません。
2091 @cindex tweaking control points (制御ポイントを調整する)
2092 @cindex control points, tweaking (制御ポイントを調整する)
2094 @code{\tweak} コマンドは、和音の中で生成される複数のタイのうち、@c
2098 @node set 対 override
2099 @subsection @code{\set} 対 @code{\override}
2100 @translationof set versus override
2102 TODO -- This section is probably unnecessary now.
2105 We have seen two methods of changing properties: @code{\set} and
2106 @code{\override}. There are actually two different kinds of
2109 @code{fontSize} is a special property: it is equivalent to
2110 entering @code{\override ... #'font-size} for all pertinent
2111 objects. Since this is a common change, the special
2112 property (modified with @code{\set}) was created.
2118 @subsection 連想配列を変更する
2119 @translationof Modifying alists
2121 ユーザが変更可能なプロパティの中には、@c
2122 内部的には @emph{連想配列} として存在しているものがあります
2123 -- 連想配列は @emph{キー} と @emph{値} のペアの配列を保持します。@c
2127 '((@var{キー1} . @var{値1})
2128 (@var{キー2} . @var{値2})
2129 (@var{キー3} . @var{値3})
2133 ある連想配列がグラフィカル オブジェクト プロパティまたは
2134 @code{\paper} 変数である場合、@c
2135 その連想配列の個々のキーを、他のキーに影響を与えることなく、@c
2138 例えば、譜グループの中にある隣り合う譜間のスペースを減らすには、@c
2139 @code{StaffGrouper} グラフィカル オブジェクトの
2140 @code{staff-staff-spacing} プロパティを使用します。@c
2142 -- @code{basic-distance}, @code{minimum-distance},
2143 @code{padding}, それに @code{stretchability} --
2146 内部リファレンスの @qq{Backend} セクションでリストアップされています
2147 (@rinternals{StaffGrouper} を参照してください):
2150 '((basic-distance . 9)
2151 (minimum-distance . 7)
2153 (stretchability . 5))
2156 譜間のスペースを小さくする方法の 1 つは、@c
2157 @code{basic-distance} キーの値 (@code{9}) を
2158 @code{minimum-distance} キーの値 (@code{7}) 近くまで減らすことです。@c
2159 個々のキーを変更するには、@emph{ネストされた宣言} を使います:
2162 @lilypond[quote,verbatim]
2165 \new Staff { \clef treble c''1 }
2166 \new Staff { \clef bass c1 }
2170 \new PianoStaff \with {
2171 % this is the nested declaration
2172 \override StaffGrouper #'staff-staff-spacing #'basic-distance = #7
2174 \new Staff { \clef treble c''1 }
2175 \new Staff { \clef bass c1 }
2179 ネストされた宣言は、プロパティの他のキーに変更を加えることなく、@c
2180 指定されたキー (上の例では @code{basic-distance}) を更新します。
2182 今度は、譜を重ならない範囲でできる限り近づけたいとします。@c
2183 最も簡単な方法は、連想配列の 4 つのキーすべてを 0 にセットすることです。@c
2184 しかしながら、4 つのネストされた宣言を記述する必要はありません。@c
2185 1 つの宣言でプロパティを丸ごと再定義することができます:
2187 @lilypond[quote,verbatim]
2188 \new PianoStaff \with {
2189 \override StaffGrouper #'staff-staff-spacing =
2190 #'((basic-distance . 0)
2191 (minimum-distance . 0)
2193 (stretchability . 0))
2195 \new Staff { \clef treble c''1 }
2196 \new Staff { \clef bass c1 }
2200 連想配列の再定義でリストアップされなかったキーは、@c
2201 @emph{セットされなかった場合のデフォルト値} にリセットされます。@c
2202 @code{staff-staff-spacing} の場合、@c
2203 セットされなかったキーは 0 にリセットされます
2204 (@code{stretchability} は例外で、セットされなかった場合、@c
2205 @code{basic-distance} にリセットされます)。@c
2206 このため、以下の 2 つの宣言は等価です:
2209 \override StaffGrouper #'staff-staff-spacing =
2210 #'((basic-distance . 7))
2212 \override StaffGrouper #'staff-staff-spacing =
2213 #'((basic-distance . 7)
2214 (minimum-distance . 0)
2216 (stretchability . 7))
2219 連想配列の再定義でリストアップされなかったキーがあることにより、@c
2221 入力ファイルがコンパイルされるときに読み込まれた@c
2222 標準設定が (意図せずに) 削除される可能性があります。@c
2223 上の例では、@code{padding} と @code{minimum-distance} の標準設定
2224 (@file{scm/define-grobs.scm} で定義されます) は、@c
2225 @emph{セットされなかった場合のデフォルト値} (両方とも 0) にリセットされます。@c
2226 プロパティや (任意のサイズ) 連想配列を定義した場合、@c
2227 セットされなかったキー値はすべて @emph{セットされなかった場合のデフォルト値}
2229 そうすることを意図しているのでない限り、@c
2230 ネストされた宣言を用いてキー値を個々に更新する方が安全です。
2232 @warning{ネストされた宣言は、コンテキスト プロパティ連想配列
2233 (@code{beamExceptions}, @code{keySignature}, @code{timeSignatureSettings} 等)
2236 連想配列として丸ごと再定義するしかありません。}
2239 @node 役に立つコンセプトとプロパティ
2240 @section 役に立つコンセプトとプロパティ
2241 @translationof Useful concepts and properties
2258 @translationof Input modes
2260 入力ファイルの中に保持されている記譜を解釈する方法は、@c
2261 カレントの入力モードによって決定されます。
2265 このモードは @code{\chordmode} コマンドで有効になり、@c
2266 入力はコード記譜法の構文で解釈されるようになります。@c
2267 @ref{Chord notation} を参照してください。@c
2268 コードは、譜面上に音符として描画されます。
2270 コード モードは @code{\chords} コマンドでも有効になります。@c
2271 このコマンドは新たに @code{ChordNames} コンテキストも作成します。@c
2272 入力はコード記譜法の構文で解釈され、@c
2273 さらに @code{ChordNames} コンテキストの中にコード ネームとして描画されます。@c
2274 @ref{Printing chord names} を参照してください。
2278 このモードは @code{\drummode} コマンドで有効になり、@c
2279 入力はドラム記譜法の構文で解釈されるようになります。@c
2280 @ref{Basic percussion notation} を参照してください。
2282 また、ドラム モードは @code{\drums} コマンドでも有効になります。@c
2283 このモードも新たに @code{DrumStaff} コンテキストを作成し、@c
2284 コマンドの後に続く入力をドラム記譜法の構文で解釈して、@c
2285 ドラム譜上にドラム記号として描画します。@c
2286 @ref{Basic percussion notation} を参照してください。
2290 このモードは @code{\figuremode} コマンドで有効になり、@c
2291 入力は通奏低音の構文で解釈されるようになります。@c
2292 @ref{Entering figured bass} を参照してください。
2294 また、音型モードは @code{\figures} コマンドでも有効になります。@c
2295 このモードも新たに @code{FiguredBass} コンテキストを作成し、@c
2296 コマンドの後に続く入力を通奏低音の構文で解釈して、@c
2297 @code{FiguredBass} コンテキストの中に通奏低音記号として描画します。@c
2298 @ref{Introduction to figured bass} を参照してください。
2300 @strong{フレットとタブ モード}
2302 フレット記号とタブ記号を入力するための特別な入力モードはありません。
2304 タブ図を作成するには、音符モードで音符や和音を入力して、@c
2305 それらを @code{TabStaff} コンテキストの中に描画します。@c
2306 @ref{Default tablatures} を参照してください。
2308 譜の上にフレット図を作成するには、2 つの方法があります。@c
2309 @code{FretBoards} コンテキスト
2310 (@ref{Automatic fret diagrams} を参照してください) を用いるか、@c
2311 あるいは、音符の上に @code{\fret-diagram} コマンド
2312 (@ref{Fret diagram markups}) を用いてフレット図をマークアップとして@c
2317 このモードは @code{\lyricmode} コマンドで有効になり、@c
2318 入力はオプションで演奏時間を持つ歌詞音節として解釈され、@c
2320 通奏低音の構文で解釈されるようになります。@c
2321 @ref{Vocal music} を参照してください。
2323 また、歌詞モードは @code{\addlyrics} コマンドでも有効になります。@c
2324 このモードも新たに @code{Lyrics} コンテキストを作成し、@c
2325 暗黙的に @code{lyricsto} コマンドを作成します。@c
2326 @code{lyricsto} は、後に続く歌詞を、前にある音楽に関連付けします。
2330 このモードは @code{\markup} コマンドで有効になり、@c
2331 入力はマークアップの構文で解釈されるようになります。@c
2332 @ref{Text markup commands} を参照してください。
2334 @c silly work-around for texinfo broken-ness
2335 @c (@strong{Note...} causes a spurious cross-reference in Info)
2338 このモードはデフォルトのモードであり、@c
2339 @code{\notemode} コマンドで有効にすることもできます。@c
2340 入力はピッチ、演奏時間、マークアップなどとして解釈され、@c
2343 通常、音符モードを明示的に指定する必要はありません。@c
2345 -- 例えば、歌詞モード、和音モード、あるいは他のモードを使っていて、@c
2346 音符モードの構文でしか入力できないものを入力しようとしている場合 --
2347 では、音符モードを明示的に指定することが有用な場合があります。
2349 例えば、合唱曲で節ごとに強弱記号を指定するには、@c
2350 音符モードで入力して記号を解釈させる必要があります:
2352 @lilypond[verbatim,relative=2,quote]
2355 \notemode{\set stanza = \markup{ \dynamic f 1. } }
2359 \notemode{\set stanza = \markup{ \dynamic p 2. } }
2367 @translationof Direction and placement
2369 楽譜を写植しているとき、多くの要素の向きと配置には選択の余地があります。@c
2370 例えば、音符の符幹は上向きあるいは下向きにすることができ、@c
2371 歌詞、強弱記号、他の表現記号は譜の上あるいは下に配置することができ、@c
2372 テキストは左揃え、右揃え、あるいは中央揃えにすることができる、などです。@c
2373 これらの選択のほとんどは LilyPond によって自動的に決定されますが、@c
2374 強制的に向きや配置を指定することが望ましい場合もあります。
2376 @strong{アーティキュレーションの方向指示子}
2378 デフォルトでは、アーティキュレーションのいくつかの向きは常に上または下に@c
2379 なっています (例えば、強弱記号やフェルマータ)。@c
2380 一方、他のアーティキュレーションは、符幹の向きによって、@c
2381 向きが上下します (スラーやアクセントなど)。
2383 @c TODO Add table showing these
2385 アーティキュレーションの前に @emph{方向指示子} を置くことで、@c
2386 デフォルトの向きをオーバライドすることができます。@c
2387 3 つの方向指示子があります: @code{^} (@qq{上向き} を意味します)、@c
2388 @code{_} (@qq{下向き} を意味します)、@c
2389 それに @code{-} (@qq{デフォルトの向き} を意味します) です。@c
2390 通常、方向指示子は省略することができ、その場合は @code{-} と見なされます。@c
2391 しかしながら、以下のものの前には @strong{常に} 方向指示子を置く必要があります:
2394 @item @code{\tweak} コマンド
2395 @item @code{\markup} コマンド
2396 @item @code{\tag} コマンド
2397 @item 文字列マークアップ。例えば、-"string"
2398 @item 運指指示。例えば、@code{-1}
2399 @item アーティキュレーションの短縮記法。例えば、@code{-.}, @code{->}, @code{--}
2402 方向指示子は、その後にくる音符だけに効果を持ちます:
2404 @lilypond[verbatim,quote,relative=2]
2413 多くのレイアウト オブジェクトの位置や向きは、@c
2414 @code{direction} プロパティによって制御されます。
2416 @code{direction} プロパティの値は、@c
2417 @code{1} (@qq{上向き} あるいは @qq{上} を意味します)、@c
2418 @code{-1} (@qq{下向き} あるいは @qq{下} を意味します)
2420 記号 @code{UP} と @code{DOWN} は、@c
2421 それぞれ @code{1} と @code{-1} の代わりに用いることができます。@c
2423 @code{direction} を @code{0} あるいは @code{CENTER} にセットします。@c
2425 多くの場合で、向きを指定するための前置コマンドが存在しています。@c
2426 それらはすべて以下のような形式をとります:
2429 @code{\xxxUp}, @code{xxxDown}, @code{xxxNeutral}
2432 ここで、@code{xxxNeutral} は @qq{デフォルトの向きを使用する}
2434 @rlearning{譜内部オブジェクト} を参照してください。
2437 -- 一般的な例としてはアルペジオしかありません --
2438 @code{direction} プロパティの値は、@c
2439 オブジェクトが親オブジェクトの左右どちらに配置されるかを指定します。
2440 この場合、@code{-1} あるいは @code{LEFT} は @qq{左側} を意味し、@c
2441 @code{1} あるいは @code{RIGHT} は @qq{右側} を意味します。@c
2442 @code{0} あるいは @code{CENTER} は、前のケースと同様に、@c
2443 @qq{デフォルトの向きを使用する} ことを意味します。
2446 These all have side-axis set to #X
2447 AmbitusAccidental - direction has no effect
2449 StanzaNumber - not tried
2450 TrillPitchAccidental - not tried
2451 TrillPitchGroup - not tried
2454 これらの指示子は、キャンセルされるまで効果を持ちます。
2456 @lilypond[verbatim,quote,relative=2]
2466 @node コンテキスト レイアウトの順序
2467 @subsection コンテキスト レイアウトの順序
2468 @translationof Context layout order
2470 @cindex contexts, layout order (コンテキスト レイアウトの順序)
2472 通常、コンテキストは、入力ファイルの中で出現した順番に、@c
2473 システムの上から下へと配置されます。@c
2474 コンテキストがネストされている場合、@c
2475 入力ファイルの中で内側にネストされたコンテキストが@c
2476 外側のコンテキストの @q{accepts} リストの中に含まれているのなら、@c
2477 外側のコンテキストの内部に配置されます。@c
2478 外側のコンテキストの @qq{accepts} リストに含まれていない場合、@c
2479 外側のコンテキストの内部ではなく、下に再配置されます。
2482 出現したコマンドを保持する適当なコンテキストが存在しない場合、@c
2483 コンテキストが暗黙的に作成されます。@c
2484 これは、予期しない譜やスコアを生み出す可能性があります。
2486 コンテキストが配置される順序や @qq{accepts} リストは変更することができます。@c
2487 @ref{コンテキストを揃える} を参照してください。
2491 @rprogram{余計な譜が表示される}
2495 @subsection 距離と距離の単位
2496 @translationof Distances and measurements
2498 @cindex distances, absolute (絶対距離)
2499 @cindex distances, scaled (相対距離)
2506 LilyPond における距離には 2 つのタイプがあります: 絶対距離と相対距離です。
2508 絶対距離は、マージン、インデント、それにその他の詳細なページ レイアウトを@c
2509 指定するために使用され、デフォルトではミリメートルで指定されます。
2510 距離は以下の単位で指定することもできます: @code{\mm}, @code{\cm},
2511 @code{\inch} (インチ), それに @code{\pt} (ポイント。1/73.27 インチ) です。@c
2512 また、ページ レイアウトにおける距離は、@c
2513 値の後ろに @code{\staff-space} を付けることにより、
2514 比率で指定することもできます (次の段落を参照してください)。@c
2515 ページ レイアウトについての詳細は、@c
2516 @ref{ページ レイアウト} に記述されています。
2518 相対距離は常に譜スペースを単位として指定されます
2519 -- 稀に、半譜スペースが使用されます。@c
2520 譜スペースは隣り合う 2 本の譜線間の距離です。@c
2521 グローバル譜サイズを設定することにより、@c
2522 デフォルト値をグローバルに変更することができます。@c
2523 また、@code{StaffSymbol} の @code{staff-space} プロパティを@c
2524 変更することにより、譜スペースをローカルにオーバライドすることもできます。@c
2525 相対距離は、グローバル譜サイズや @code{StaffSymbol} の @code{staff-space}
2526 プロパティのいずれかが変更されると、自動的に変更されます。@c
2527 しかしながら、フォントの比率はグローバル譜サイズが変更された場合にのみ、@c
2530 容易に描画される楽譜全体のサイズを変更することができます。@c
2531 グローバル譜サイズを設定するための手段については、@c
2532 @ref{譜サイズを設定する} を参照してください。
2536 楽譜のある部分だけの比率を変更したいのなら
2537 -- 例えば、オッシア セクションや脚注で --
2538 単純にグローバル譜サイズを変更するわけにはいきません。@c
2539 なぜなら、グローバル譜サイズを変更すると、楽譜全体が影響を受けるからです。@c
2540 そのような場合、@code{StaffSymbol} の @code{staff-space} プロパティと@c
2541 フォントのサイズをオーバライドすることにより、サイズを変更します。@c
2542 フォント サイズの変更を @code{staff-space} 単位の変更に変換するには、@c
2543 Scheme 関数 @code{magstep} を使用することができます。@c
2545 @rlearning{オブジェクトの長さと太さ} を参照してください。
2550 @rlearning{オブジェクトの長さと太さ}
2558 @subsection 譜記号プロパティ
2559 @translationof Staff symbol properties
2561 @cindex adjusting staff symbol (譜記号を調節する)
2562 @cindex drawing staff symbol (譜記号を描画する)
2563 @cindex staff symbol, setting of (譜記号の設定)
2565 @c TODO Extend or remove this section. See also NR 1.6.2 Staff symbol
2566 @c Need to think of uses for these properties. Eg 'line-positions
2567 @c is used in a snippet to thicken centre line.
2568 @c If retained, add @ref to here in 1.6.2 -td
2570 譜線の垂直位置と譜線の本数を同時に定義することができます。@c
2571 以下の例が示すように、音符の位置は譜線の位置には影響されません。
2573 @warning{@code{'line-positions} プロパティは @code{'line-count} を@c
2575 譜線の本数は、@code{'line-positions} の値リストの中にある要素数によって、@c
2578 @lilypond[verbatim,quote,relative=1]
2580 \override StaffSymbol #'line-positions = #'(7 3 0 -4 -6 -7)
2587 譜内部のオブジェクトのスペースは、この設定によって影響を受けません。
2589 @lilypond[verbatim,quote,relative=1]
2591 \override StaffSymbol #'width = #23
2599 @translationof Spanners
2601 多くの音楽記譜オブジェクトは、複数の音符あるいは複数の小節にまたがって、@c
2603 例としては、スラー、連桁、連譜の囲み、volta 繰り返しの囲み、クレッシェンド、@c
2604 トリル、それにグリッサンドがあります。@c
2605 そのようなオブジェクトは総称して @qq{スパナ} と呼ばれ、@c
2606 それらの見た目と振る舞いを制御するための特殊なプロパティを持ちます。@c
2607 これらのプロパティのいくつかは、すべてのスパナに共通しています。@c
2608 他のプロパティはスパナの部分集合に限定されています。
2610 すべてのスパナは @code{spanner-interface} をサポートします。@c
2611 いくつかのスパナ -- 2 つのオブジェクトの間に直線を描くもの -- は、さらに、@c
2612 @code{line-spanner-interface} をサポートします。
2615 @unnumberedsubsubsec @code{spanner-interface} を使用する
2618 いくつかのスパナに適用される 2 つのプロパティを提供します。
2620 @strong{@i{@code{minimum-length} プロパティ}}
2622 スパナの最短の長さは、@code{minimum-length} プロパティによって指定されます。@c
2623 通常、このプロパティを増加させると、@c
2624 スパナの両端の間にある音符の間隔は増加します。@c
2625 しかしながら、このオーバライドは多くのスパナで効果を持ちません。@c
2626 なぜなら、それらの長さは他の要素によって決定されるからです。@c
2627 以下に効果を持つ例を 2, 3 示します。
2637 Works as long as callback is made:
2641 Works not at all for:
2651 @lilypond[verbatim,quote,relative=2]
2655 -\tweak #'minimum-length #5
2660 @lilypond[verbatim,quote,relative=2]
2662 \compressFullBarRests
2665 \once \override MultiMeasureRest #'minimum-length = #20
2671 @lilypond[verbatim,quote,relative=2]
2674 \override Hairpin #'minimum-length = #20
2678 さらに、このオーバライドはスラーとフレージング スラーの長さを@c
2681 @lilypond[verbatim,quote,relative=2]
2684 -\tweak #'minimum-length #5
2689 -\tweak #'minimum-length #5
2693 いくつかのレイアウト オブジェクトでは、@c
2694 @code{minimum-length} プロパティは、@c
2695 @code{set-spacing-rods} プロシージャが明示的に呼び出された場合にのみ@c
2697 このプロシージャを呼び出すには、@code{springs-and-rods} プロパティに@c
2698 @code{ly:spanner::set-spacing-rods} をセットしておく必要があります。@c
2700 @code{springs-and-rods} プロパティが設定されていない限り、@c
2704 @lilypond[verbatim,quote,relative=1]
2709 \once \override Glissando #'minimum-length = #20
2712 % 以下の両方のオーバライドが存在する場合にのみ、効果を持ちます
2713 \once \override Glissando #'minimum-length = #20
2714 \once \override Glissando #'springs-and-rods = #ly:spanner::set-spacing-rods
2718 @code{Beam} オブジェクトでも同じことが言えます:
2721 @lilypond[verbatim,quote,relative=1]
2723 \once \override Beam #'minimum-length = #20
2726 % 以下の両方のオーバライドが存在する場合にのみ、効果を持ちます
2727 \once \override Beam #'minimum-length = #20
2728 \once \override Beam #'springs-and-rods = #ly:spanner::set-spacing-rods
2733 @strong{@i{@code{to-barline} プロパティ}}
2735 @code{spanner-interface} の 2 番目に有用なプロパティは
2736 @code{to-barline} です。@c
2737 デフォルトではこのプロパティは真であり、@c
2738 小節の最初の音符のところで終了するヘアピンや他のスパナは@c
2739 直前の小節線のところで終了させられます。@c
2740 偽に設定すると、スパナは小節線を越えて、音符のところで終了します:
2742 @lilypond[verbatim,quote,relative=2]
2743 a \< a a a a \! a a a \break
2744 \override Hairpin #'to-barline = ##f
2745 a \< a a a a \! a a a
2748 このプロパティはすべてのスパナに対して効果を持つわけではありません。@c
2749 例えば、スラーやフレージング スラー、@c
2750 あるいは小節線で終了させることに意味が無い他のスパナに対して、@c
2751 このプロパティを @code{#t} に設定しても効果がありません。
2754 @unnumberedsubsubsec @code{line-spanner-interface} を使用する
2756 @code{line-spanner-interface} をサポートするオブジェクトには@c
2760 @item @code{DynamicTextSpanner}
2761 @item @code{Glissando}
2762 @item @code{TextSpanner}
2763 @item @code{TrillSpanner}
2764 @item @code{VoiceFollower}
2767 これらのスパナのステンシルを描画する責任を持つルーチンは
2768 @code{ly:line-interface::print} です。@c
2769 このルーチンはスパナの両端の位置を綿密に決定し、@c
2770 求めに応じたスタイルでそれらの間に線を描きます@c
2771 スパナの両端の位置はオンザフライ (その場、その時々) で算出されますが、@c
2772 それらの Y 座標をオーバライドすることができます。@c
2774 プロパティ階層内で 2 階層下にネストされていますが、@c
2775 この @code{\override} コマンドは非常にシンプルです:
2777 @lilypond[relative=2,quote,verbatim]
2779 \once \override Glissando #'(bound-details left Y) = #3
2780 \once \override Glissando #'(bound-details right Y) = #-2
2784 @code{Y} プロパティの単位は @code{staff-space} であり、@c
2786 グリッサンドでは、スパナの両端は各符頭の中心であり、@c
2787 @code{Y} はそれらの点を上下させます。
2789 @code{Y} が設定されていない場合、@c
2790 値はスパナの両端の垂直位置から算出されます。
2792 改行の場合、終点の @code{Y} の値は @code{bound-details} の@c
2793 部分リスト @code{left-broken} や @code{right-broken} のによって指定されます。@c
2796 @lilypond[relative=2,ragged-right,verbatim,fragment]
2797 \override Glissando #'breakable = ##t
2798 \override Glissando #'(bound-details right-broken Y) = #-3
2799 c1 \glissando \break
2804 @code{bound-details} プロパティの部分リスト @code{left} や @code{right} の@c
2805 下位プロパティのいくつかは、@code{Y} と同じ方法で変更することができます:
2810 譜の中央線からの @code{staff-space} オフセットで、設定します。@c
2811 デフォルトでは、終点オブジェクトの中心です。@c
2812 ですから、グリッサンドは符頭の中心に向かって進みます。
2814 水平方向に広がるスパナ -- テキスト スパナやトリル スパナなど --
2815 では、この値は 0 に固定されています。
2818 スパナのラインがオブジェクトの左右どちらから始まり、終わるのかを決定します。@c
2819 @code{-1} (あるいは @code{LEFT}) であれば、@c
2820 ラインは符頭の左側から開始あるいは終了します。
2824 通常、オンザフライ (その場、その時々) で算出され、@c
2825 これをオーバライドしてもあまり意味がありません。
2828 ライン スパナは開始点や終了点で記号を持つ場合があり、@c
2829 その記号はこのサブ プロパティに保持されています。@c
2830 このサブ プロパティは内部で使用するためのものです。@c
2831 このサブ プロパティの代わりに @code{text} を使用することを推奨します。
2834 ステンシルを作成するために評価されるマークアップです。@c
2835 水平スパナに @i{cresc.}, @i{tr} それに他のテキストを配置するために使用されます。
2837 @lilypond[quote,ragged-right,fragment,relative=2,verbatim]
2838 \override TextSpanner #'(bound-details left text)
2839 = \markup { \small \bold Slower }
2840 c2\startTextSpan b c a\stopTextSpan
2843 @item stencil-align-dir-y
2844 @item stencil-offset
2846 ステンシルは、@code{X} と @code{Y} サブ プロパティで定義されたとおりに、@c
2847 ラインに中央揃えで、終点に配置されます。@c
2848 @code{stencil-align-dir-y} あるいは @code{stencil-offset} の@c
2852 @lilypond[relative=1,fragment,verbatim]
2853 \override TextSpanner
2854 #'(bound-details left stencil-align-dir-y) = #-2
2855 \override TextSpanner
2856 #'(bound-details right stencil-align-dir-y) = #UP
2858 \override TextSpanner
2859 #'(bound-details left text) = #"ggg"
2860 \override TextSpanner
2861 #'(bound-details right text) = #"hhh"
2862 c4^\startTextSpan c c c \stopTextSpan
2866 負の値はテキストを @emph{上げる} ということに注意してください。@c
2867 なぜなら、@code{-1} あるいは @code{DOWN} は@c
2868 テキストの @emph{下端} をスパナ ラインに揃え、
2869 @code{1} あるいは @code{UP} は@c
2870 テキストの @emph{上端} をスパナ ラインに揃えるからです。
2873 このサブ プロパティに @code{#t} をセットするとラインの終点に矢印が描かれます。
2876 このサブ プロパティはラインの終点と実際の終点の間のスペースを制御します。@c
2877 パディングがなければ、グリッサンドは両端の符頭の中心から描かれます。
2881 音楽関数 @code{\endSpanners} は@c
2882 直後の音符から始まるスパナをすぐに終了させます。@c
2883 ちょうど 1 音符分でスパナを終了させますが、@c
2884 @code{to-barline} が真で、かつ、次の音符の前に小節線がある場合は@c
2885 その小節線のところでスパナを終了させます。
2887 @lilypond[verbatim,quote,ragged-right,relative=2,fragment]
2889 c2 \startTextSpan c2 c2
2894 @code{\endSpanners} を使用している場合、@c
2895 @code{\startTextSpan} を @code{\endTextSpan} で閉じる必要はなく、@c
2896 ヘアピンを @code{\!} で閉じる必要もありません。
2901 @rinternals{TextSpanner},
2902 @rinternals{Glissando},
2903 @rinternals{VoiceFollower},
2904 @rinternals{TrillSpanner},
2905 @rinternals{line-spanner-interface}
2909 @subsection オブジェクトの可視性
2910 @translationof Visibility of objects
2912 @cindex objects, visibility of (オブジェクトの可視性)
2913 @cindex grobs, visibility of (グラフィカル オブジェクトの可視性)
2914 @cindex visibility of objects (オブジェクトの可視性)
2916 レイアウト オブジェクトの可視性を制御する主な方法は 4 つあります:
2917 オブジェクトのステンシルを削除する方法、オブジェクトを透明にする方法、@c
2918 オブジェクトの色を白にする方法、あるいは、@c
2919 オブジェクトの @code{break-visibility} プロパティをオーバライドする方法です。
2920 最初の 3 つの方法はすべてのレイアウト オブジェクトに適用されますが、@c
2921 最後の方法はいくつかの -- @emph{改行可能な} オブジェクト --
2923 学習マニュアルでは、これら 4 つのテクニックについて紹介しています。@c
2924 @rlearning{オブジェクトの可視性と色} を参照してください。
2926 さらに、特定のレイアウト オブジェクト特有のテクニックがいくつかあります。@c
2927 それらについては、特別な考慮でカバーされています。
2933 * break-visibility を用いる::
2939 @unnumberedsubsubsec ステンシルを削除する
2940 @translationof Removing the stencil
2942 @cindex stencil, removing (ステンシルを削除する)
2944 レウアウト オブジェクトはそれぞれステンシル プロパティを持ちます。@c
2946 このプロパティはそのオブジェクトを描画する特殊な関数にセットされています。@c
2947 このプロパティが @code{#f} にオーバライドされた場合、@c
2948 関数は呼び出されず、そのオブジェクトは描画されません。@c
2949 @code{\rever} でデフォルトの動作に戻すことができます。
2951 @lilypond[quote,verbatim,relative=1]
2953 \override Score.BarLine #'stencil = ##f
2955 \revert Score.BarLine #'stencil
2960 @unnumberedsubsubsec オブジェクトを透明にする
2961 @translationof Making objects transparent
2963 @cindex transparent, making objects (オブジェクトを透明にする)
2965 レイアウト オブジェクトはそれぞれ @code{transparent} プロパティを持っていて、@c
2966 デフォルトでは @code{#f} にセットされています。@c
2967 @code{#t} にセットされると、そのオブジェクトはスペースを占めたままですが、@c
2970 @lilypond[quote,verbatim,relative=2]
2972 \once \override NoteHead #'transparent = ##t
2977 @unnumberedsubsubsec オブジェクトを白で描く
2978 @translationof Painting objects white
2980 @cindex objects, coloring (オブジェクトに色を付ける)
2981 @cindex coloring objects (オブジェクトに色を付ける)
2982 @cindex layers (レイヤ)
2983 @cindex printing order (描画の順番)
2984 @cindex overwriting objects (オブジェクトを上書きする)
2985 @cindex objects, overwriting (オブジェクトを上書きする)
2986 @cindex grobs, overwriting (グラフィカル オブジェクトを上書きする)
2988 レイアウト オブジェクトはそれぞれ @code{color} プロパティを持っていて、@c
2989 デフォルトでは @code{black} にセットされています。@c
2990 このプロパティが @code{white} にセットされてると、@c
2991 そのオブジェクトは白い背景と区別が付かなくなります。@c
2992 しかしながら、そのオブジェクトが他のオブジェクトと交差している場合、@c
2993 交差している場所の色はオブジェクトの描画順序によって決定されます。@c
2995 白いオブジェクトの画像が幽霊のように浮かび上がることがあります:
2997 @lilypond[quote,verbatim,relative=2]
2998 \override Staff.Clef #'color = #white
3002 オブジェクトの描画順序を変更することにより、これを回避することができます。@c
3003 すべてのレイアウト オブジェクトは @code{layer} プロパティを持っており、@c
3004 このプロパティには整数がセットされています。@c
3005 より小さな値の @code{layer} を持つオブジェクトが最初に描画され、@c
3006 より大きな値の @code{layer} を持つオブジェクトが後になってから描画されます。@c
3008 より大きな値を持つオブジェクトがより小さな値を持つオブジェクトを上書きします。@c
3010 たいていのオブジェクトの @code{layer} には @code{1} が代入されています。@c
3012 -- @code{StaffSymbol} や @code{BarLine} など --
3013 には @code{0} が代入されています。@c
3014 同じ値の @code{layer} を持つオブジェクトを描画する順番は不確定です。
3017 (この @code{layer} のデフォルト値は @code{1} です)
3019 (この @code{layer} のデフォルト値は @code{0} です)
3021 そのため、音部記号は譜線を上書きしています。@c
3022 これを変更するには、@code{Clef} オブジェクトの @code{layer} に@c
3023 より小さな値 -- 例えば、@code{-1} -- を与えて、@c
3024 音部記号を先に描画させる必要があります:
3026 @lilypond[quote,verbatim,relative=2]
3027 \override Staff.Clef #'color = #white
3028 \override Staff.Clef #'layer = #-1
3032 @node break-visibility を用いる
3033 @unnumberedsubsubsec break-visibility を用いる
3034 @translationof Using break-visibility
3036 @c TODO Add making other objects breakable
3038 @cindex break-visibility
3040 たいていのレイアウト オブジェクトは 1 回だけ描画されます。@c
3041 しかしながら、小節線、音部記号、拍子記号、それに調号などのオブジェクトは、@c
3042 改行が起こると 2 回描画する必要があります
3043 -- 行の最後で 1 回、次の行の最初でもう 1 回。@c
3044 そのようなオブジェクトは @emph{改行可能} と呼ばれ、@c
3045 それらのオブジェクトが描画される可能性がある 3 つの場所
3046 -- 行の先頭、行の途中 (それらが変更された場合)、@c
3047 それに、行の最後 (そこで変更が行われた場合) --
3048 における可視性を制御する @code{break-visibility} プロパティを持ちます。
3050 例えば、デフォルトでは拍子記号は最初の行の先頭で描画されますが、@c
3051 変更されない限り他の場所には描画されません。@c
3052 変更された場合、拍子記号は変更が行われた場所に描画されます。@c
3053 この変更が行の最後で行われた場合、新しい拍子記号は次の行の先頭に描画され、@c
3054 その前の行の最後にも忠告の拍子記号が描画されます。
3056 この振る舞いは @code{break-visibility} プロパティによって制御されます。@c
3058 @c Leave this ref on a newline - formats incorrectly otherwise -td
3059 @rlearning{オブジェクトの可視性と色}
3061 このプロパティは 3 つのブール値からなるベクトルをとり、@c
3062 順に、そのオブジェクトが行の最後で描画されるかどうか、@c
3064 そして、行の先頭で描画されるかどうかを決定します。@c
3065 より正確には、改行の前、改行がない場合、改行の後です。
3067 @code{break-visibility} プロパティによって制御する代わりに、@c
3068 これら 8 通りの組み合わせを @file{scm/output-lib.scm} で定義されている@c
3069 定義済み関数によって指定することもできます。@c
3070 このファイルの中で、最後の 3 列がその列のヘッダで示される場所での@c
3073 @multitable {@code{begin-of-line-invisible}} {@code{'#(#t #t #t)}} {yes} {yes} {yes}
3074 @headitem 関数 @tab ベクトル @tab 改行前 @tab 改行なし @tab 改行後
3076 @item @code{all-visible} @tab @code{'#(#t #t #t)} @tab yes @tab yes @tab yes
3077 @item @code{begin-of-line-visible} @tab @code{'#(#f #f #t)} @tab no @tab no @tab yes
3078 @item @code{center-visible} @tab @code{'#(#f #t #f)} @tab no @tab yes @tab no
3079 @item @code{end-of-line-visible} @tab @code{'#(#t #f #f)} @tab yes @tab no @tab no
3080 @item @code{begin-of-line-invisible} @tab @code{'#(#t #t #f)} @tab yes @tab yes @tab no
3081 @item @code{center-invisible} @tab @code{'#(#t #f #t)} @tab yes @tab no @tab yes
3082 @item @code{end-of-line-invisible} @tab @code{'#(#f #t #t)} @tab no @tab yes @tab yes
3083 @item @code{all-invisible} @tab @code{'#(#f #f #f)} @tab no @tab no @tab no
3086 @code{break-visibility} のデフォルト設定は@c
3087 レイアウト オブジェクトによって異なります。@c
3088 以下の表は、@code{break-visibility} によって影響をうける@c
3089 すべてのレイアウト オブジェクトと、そのプロパティのデフォルト設定を示しています:
3091 @multitable @columnfractions .3 .3 .4
3093 @headitem レイアウト オブジェクト @tab 通常のコンテキスト @tab デフォルト設定
3095 @c omit Ambitus as it appears not to be affected by break-visibility -td
3096 @c @item @code{Ambitus} @tab as specified @tab @code{begin-of-line-visible}
3097 @item @code{BarLine} @tab @code{Score} @tab calculated
3098 @item @code{BarNumber} @tab @code{Score} @tab @code{begin-of-line-visible}
3099 @c omit the following item until it can be explained -td
3100 @c @item @code{BreakAlignGroup} @tab @code{Score} @tab calculated
3101 @item @code{BreathingSign} @tab @code{Voice} @tab @code{begin-of-line-invisible}
3102 @item @code{Clef} @tab @code{Staff} @tab @code{begin-of-line-visible}
3103 @item @code{Custos} @tab @code{Staff} @tab @code{end-of-line-visible}
3104 @item @code{DoublePercentRepeat} @tab @code{Voice} @tab @code{begin-of-line-invisible}
3105 @c omit KeyCancellation until it can be explained -td
3106 @c @item @code{KeyCancellation} @tab ?? @tab @code{begin-of-line-invisible}
3107 @item @code{KeySignature} @tab @code{Staff} @tab @code{begin-of-line-visible}
3108 @c omit LeftEdge until it can be explained -td
3109 @c @item @code{LeftEdge} @tab @code{Score} @tab @code{center-invisible}
3110 @item @code{OctavateEight} @tab @code{Staff} @tab @code{begin-of-line-visible}
3111 @item @code{RehearsalMark} @tab @code{Score} @tab @code{end-of-line-invisible}
3112 @item @code{TimeSignature} @tab @code{Staff} @tab @code{all-visible}
3116 以下の例は、小節線の可視性を制御するベクトルの使用方法を示しています:
3119 @lilypond[quote,verbatim,relative=1,ragged-right]
3122 % カレント行の最後で小節線を削除します
3123 \once \override Score.BarLine #'break-visibility = #'#(#f #t #t)
3129 @code{break-visibility} をオーバライドするために使用される@c
3130 ベクトルの要素 3 つをすべて記述する必要がありますが、@c
3131 それらすべてが各レイアウト オブジェクトに対して効果を持つわけではなく、@c
3132 組み合わせによってはエラーになる場合もあります。@c
3134 even give errors. The following limitations apply:
3137 @item 小節線を行の先頭に描画することはできません。
3138 @item 小節番号は 1 から始まるのでなければ、@c
3139 最初の行の先頭に描画することはできません。
3140 @item 音部記号 -- 以下を参照してください
3141 @item 2 重線のパーセント繰り返しはすべて描画するか、@c
3143 描画するには @code{begin-of-line-invisible} を用い、@c
3144 描画しないのなら @code{all-invisible} を用います。
3145 @item Key signature -- 以下を参照してください
3146 @item OctavateEight -- 以下を参照してください
3150 @unnumberedsubsubsec 特別な考慮を必要とするもの
3151 @translationof Special considerations
3153 @strong{@emph{明示的な変更の後の可視性}}
3155 @cindex key signature, visibility following explicit change (明示的な変更の後の調号の可視性)
3156 @cindex explicitKeySignatureVisibility
3157 @cindex clef, visibility following explicit change (明示的な変更の後の音部記号の可視性)
3158 @cindex explicitClefVisibility
3160 @code{break-visibility} プロパティが調号の可視性と音部記号の変更を@c
3161 制御するのは、行の先頭 -- つまり、改行の後 -- においてだけです。@c
3162 行の途中や終わりでの明示的な調の変更や音部記号の変更の後に出現する@c
3163 調合や音部記号の可視性には効果を持ちません。@c
3164 以下の例では、@code{all-invisible} がセットされていますが、@c
3165 B フラット メジャーへの明示的な変更の後に出現する調号は可視のままです。
3168 @lilypond[quote,verbatim,relative=1,ragged-right]
3172 \override Staff.KeySignature #'break-visibility = #all-invisible
3180 そのような明示的な調号や音部記号の変更の可視性は
3181 @code{explicitKeySignatureVisibility} プロパティや
3182 @code{explicitClefVisibility} プロパティによって制御されます。@c
3183 これらは @code{break-visibility} プロパティと等価であり、@c
3184 どちらも @code{break-visibility} と同様に 3 つのブール値からなるベクトルか@c
3185 上でリストアップした定義済み関数をとります。@c
3186 どちらも @code{Staff} コンテキストのプロパティであり、@c
3187 レイアウト オブジェクト自体のプロパティではありません。@c
3188 ですから、これらは @code{\set} コマンドでセットします。@c
3189 どちらもデフォルトでは @code{all-visible} がセットされています。@c
3190 これらのプロパティは明示的な変更の結果として生じる@c
3191 調号と音部記号の可視性だけを制御し、@c
3192 行の先頭での調号や音部記号には効果を持ちませんので、@c
3193 オブジェクトを削除するには適切な @code{break-visibility}
3196 @lilypond[quote,verbatim,relative=1,ragged-right]
3199 \set Staff.explicitKeySignatureVisibility = #all-invisible
3200 \override Staff.KeySignature #'break-visibility = #all-invisible
3207 @strong{@emph{忠告の臨時記号の可視性}}
3209 明示的な調の変更で描画される忠告の臨時記号を削除するには、@c
3210 @code{Staff} コンテキスト プロパティ @code{printKeyCancellation} に
3213 @lilypond[quote,verbatim,relative=1,ragged-right]
3216 \set Staff.explicitKeySignatureVisibility = #all-invisible
3217 \set Staff.printKeyCancellation = ##f
3218 \override Staff.KeySignature #'break-visibility = #all-invisible
3225 このオーバライドによって、調の変更を示す臨時記号だけが残ります。
3227 @c TODO Add visibility of cautionary accidentals before notes
3229 @strong{@emph{自動小節線}}
3231 @cindex automaticBars
3232 @cindex bar lines, suppressing (小節線を消す)
3235 @code{Score} コンテキストの @code{automaticBars} プロパティを@c
3236 設定することにより、小節線の描画を Off にすることもできます。@c
3237 @code{#f} をセットされた場合、小節線は自動的には描画されなくなり、@c
3238 @code{\bar} コマンドで明示的に作成しなければならなくなります。@c
3239 定義済みコマンド @code{\cadenzaOn} とは異なり、小節数はカウントされ続けます。@c
3240 後になってこのプロパティに @code{#t} がセットされると、@c
3241 このカウントに従って小節線の生成が再開されます。@c
3242 @code{#f} がセットされている場合、@c
3243 改行が起こりえるのは明示的な @code{\bar} コマンドがある場所でだけになります。
3247 @strong{@emph{オクターブ移調付きの音部記号}}
3249 @cindex octavated clefs, visibility of (オクターブ移調付きの音部記号の可視性)
3250 @cindex visibility of octavated clefs (オクターブ移調付きの音部記号の可視性)
3251 @cindex clefs, visibility of octavation (オクターブ移調付きの音部記号の可視性)
3253 オクターブ移調付きの音部記号上の小さなオクターブ記号は
3254 @code{OctavateEight} レイアウト オブジェクトによって作り出されます。@c
3256 @code{Clef} オブジェクトの可視性とは独立して制御されます。@c
3257 そのため、各行の先頭においてそのような音部記号を完全に消そうとするなら、@c
3258 @code{Clef} オブジェクトと @code{OctavateEight} オブジェクトの両方に対して@c
3259 必要な @code{break-visibility} のオーバライドを行う必要があります。
3262 @code{explicitClefVisibility} プロパティが@c
3263 音部記号とそれに関連するオクターブ記号の両方を制御します。
3268 @rlearning{オブジェクトの可視性と色}
3272 @subsection ライン スタイル
3273 @translationof Line styles
3276 -- 例えば、@i{rallentando}, @i{accelerando} それに @i{trills} など --
3278 線で (点線や波線の場合もあります) でいくつもの小節にわたって広がります。
3280 これらはすべてグリッサンドと同じルーチンを用いてテキストと線を描きます。@c
3281 そのため、それらの振る舞いの調整も同じように行います。@c
3282 これらはスパナによって実現され、スパナを描くルーチンは
3283 @code{ly:line-interface::print} です。@c
3284 このルーチンは 2 つの @i{スパン ポイント} の位置を決定し、@c
3285 要求されたスタイルに応じてそれら 2 点の間に線を描きます。
3287 利用可能なライン スタイルと、それらをどのように調整するかを示す例を挙げます。
3289 @lilypond[relative=2,ragged-right,verbatim,fragment]
3291 \once \override Glissando #'style = #'dashed-line
3293 \override Glissando #'style = #'dotted-line
3295 \override Glissando #'style = #'zigzag
3297 \override Glissando #'style = #'trill
3301 スパナの終点の位置は各グラフィック オブジェクトごとに@c
3302 オンザフライ (その場、その時々) で計算されますが、@c
3303 それらをオーバライドすることもできます:
3306 @lilypond[relative=2,ragged-right,verbatim,quote]
3308 \once \override Glissando #'(bound-details right Y) = #-2
3312 グリッサンドの終点の @code{Y} には @code{-2} がセットされています。@c
3313 @code{right} の代わりに @code{left} を指定することにより、@c
3314 始点も同じように調整することができます。
3316 @code{Y} がセットされていない場合、@c
3317 その値はスパナが取り付けられるポイントの垂直位置から算出されます。
3319 スパナに他の調整を行うことも可能です。@c
3320 詳細は @ref{スパナ} を参照してください。
3324 @subsection オブジェクトを回転させる
3325 @translationof Rotating objects
3327 レイアウト オブジェクトとマークアップ テキストの要素はどちらも@c
3328 任意のポイントを中心にして任意の角度で回転させることができます。@c
3329 しかしながら、回転させる方法はまったく異なります。
3332 * レイアウト オブジェクトを回転させる::
3336 @node レイアウト オブジェクトを回転させる
3337 @unnumberedsubsubsec レイアウト オブジェクトを回転させる
3338 @translationof Rotating layout objects
3340 @cindex rotating objects (オブジェクトを回転させる)
3341 @cindex objects, rotating (オブジェクトを回転させる)
3343 @code{grob-interface} をサポートするすべてのレイアウト オブジェクトは、@c
3344 それらのオブジェクトの @code{rotation} プロパティを設定することにより、@c
3346 これは 3 要素のリストをとります: 反時計回りの回転の角度、@c
3347 オブジェクトの参照ポイントからの相対座標 x と y
3348 (この座標が回転の中心になります) です。@c
3349 回転の角度は @q{°}で指定し、座標は譜スペースで指定します。
3351 回転の角度と回転の中心座標は、トライ&エラーで決定する必要があります。
3353 @cindex hairpins, angled (回転させられたヘアピン)
3354 @cindex angled hairpins (回転させられたヘアピン)
3356 レイアウト オブジェクトを回転させることが有用な状況はあまりありません。@c
3357 以下の例は、有用であるかもしれないシチュエーションの 1 つを示しています:
3359 @lilypond[quote,verbatim,relative=1]
3361 \override Hairpin #'rotation = #'(20 -1 0)
3366 @unnumberedsubsubsec マークアップを回転させる
3367 @translationof Rotating markup
3369 すべてのマークアップ テキストは、@code{\rotate} コマンドを前に置くことにより、@c
3370 任意の角度に回転させることができます。@c
3371 このコマンドは 2 つの引数をとります: 反時計回りの回転の角度 @q{°} と、@c
3374 テキストの領域は回転させられるテキストの四隅になります。@c
3375 以下の例では、自動衝突回避を不可にするために@c
3376 テキストの @code{outside-staff-priority} プロパティに @code{#f} を@c
3378 そうしなければテキストのいくつかは高く押し上げられてしまいます。
3380 @lilypond[quote,verbatim,relative=1]
3381 \override TextScript #'outside-staff-priority = ##f
3382 g4^\markup { \rotate #30 "a G" }
3383 b^\markup { \rotate #30 "a B" }
3384 des^\markup { \rotate #30 "a D-Flat" }
3385 fis^\markup { \rotate #30 "an F-Sharp" }
3391 @translationof Advanced tweaks
3394 楽譜の見た目を細かく調節するためのさまざまなアプローチについて議論します。
3398 * グラフィカル オブジェクトを垂直方向にグループ化する::
3406 @rlearning{出力を調整する},
3414 @file{scm/define-grobs.scm}
3417 @rlsr{Tweaks and overrides}
3420 @rextend{Interfaces for programmers}
3423 @rinternals{All layout objects}
3427 @subsection オブジェクトを揃える
3428 @translationof Aligning objects
3430 @code{self-alignment-interface} と/あるいは @code{side-position-interface} を@c
3431 サポートするグラフィカル オブジェクトは、@c
3432 さまざまな形式で配置済みのオブジェクトに揃えることができます。@c
3433 そのようなオブジェクトのリストは、@rinternals{self-alignment-interface} と
3434 @rinternals{side-position-interface} を参照してください。@c
3436 すべてのグラフィカル オブジェクトは参照ポイント、水平方向の広がり、@c
3439 参照ポイントから左端と右端までの距離を意味する数値のペアであり、@c
3442 参照ポイントから下端と上端までの距離を意味する数値のペアであり、@c
3445 あるオブジェクトの譜面上の位置は、@code{X-offset} プロパティと
3446 @code{Y-offset} プロパティの値によって与えられます。@c
3447 @code{X-offset} の値は、親オブジェクトの参照ポイントの X 座標からの@c
3449 @code{Y-offset} の値は、譜の中央線からの距離を意味します。@c
3450 @code{X-offset} と @code{Y-offset} の値は直接設定されることもありますし、@c
3451 いくつかの形式で親オブジェクトと揃えるために@c
3452 プロシージャによって算出されることもあります。
3454 @c positioning considerations: 配置のための考慮 -> 配置規則
3455 @warning{多くのオブジェクトは特殊な配置規則を持っています。@c
3456 そのため、そのオブジェクトが @code{self-alignment-interface} を@c
3458 @code{X-offset} あるいは @code{Y-offset} の設定は無視されたり、@c
3461 例えば、臨時記号は @code{Y-offset} を設定することにより@c
3462 垂直方向の位置を変更することができますが、@code{X-offset} は効果を持ちません。
3464 リハーサル記号は、小節線、音部記号、拍子記号それに調号などの@c
3465 改行可能なオブジェクトに揃えることができます。@c
3466 リハーサル記号をそのようなオブジェクトに合わせて配置するために、@c
3467 @code{break-aligned-interface} の中に特別なプロパティがあります。
3470 @ref{break-alignable-interface を使用する},
3471 @rextend{Callback functions}
3474 * X-offset と Y-offset を直接設定する::
3475 * side-position-interface を使用する::
3476 * self-alignment-interface を使用する::
3477 * break-alignable-interface を使用する::
3480 @node X-offset と Y-offset を直接設定する
3481 @unnumberedsubsubsec @code{X-offset} と @code{Y-offset} を直接設定する
3482 @translationof Setting X-offset and Y-offset directly
3484 多くのオブジェクトの @code{X-offset} プロパティと @code{Y-offset} プロパティに@c
3486 以下の例は、3 つの音符を示していて、1 つはデフォルト配置の運指記号を持ち、@c
3487 他の 2 つの運指記号は @code{X-offset} と @code{Y-offset} が変更されています。
3489 @lilypond[verbatim,quote,relative=2]
3492 -\tweak #'X-offset #0
3493 -\tweak #'Y-offset #0
3496 -\tweak #'X-offset #-1
3497 -\tweak #'Y-offset #1
3503 @node side-position-interface を使用する
3504 @unnumberedsubsubsec @code{side-position-interface} を使用する
3505 @translationof Using the @code{side-position-interface}
3507 @code{side-position-interface} をサポートするオブジェクトは、@c
3508 その親オブジェクトの隣に配置することができ、@c
3510 それら 2 つのオブジェクトの指定された端をくっつけることができます。@c
3511 オブジェクトを親オブジェクトの上、下、右、あるいは左に配置することができます。@c
3512 親オブジェクトを指定することはできません:
3513 親オブジェクトは入力ストリームの中での要素の順序によって決定されます。@c
3514 たいていのオブジェクトの親オブジェクトは、@c
3515 そのオブジェクトに関連する符頭となります。
3517 @code{side-axis} プロパティと @code{direction} プロパティの値は、@c
3518 以下のように、オブジェクトが配置される場所を決定します:
3520 @c TODO add an example of each to the table
3522 @multitable @columnfractions .3 .3 .3
3523 @headitem @code{side-axis} @tab @code{direction} @tab
3524 @headitem property @tab property @tab Placement
3526 @item @code{0} @tab @code{-1} @tab 左
3527 @item @code{0} @tab @code{1} @tab 右
3528 @item @code{1} @tab @code{-1} @tab 下
3529 @item @code{1} @tab @code{1} @tab 上
3533 @code{side-axis} が @code{0} である場合、@code{X-offset} には@c
3534 プロシージャ @code{ly:side-position-interface::x-aligned-side} を@c
3536 このプロシージャは、@code{direction} の値に基づいて@c
3537 親オブジェクトの左あるいは右にオブジェクトを配置するための適切な値を
3538 @code{X-offset} に返します。
3540 @code{side-axis} が @code{1} である場合、@code{Y-offset} には@c
3541 プロシージャ @code{ly:side-position-interface::y-aligned-side} を@c
3543 このプロシージャは、@code{direction} の値に基づいて@c
3544 親オブジェクトの上あるいは下にオブジェクトを配置するための適切な値を
3545 @code{Y-offset} に返します。
3547 @c TODO Add examples
3549 @node self-alignment-interface を使用する
3550 @unnumberedsubsubsec @code{self-alignment-interface} を使用する
3551 @translationof Using the @code{self-alignment-interface}
3553 @emph{オブジェクトを自動的に水平方向に揃える}
3555 @code{self-alignment-interface} をサポートするオブジェクトの水平方向の揃えは、@c
3556 @code{self-alignment-X} プロパティの値によって制御され、@c
3557 そのオブジェクトの @code{X-offset} プロパティには@c
3559 @code{ly:self-alignment-interface::x-aligned-on-self}.
3560 @code{self-alignment-X} がセットされます。@c
3561 与える実数値は、そのオブジェクトの X 方向の広がりの半分を単位とします。@c
3562 負値はオブジェクトを右に移動させ、正値はオブジェクトを左に移動させます。@c
3563 値が @code{0} であればそのオブジェクトは親オブジェクトの参照ポイントに@c
3565 値が @code{-1} であればそのオブジェクトの左端が親オブジェクトの参照ポイントに@c
3567 値が @code{1} であればそのオブジェクトの右端が親オブジェクトの参照ポイントに@c
3569 記号 @code{LEFT}, @code{CENTER}, それに @code{RIGHT} は@c
3570 それぞれ @w{@code{-1}, @code{0}, それに @code{1}} に対応します。
3572 通常、@code{\override} コマンドを用いて @code{self-alignment-X} の値を@c
3574 @code{\tweak} コマンドを用いることで@c
3575 単一の音符に付けられている複数の注釈を個別に揃えることができます:
3577 @lilypond[quote,verbatim,relative=1]
3579 -\tweak #'self-alignment-X #-1
3581 -\tweak #'self-alignment-X #0
3583 -\tweak #'self-alignment-X #RIGHT
3585 -\tweak #'self-alignment-X #-2.5
3586 ^"aligned further to the right"
3589 @emph{オブジェクトを自動的に垂直方向に揃える}
3591 オブジェクトの @code{Y-offset} プロパティに
3592 @code{ly:self-alignment-interface::y-aligned-on-self} がセットされていれば、@c
3593 水平方向の揃えと同じように、垂直方向に揃えることができます。@c
3594 しかしながら、垂直方向の揃えには他のメカニズムも関与します:
3595 @code{Y-offset} の値は、垂直方向の揃えに関与する変数の 1 つに過ぎません。@c
3596 このことにより、いくつかのオブジェクトの @code{Y-offset} 値の調整は@c
3598 単位はそのオブジェクトの垂直方向の広がりの半分です。@c
3599 通常これは非常に小さいため、非常に大きな数値が必要になる可能性があります。@c
3600 値が @code{-1} であればそのオブジェクトの下端が親オブジェクトの参照ポイントに@c
3602 値が @code{0} であればそのオブジェクトの中央が親オブジェクトの参照ポイントに@c
3604 値が @code{1} であればそのオブジェクトの上端が親オブジェクトの参照ポイントに@c
3606 記号 @code{DOWN}, @code{CENTER}, それに @code{UP} は@c
3607 それぞれ @w{@code{-1}, @code{0}, それに @code{1}} に対応します。
3609 @emph{オブジェクトを自動的に両方向に揃える}
3611 @code{X-offset} と @code{Y-offset} の両方の設定を行うことで、@c
3612 オブジェクトの水平方向と垂直方向の揃えを同時に行うことができます。
3614 以下の例は、運指記号を符頭に近づけるための調整方法を示しています。
3617 @lilypond[quote,verbatim,relative=2]
3619 -\tweak #'self-alignment-X #0.5 % 左方向に移動させます
3620 -\tweak #'Y-offset #ly:self-alignment-interface::y-aligned-on-self
3621 -\tweak #'self-alignment-Y #-1 % 上方向に移動させます
3626 @unnumberedsubsubsec Using the @code{aligned-on-parent} procedures
3628 @c Cannot document as they do not seem to operate consistently on all objects -td
3629 @c TODO investigate further
3631 The @code{aligned-on-parent} procedures are used in the same way
3632 as the @code{aligned-on-self} procedures, they difference being
3633 that they permit an object to be aligned with the @emph{edges} of
3634 the parent rather than the parent's reference point. The following
3635 example shows the difference:
3639 @lilypond[verbatim,quote]
3645 @unnumberedsubsubsec Using the @code{centered-on-parent} procedures
3647 @c Cannot document as they do not seem to operate consistently on all objects -td
3648 @c TODO investigate further
3652 @c TODO The align-interface, BassFigureAlignment and VerticalAlignment
3654 @node break-alignable-interface を使用する
3655 @unnumberedsubsubsec @code{break-alignable-interface} を使用する
3656 @translationof Using the @code{break-alignable-interface}
3658 @cindex align to objects (オブジェクトに揃える)
3659 @cindex break-align-symbols
3661 リハーサル記号と小節番号を小節線ではなく、@c
3662 記譜オブジェクトに揃えることができます。@c
3663 対象となる記譜オブジェクトには、@code{ambitus},
3664 @code{breathing-sign}, @code{clef}, @code{custos}, @code{staff-bar},
3665 @code{left-edge}, @code{key-cancellation}, @code{key-signature}, それに
3666 @code{time-signature} があります。
3669 リハーサル記号と小節番号はオブジェクトの上で水平方向に中央揃えされます:
3672 @lilypond[verbatim,quote,relative=1]
3673 % リハーサル記号は音部記号の上に中央揃えされます
3674 \override Score.RehearsalMark #'break-align-symbols = #'(clef)
3679 % リハーサル記号は拍子記号の上に中央揃えされます
3680 \override Score.RehearsalMark #'break-align-symbols = #'(time-signature)
3686 % リハーサル記号はブレス記号の上に中央揃えされます
3687 \override Score.RehearsalMark #'break-align-symbols = #'(breathing-sign)
3696 揃えの対象となり得るオブジェクトのリストを指定することができます。@c
3697 揃えを行う時点で対象リストの中にあるオブジェクトのいくつかが不可視である
3698 -- @code{break-visibility} の設定や、@c
3699 調号と音部に対する明示的な可視性の設定により --
3700 場合、リハーサル記号あるいは小節番号はリストの中にある@c
3701 最初の可視のオブジェクトに揃えられます。@c
3702 リストの中にあるオブジェクトがすべて不可視である場合、小節線に揃えられます。@c
3703 小節線が不可視である場合、小節線があるはずの場所に揃えられます。
3706 @lilypond[verbatim,quote,relative=1]
3707 % リハーサル記号は調号の上に中央揃えされます
3708 \override Score.RehearsalMark #'break-align-symbols = #'(key-signature clef)
3713 % リハーサル記号は音部記号の上に中央揃えされます
3714 \set Staff.explicitKeySignatureVisibility = #all-invisible
3715 \override Score.RehearsalMark #'break-align-symbols = #'(key-signature clef)
3720 % リハーサル記号は小節線の上に中央揃えされます
3721 \set Staff.explicitKeySignatureVisibility = #all-invisible
3722 \set Staff.explicitClefVisibility = #all-invisible
3723 \override Score.RehearsalMark #'break-align-symbols = #'(key-signature clef)
3731 記譜オブジェクトに対するリハーサル記号の揃えを変更することができます。@c
3732 複数の譜を持つ楽譜では、この設定はすべての譜に適用されます。
3735 @lilypond[verbatim,quote,relative=1]
3736 % RehearsalMark は KeySignature の上に中央揃えされます
3737 \override Score.RehearsalMark #'break-align-symbols = #'(key-signature)
3743 % RehearsalMark は KeySignature の左端に揃えられます
3744 \once \override Score.KeySignature #'break-align-anchor-alignment = #LEFT
3748 % RehearsalMark は KeySignature の右端に揃えられます
3749 \once \override Score.KeySignature #'break-align-anchor-alignment = #RIGHT
3755 また、リハーサル記号を左端に揃えて、@c
3756 さらに任意の量だけ右あるいは左にずらすことができます。@c
3760 @lilypond[verbatim,quote,relative=1]
3761 % リハーサル記号は調号の左端に揃えられて
3762 % さらに 3.5 譜スペース右にずらされます
3763 \override Score.RehearsalMark #'break-align-symbols = #'(key-signature)
3764 \once \override Score.KeySignature #'break-align-anchor = #3.5
3768 % リハーサル記号は調号の左端に揃えられて
3769 % さらに 2 譜スペース左にずらされます
3770 \once \override Score.KeySignature #'break-align-anchor = #-2
3777 @node グラフィカル オブジェクトを垂直方向にグループ化する
3778 @subsection グラフィカル オブジェクトを垂直方向にグループ化する
3779 @translationof Vertical grouping of grobs
3781 @c FIXME Expand this section
3783 VerticalAlignment グラフィカル オブジェクトと
3784 VerticalAxisGroup グラフィカル オブジェクトは対で機能します。@c
3785 VerticalAxisGroup は Staff, Lyrics, 等のような@c
3786 異なるグラフィカル オブジェクトをグループにまとめます。@c
3787 それから、VerticalAlignment が
3788 VerticalAxisGroup によってグループ化されたグラフィカル オブジェクトを@c
3790 通常、楽譜には VerticalAlignment は 1 つしかありませんが、@c
3791 Staff, Lyrics 等はそれ自体でそれぞれに VerticalAxisGroup を持ちます。
3795 @subsection ステンシルを変更する
3796 @translationof Modifying stencils
3798 すべてのレイアウト オブジェクトは、@c
3799 @code{grob-interface} の一部である @code{stencil} プロパティを持ちます。@c
3800 通常、デフォルトでこのプロパティには、@c
3801 出力でそのオブジェクトを具現化する記号を描画するための@c
3803 例えば、@code{MultiMeasureRest} オブジェクトの @code{stencil} プロパティに@c
3804 対する標準設定は、@code{ly:multi-measure-rest::print} です。
3806 @code{stencil} プロパティを変更して異なる描画関数を参照させることにより、@c
3807 オブジェクトの標準記号を置き換えることができます。@c
3808 これには LilyPond 内部機能についての高い知識が求められます。@c
3809 しかしながら、多くの場合にまずまずの結果を生み出すもっと簡単な方法があります。
3811 簡単な方法では、@code{stencil} プロパティにテキストを描画する関数
3812 -- @code{ly:text-interface::print} -- をセットし、@c
3813 必要な記号を生み出すマークアップ テキストを保持するよう設定された
3814 @code{text} プロパティ与えます。@c
3815 マークアップの自由度の高さにより、多くのことを達成できます。@c
3816 詳細は、@ref{マークアップ内部でのグラフィック記譜法} を参照してください。
3818 以下の例では、この方法を用いて符頭記号を内部に×を持つ円に変更しています。
3820 @lilypond[verbatim,quote]
3822 \once \override NoteHead #'stencil = #ly:text-interface::print
3823 \once \override NoteHead #'text = \markup {
3825 \halign #-0.7 \draw-circle #0.85 #0.2 ##f
3826 \musicglyph #"noteheads.s2cross"
3834 @code{\musicglyph} マークアップ コマンドには、@c
3835 Feta フォントに含まれる任意の図柄を提供することができます。@c
3836 @ref{The Feta font} を参照してください。
3838 @c TODO Add inserting eps files or ref to later
3840 @c TODO Add inserting Postscript or ref to later
3845 @ref{マークアップ内部でのグラフィック記譜法},
3846 @ref{テキストをフォーマットする},
3847 @ref{Text markup commands},
3853 @translationof Modifying shapes
3859 @node タイとスラーの形状を変更する
3860 @unnumberedsubsubsec タイとスラーの形状を変更する
3861 @translationof Modifying ties and slurs
3863 @cindex slurs, modifying (スラーの形状を変更する)
3864 @cindex ties, modifying (タイの形状を変更する)
3865 @cindex Bézier curves (ベジエ曲線)
3866 @cindex Bézier control points (ベジエ曲線の制御ポイント)
3868 タイ、スラー、それにフレージング スラーは 3 次のベジエ曲線として描かれます。@c
3869 自動的に算出されるタイあるいはスラーの形状が最適ではない場合、@c
3870 3 次ベジエ曲線を定義するのに必要な 4 つの制御ポイントを@c
3871 明示的に指定することによって、形状を変更することができます。
3873 3 次あるいは 3 乗のベジエ曲線は、4 つの制御ポイントによって定義されます。@c
3874 1 番目と 4 番目の制御ポイントは曲線の始点と終点になります。@c
3875 間にある 2 つの制御ポイントは曲線の形状を定義します。@c
3876 Web でベジエ曲線が描かれる様子を示すアニメーションを@c
3878 しかしながら、以下の記述も役に立つかもしれません。@c
3879 ベジエ曲線は最初の制御ポイントから 2 番目の制御ポイントに進み、@c
3880 徐々に 3 番目の制御ポイントの方へ向きを変えながら
3881 4 番目の制御ポイントの方へ向かい続け、@c
3882 3 番目の制御ポイントから 4 番目の制御ポイントに到達します。@c
3883 ベジエ曲線は 4 つの制御ポイントからなる四角形の中に納まります。
3886 タイが最適化されず、@code{\tieDown} が役に立たないケースを例として挙げます。
3888 @lilypond[verbatim,quote,relative=1]
3892 { r4 <g c,> <g c,> <g c,> }
3896 以下のようにタイの制御ポイントを手動で変更することにより、@c
3897 このタイの形状を改善することができます。
3899 ベジエ制御ポイントの座標は譜スペースを単位として指定されます。@c
3900 X@tie{}座標はそのタイあるいはスラーを取り付けられる音符の参照ポイントからの@c
3901 相対座標であり、Y@tie{}座標は譜の中央線からの相対座標です。@c
3902 制御ポイント座標は 10 進数 (実数) のペアを 4 つ持つリストとして設定されます。@c
3903 最適な制御ポイントを決定するための手順は、
3904 2 つの終点の座標を見積もり、それから 2 つの中間ポイントを推測することで、@c
3906 最適値はトライ&エラーで見つけ出します。
3908 左右対称の曲線にするには制御ポイントを左右対称に配置する必要があるということを@c
3910 また、ベジエ曲線の制御ポイントに平行移動、回転、それに拡大縮小などの変換を@c
3912 その曲線を変換できるという特性があるとも覚えておいてください。
3914 上記の実例として、以下の例のオーバライドで満足のいくタイが得られています。@c
3916 -- タイ (あるいはスラー) が開始する音符の直前に配置する必要があります --
3919 @lilypond[verbatim,quote,relative=1]
3923 #'control-points = #'((1 . -1) (3 . 0.6) (12.5 . 0.6) (14.5 . -1))
3927 { r4 <g c,> <g c,> <g c,> }
3933 同じ音楽タイミングに複数のタイあるいはスラーが存在する場合、@c
3934 @code{control-points} プロパティを変更しても@c
3935 それらの形状を変更することはできません。@c
3936 @code{\tweak} コマンドを用いたとしても変更できません。@c
3937 しかしながら、@code{TieColumn} の @code{tie-configuration} プロパティを@c
3938 オーバライドすることで、タイの垂直方向の位置と領域を変更することができます。
3942 @rinternals{TieColumn}
3947 @translationof Using music functions
3949 @c TODO -- add @seealso, etc. to these subsections
3951 調整を異なる音楽表記に再利用する必要がある場合、@c
3952 その調整を音楽関数にしておくと便利です。@c
3953 このセクションでは、@emph{置換} 関数についてだけ議論します。@c
3954 置換関数は変数を LilyPond 入力コードに置き換えます。@c
3955 他のもっと複雑な関数については、@rextend{Music functions} で記述されています。
3964 @translationof Substitution function syntax
3966 変数を LilyPond コードに置換する関数を作成することは簡単にできます。@c
3967 置換関数の一般的な形式は以下のようなものです:
3971 #(define-music-function
3972 (parser location @var{arg1} @var{arg2} @dots{})
3973 (@var{type1?} @var{type2?} @dots{})
3975 @var{@dots{}music@dots{}}
3982 @multitable @columnfractions .33 .66
3983 @item @code{@var{argN}}
3986 @item @code{@var{typeN?}}
3987 @tab @code{@var{argN}} が @code{#t} を返す Scheme の @emph{型述語} (type predicate)。
3989 @item @code{@var{@dots{}music@dots{}}}
3990 @tab 通常の LilyPond 入力。@code{$} を用いて引数を参照します
3997 共通の変数タイプについては @ref{共通の引数タイプ} で記述されています。@c
3999 @rextend{Music function definitions} にあります。
4002 引数 @code{parser} と @code{location} を省略することはできず、@c
4003 @rextend{Music function definitions} で記述されている高度な状況で@c
4005 置換関数において、必ずこれらの引数を記述してください。
4007 引数として、型述語のリストも必須です。@c
4008 音楽関数で用いられる一般的な型述語には下記のものがあります:
4012 cheap-list? @emph{(}@q{list?}@emph{ の代わりに用いることで、処理を高速にします)}
4023 @ref{Predefined type predicates} を参照してください。@c
4024 ユーザが型述語を定義することもできます。
4030 @ref{Predefined type predicates}
4033 @rextend{Music function definitions}
4036 @file{lily/music-scheme.cc},
4043 @subsection 共通の引数タイプ
4044 @translationof Common argument types
4047 音楽関数に渡される各引数タイプを定義しておく必要があります。@c
4048 共通の引数タイプのいくつかを以下の表で示します。@c
4050 以下の入力タイプを音楽関数で変数として使用することができます。@c
4051 このリストは完全なものではありません。@c
4052 取り得る変数タイプについての更なる情報は、
4053 @rextend{Music function definitions} にあります。
4055 @multitable @columnfractions .33 .66
4056 @headitem 入力タイプ @tab @var{vari-type?} での記述方法
4057 @item 整数 @tab @code{integer?}
4058 @item 浮動小数点数 (10 進数) @tab @code{number?}
4059 @item テキスト文字列 @tab @code{string?}
4060 @item マークアップ @tab @code{markup?}
4061 @item 音楽表記 @tab @code{ly:music?}
4062 @item Scheme ペア @tab @code{pair?}
4068 @rextend{Music function definitions}
4071 @file{lily/music-scheme.cc},
4079 @translationof Substitution function examples
4081 このセクションでは、置換関数の例をいくつか紹介します。@c
4082 高度なことはしていませんが、シンプルな置換関数を実現する方法を示しています。
4085 @code{TextScript} のパディング設定を容易にするための関数が定義されています:
4087 @lilypond[quote,verbatim,ragged-right]
4089 #(define-music-function
4090 (parser location padding)
4093 \once \override TextScript #'padding = $padding
4097 c4^"piu mosso" b a b
4099 c4^"piu mosso" d e f
4101 c4^"piu mosso" fis a g
4105 数値のほかに、音符などの音楽表記を音楽関数への引数にすることができます:
4107 @c TODO: use a better example (the music argument is redundant).
4109 @lilypond[quote,verbatim,ragged-right]
4111 #(define-music-function
4112 (parser location note)
4115 \once \override Voice.NoteHead #'stencil =
4116 #ly:text-interface::print
4117 \once \override Voice.NoteHead #'text =
4118 \markup \musicglyph #"custodes.mensural.u0"
4119 \once \override Voice.Stem #'stencil = ##f
4123 \relative c' { c4 d e f \custosNote g }
4126 複数の引数をとる置換関数を定義することもできます:
4128 @lilypond[quote,verbatim,ragged-right]
4130 #(define-music-function
4131 (parser location padding tempotext)
4134 \once \override Score.MetronomeMark #'padding = $padding
4135 \tempo \markup { \bold #tempotext }
4139 \tempo \markup { "Low tempo" }
4141 \tempoPadded #4.0 #"High tempo"
4146 @c TODO: add appropriate @@ref's here.