1 @c -*- coding: utf-8; mode: texinfo; documentlanguage: ja -*-
4 Translation of GIT committish: 45329bd378eedfebca34c746fff9e53b46cf2fe5
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/@/user/@/lilypond@/-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
899 \override Flag #'transparent = ##t
902 これらのプラグインすべてが共同する必要があり、@c
904 このプラグインは常に @code{Engraver_group} であり、@c
905 キーワード @code{\type} を付ける必要があります。
908 \type "Engraver_group"
916 \type "Engraver_group"
917 \consists "Note_heads_engraver"
918 \consists "Text_engraver"
919 \consists Pitch_squash_engraver
920 squashedPosition = #0
921 \override NoteHead #'style = #'slash
922 \override Stem #'transparent = ##t
923 \override Flag #'transparent = ##t
924 \override Flag #'transparent = ##t
931 通常の @code{Voice} と同様に、@c
932 @code{ImproVoice} を @code{Staff} の下に置く必要があります。@c
933 それゆえ、@code{Staff} 定義を @code{\accepts} コマンドで変更します:
943 @code{\accepts} の反対は @code{\denies} です。@c
944 これは既存のコンテキスト定義を再利用する場合に必要となります。
946 以下のように、両方を @code{\layout} ブロックの中に置きます:
956 \accepts "ImproVoice"
961 それから、このサブセクションの最初にあった出力を入力します:
969 c c_"while playing :)"
977 @subsection コンテキストを揃える
978 @translationof Aligning contexts
980 新しいコンテキストを既存のコンテキストの上または下に揃えることができます。@c
981 これはボーカル譜 (@rlearning{合唱}) を組む場合やオッシアで役に立ちます。
983 @c TODO Better example needed. Ref LM, and expand on it.
986 @funindex alignAboveContext
987 @funindex alignBelowContext
989 @lilypond[quote,ragged-right]
992 \relative c' \new Staff = "main" {
995 \new Staff \with { alignAboveContext = #"main" } \ossia
1002 @cindex nested contexts (ネストされたコンテキスト)
1003 @cindex contexts, nested (ネストされたコンテキスト)
1008 @code{PianoStaff} のようなコンテキストは、@c
1010 他のコンテキストを内部に保持することができます。@c
1011 ネスト構造をとることができるコンテキストは、@c
1012 コンテキストの @qq{accepts} リストによって定義されています。@c
1013 このリストには存在しないコンテキストは、楽譜が譜刻されるとき、@c
1014 (@code{PianoStaff} などの) 親コンテキストの下に配置されます。@c
1015 例えば、@code{PianoStaff} コンテキストは、デフォルトで、@c
1016 @code{Staff} と @code{FiguredBass} コンテキストを内部に受け入れるよう@c
1017 定義されていますが、(例えば) @code{Lyrics} コンテキストは受け入れません。@c
1018 そのため、以下の例では、歌詞は 2 つの譜の間ではなく、@c
1021 @lilypond[verbatim,quote,relative=1]
1024 \new Staff { e4 d c2 }
1025 \addlyrics { Three blind mice }
1033 コンテキストの @qq{accepts} リストを変更することで、
1034 ネストされるコンテキストを追加するができます。@c
1035 ですから、歌詞を 2 つの譜の間に表示させたいのなら、以下のようにします:
1037 @lilypond[verbatim,quote,relative=1]
1038 \new PianoStaff \with { \accepts Lyrics }
1040 \new Staff { e4 d c2 }
1041 \addlyrics { Three blind mice }
1049 @code{\accepts} の反対は @code{\denies} です。@c
1050 これはコンテキストを @qq{accepts} リストから削除します。
1054 @section 内部リファレンスの説明
1055 @translationof Explaining the Internals Reference
1061 * グラフィカル オブジェクトを決定する::
1065 @node 内部リファレンスを使いこなす
1066 @subsection 内部リファレンスを使いこなす
1067 @translationof Navigating the program reference
1069 @c TODO remove this (it's in the LM)
1070 @c Replace with more factual directions
1072 以下の譜面の運指記号を移動させたいとします:
1074 @lilypond[quote,relative=2,verbatim]
1080 運指指示のドキュメント (@ref{運指の指示}) を見ると、@c
1081 以下のようなセクションがあることに気付くはずです:
1086 内部リファレンス: @rinternals{Fingering}
1091 @c outdated info; probably will delete.
1093 This fragment points to two parts of the program reference: a page
1094 on @code{FingeringEvent} and one on @code{Fingering}.
1096 The page on @code{FingeringEvent} describes the properties of the music
1097 expression for the input @code{-2}. The page contains many links
1098 forward. For example, it says
1101 Accepted by: @rinternals{Fingering_engraver},
1105 That link brings us to the documentation for the Engraver, the
1109 This engraver creates the following layout objects: @rinternals{Fingering}.
1112 In other words, once the @code{FingeringEvent}s are interpreted, the
1113 @code{Fingering_engraver} plug-in will process them.
1117 @c I can't figure out what this is supposed to mean. -gp
1119 The @code{Fingering_engraver} is also listed to create
1120 @rinternals{Fingering} objects,
1122 @c old info? it doesn't make any sense to me with our current docs.
1124 second bit of information listed under @b{See also} in the Notation
1129 内部リファレンスは HTML ドキュメント形式で入手可能です。@c
1130 内部リファレンスは、オンラインか HTML ドキュメントをダウンロードするかして、@c
1131 HTML 形式で読むことを強く推奨します。@c
1132 PDF マニュアルを使用していると、@c
1133 このセクションを理解するのはずっと困難になります。@c
1134 (訳者: 日本語では PDF 形式での提供はありません。)
1137 @rinternals{Fingering} へのリンクを辿ってください。@c
1138 ページの先頭に、以下のような記述があります:
1141 Fingering objects are created by: @rinternals{Fingering_engraver} and
1142 @rinternals{New_fingering_engraver}.
1145 内部リファレンスの中にある関連リンクを辿っていくことで、@c
1146 プログラム内部の情報フローを追っていくことができます:
1150 @item @rinternals{Fingering}:
1151 @rinternals{Fingering} objects are created by:
1152 @rinternals{Fingering_engraver}
1154 (@rinternals{Fingering}:
1155 @rinternals{Fingering} オブジェクトを作成するのは:
1156 @rinternals{Fingering_engraver})
1159 @item @rinternals{Fingering_engraver}:
1160 Music types accepted:
1161 @rinternals{fingering-event}
1163 (@rinternals{Fingering_engraver}:
1164 受け取る音楽タイプは: @rinternals{fingering-event})
1166 @item @rinternals{fingering-event}:
1167 Music event type @code{fingering-event} is in
1168 Music expressions named @rinternals{FingeringEvent}
1170 (@rinternals{fingering-event}:
1171 音楽イベント タイプ @code{fingering-event} は
1172 @rinternals{FingeringEvent} という名前の音楽表記の中にあります)
1176 このパスは、プログラム内部での情報フローとは逆向きです:
1177 出力からスタートして、入力イベントで終わっています。@c
1178 入力イベントからスタートして、情報フローを読み進め、@c
1179 最後は出力オブジェクトに辿り着くこともできます。
1181 内部リファレンスを通常のドキュメントのように読むこともできます。@c
1184 @rinternals{Music definitions},
1187 @code{Music definitions},
1189 @rinternals{Translation}, それに @rinternals{Backend} です。
1190 各章は、使用されているすべての定義と調整可能なすべてのプロパティを@c
1194 @node レイアウト インターフェイス
1195 @subsection レイアウト インターフェイス
1196 @translationof Layout interfaces
1198 @cindex interface, layout (レイアウト インターフェイス)
1199 @cindex layout interface (レイアウト インターフェイス)
1200 @cindex grob (グラフィカル オブジェクト)
1202 前のセクションで見た HTML ページには、@c
1203 @rinternals{Fingering} と呼ばれるレイアウト オブジェクトについての@c
1205 そのようなオブジェクトは楽譜で記号となります。@c
1206 レイアウト オブジェクトは (太さや向きのような) 数値を保持する@c
1208 関連オブジェクトへのポインタも持っています。@c
1209 レイアウト オブジェクトは @emph{Grob}
1210 -- これはグラフィカル オブジェクトを縮めたものです --
1212 Grob についての詳細は、@rinternals{grob-interface} を参照してください。
1214 @code{Fingering} のページは、@c
1215 @code{Fingering} オブジェクトの定義をリストアップしています。@c
1216 例えば、このページには以下のような記述があります:
1219 @code{padding} (dimension, in staff space):
1225 これは、この数値は少なくとも符頭の 0.5 倍の距離を保つということを意味します。
1228 各レイアウト オブジェクトは、記譜要素あるいは写植要素としての機能を@c
1230 例えば、@code{Fingering} オブジェクトは以下の側面を持っています:
1234 Its size is independent of the horizontal spacing, unlike slurs or beams.
1236 (このオブジェクトのサイズは、スラーや連桁と異なり、@c
1240 It is a piece of text. Granted, it is usually a very short text.
1242 (このオブジェクトはテキストです。通常、これは非常に短いテキストです。)
1245 That piece of text is typeset with a font, unlike slurs or beams.
1247 (このテキストは、スラーや連桁と異なり、フォントで写植されます。)
1250 Horizontally, the center of the symbol should be aligned to the
1251 center of the note head.
1253 (水平方向では、この記号の中心は符頭の中心に揃えられます。)
1256 Vertically, the symbol is placed next to the note and the staff.
1258 (垂直方向では、この記号は音符や譜の近く配置されます。)
1261 The vertical position is also coordinated with other superscript
1262 and subscript symbols.
1264 (また、垂直方向の位置は、他の上付き記号や下付き記号との調整によって決まります。)
1267 これらの側面はそれぞれ、いわゆる @emph{インターフェイス}
1269 それらは、@rinternals{Fingering} ページの最下部でリストアップされています。
1272 This object supports the following interfaces:
1274 (このオブジェクトは以下のインターフェイスをサポートします:)
1276 @rinternals{item-interface},
1277 @rinternals{self-alignment-interface},
1278 @rinternals{side-position-interface}, @rinternals{text-interface},
1279 @rinternals{text-script-interface}, @rinternals{font-interface},
1280 @rinternals{finger-interface}, and @rinternals{grob-interface}.
1284 それぞれのオブジェクト インターフェイスのページに行くことができます。@c
1285 各インターフェイスはいくつかのプロパティを持ちます。@c
1286 それらプロパティの中には、ユーザにとって役に立たないもの
1287 (@q{内部プロパティ}) もありますが、それ以外は変更可能です。
1289 これまで @code{Fingering} オブジェクトについて話してきましたが、@c
1290 これは実際にはそれほど多くのことをしているわけではありません。@c
1291 初期化ファイル (@rlearning{その他の情報源} を参照してください)
1292 @file{scm/define-grobs.scm} がこの @q{オブジェクト} の本質を示しています:
1297 (avoid-slur . around)
1298 (slur-padding . 0.2)
1299 (staff-padding . 0.5)
1300 (self-alignment-X . 0)
1301 (self-alignment-Y . 0)
1302 (script-priority . 100)
1303 (stencil . ,ly:text-interface::print)
1304 (direction . ,ly:script-interface::calc-direction)
1305 (font-encoding . fetaText)
1306 (font-size . -5) ; don't overlap when next to heads.
1307 (meta . ((class . Item)
1308 (interfaces . (finger-interface
1310 text-script-interface
1312 side-position-interface
1313 self-alignment-interface
1314 item-interface))))))
1319 @code{Fingering} オブジェクトは変数設定の塊に過ぎず、@c
1320 内部リファレンスの中にある Web ページは、@c
1321 この定義から直接生成されたに過ぎません。
1324 @node グラフィカル オブジェクトを決定する
1325 @subsection グラフィカル オブジェクトを決定する
1326 @translationof Determining the grob property
1328 @c TODO remove this (it's in the LM)
1329 @c Replace with more factual directions
1331 以下の @b{2} の位置を変更しようとしていたことを思い出してください:
1333 @lilypond[quote,fragment,relative=2,verbatim]
1339 垂直方向で見て、@b{2} は元の音符の隣に配置されるのですから、@c
1340 この配置に関連するインターフェイスに干渉する必要があります。@c
1341 これは @code{side-position-interface} を用いて行います。@c
1342 このインターフェイスについてのページには、以下のように記述されています:
1345 @code{side-position-interface}
1347 Position a victim object (this one) next to other objects (the
1348 support). The property @code{direction} signifies where to put the
1349 victim object relative to the support (left or right, up or down?)
1351 (対象オブジェクトを他のオブジェクト (サポート オブジェクト)
1353 このプロパティ @code{direction} は、@c
1354 対象オブジェクトをどこに配置するかを@c
1355 サポート オブジェクトからの相対位置で示します
1361 この記述の下に、以下のような変数 @code{padding} についての記述があります:
1366 (dimension, in staff space)
1369 Add this much extra space between objects that are next to each other.
1370 (隣り合うオブジェクトの間にスペースを付け加えます)
1374 @code{padding} の値を増やすことで、@c
1375 運指記号を符頭から離すことができます。@c
1376 以下のコマンドは、音符と運指記号の間に 3 譜スペースを挿入します:
1379 \once \override Voice.Fingering #'padding = #3
1382 このコマンドを @code{Fingering} オブジェクトが作成される前に挿入する
1383 -- つまり @code{c2} の前に挿入する -- と、以下のような結果が得られます:
1385 @lilypond[quote,relative=2,fragment,verbatim]
1386 \once \override Voice.Fingering #'padding = #3
1393 このケースでは、調整されるコンテキストは @code{Voice} です。@c
1394 このことは、内部リファレンスの @rinternals{Fingering_engraver}
1395 プラグインについてのページからわかります。@c
1396 このページには、以下のような記述があります:
1399 Fingering_engraver is part of contexts: @dots{} @rinternals{Voice}
1400 (Fingering_engraver は次のコンテキストの一部です: @dots{} @rinternals{Voice})
1406 @translationof Naming conventions
1408 内部リファレンスについて他に説明しておくべき事柄として、@c
1409 さまざまな命名規約についての概要があります:
1412 @item Scheme スタイル: 小文字の単語をハイフンでつなぎます
1413 (1 単語の名前を含みます) -- 例: lowercase-with-hyphens
1414 @item Scheme 関数: Scheme スタイルの先頭に @code{ly:} を付けます
1415 -- 例: ly:plus-scheme-style
1416 @item 音楽イベント、音楽クラス、それに音楽プロパティ: Scheme スタイルです
1417 -- 例: as-scheme-functions
1418 @item グラフィカル オブジェクト インターフェイス: Scheme スタイルです
1421 @item バックエンド プロパティ: Scheme スタイルです (が、X と Y があります!)
1422 @item コンテキスト (それに、音楽表記とグラフィカル オブジェクト):
1423 大文字で始まる単語、あるいはそれらをつなげます
1424 -- 例: Capitalized, CamelCase
1426 小文字で始まる単語に、大文字で始まる単語をつなげます
1427 -- 例: lowercaseFollowedByCamelCase
1429 大文字で始まる単語に、小文字で始まる単語をアンダスコアでつなげます
1430 -- 例: Capitalized_followed_by_lowercase_and_with_underscores
1435 @item 命名規約のうち、慣習なのはどれで、規則なのはどれか?
1436 @item 命名規約のうち、どれが基本言語の規則で、@c
1437 どれが LP (訳者: LilyPond?) 特有の規則なのか?
1443 @translationof Modifying properties
1445 @c TODO change the menu and subsection node names to use
1446 @c backslash once the new macro to handle the refs
1447 @c is available. Need to find and change all refs at
1448 @c the same time. -td
1461 @subsection プロパティ変更の概要
1462 @translationof Overview of modifying properties
1464 各コンテキストは、ある特定のタイプのグラフィカル オブジェクトを作成することに@c
1466 それらのオブジェクトを表示するために使用される設定も、@c
1468 それらの設定を変更することにより、オブジェクトの見た目を変えることができます。
1470 コンテキストに保存されるプロパティには 2 種類あります:
1471 コンテキスト プロパティとグラフィカル オブジェクト プロパティです。@c
1472 コンテキスト プロパティは、コンテキスト全体に適用され、@c
1473 コンテキスト自体をどのように表示するかを制御します。@c
1474 対照的に、グラフィカル オブジェクト プロパティは、コンテキストの中に表示される@c
1475 ある特定のタイプのグラフィカル オブジェクトに適用されます。
1477 @code{\set} コマンドと @code{\unset} コマンドは、@c
1478 コンテキスト プロパティの値を変更するために使用されます。@c
1479 @code{\override} コマンドと @code{\revert} コマンドは、@c
1480 グラフィカル オブジェクト プロパティの値を変更するために使用されます。
1483 The syntax for this is
1486 \override @var{context}.@var{name} #'@var{property} = #@var{value}
1489 Here @var{name} is the name of a graphical object, like
1490 @code{Stem} or @code{NoteHead}, and @var{property} is an internal
1491 variable of the formatting system (@q{grob property} or @q{layout
1492 property}). The latter is a symbol, so it must be quoted. The
1493 subsection @ref{Modifying properties}, explains what to fill in
1494 for @var{name}, @var{property}, and @var{value}. Here we only
1495 discuss the functionality of this command.
1500 \override Staff.Stem #'thickness = #4.0
1504 makes stems thicker (the default is 1.3, with staff line thickness as a
1505 unit). Since the command specifies @code{Staff} as context, it only
1506 applies to the current staff. Other staves will keep their normal
1507 appearance. Here we see the command in action:
1509 @lilypond[quote,verbatim,relative=2,fragment]
1511 \override Staff.Stem #'thickness = #4.0
1517 The @code{\override} command changes the definition of the @code{Stem}
1518 within the current @code{Staff}. After the command is interpreted
1519 all stems are thickened.
1521 Analogous to @code{\set}, the @var{context} argument may be left out,
1522 causing the default context @code{Voice} to be used. Adding
1523 @code{\once} applies the change during one timestep only.
1525 @lilypond[quote,fragment,verbatim,relative=2]
1527 \once \override Stem #'thickness = #4.0
1532 The @code{\override} must be done before the object is
1533 started. Therefore, when altering @emph{Spanner} objects such as slurs
1534 or beams, the @code{\override} command must be executed at the moment
1535 when the object is created. In this example,
1537 @lilypond[quote,fragment,verbatim,relative=2]
1538 \override Slur #'thickness = #3.0
1540 \override Beam #'thickness = #0.6
1545 the slur is fatter but the beam is not. This is because the command for
1546 @code{Beam} comes after the Beam is started, so it has no effect.
1548 Analogous to @code{\unset}, the @code{\revert} command for a context
1549 undoes an @code{\override} command; like with @code{\unset}, it only
1550 affects settings that were made in the same context. In other words, the
1551 @code{\revert} in the next example does not do anything.
1554 \override Voice.Stem #'thickness = #4.0
1555 \revert Staff.Stem #'thickness
1558 Some tweakable options are called @q{subproperties} and reside inside
1559 properties. To tweak those, use commands of the form
1561 @c leave this as a long long
1563 \override @var{context}.@var{name} #'@var{property} #'@var{subproperty} = #@var{value}
1570 \override Stem #'(details beamed-lengths) = #'(4 4 3)
1577 @rinternals{Backend},
1578 @rinternals{All layout objects},
1579 @rinternals{OverrideProperty},
1580 @rinternals{RevertProperty},
1581 @rinternals{PropertySet}
1586 バックエンドはオブジェクト プロパティのタイプ チェックを@c
1588 Scheme 値の循環参照は、ハング アップまたはクラッシュ、@c
1589 あるいは両方を引き起こす可能性があります。
1594 @subsection @code{\set} コマンド
1595 @translationof The set command
1597 @cindex properties (プロパティ)
1599 @cindex changing properties (プロパティを変更する)
1601 各コンテキストは @emph{プロパティ} の集合を持ちます。@c
1602 プロパティとは、コンテキストの中に保持されている変数です。@c
1603 コンテキスト プロパティは、@code{\set} コマンドによって変更されます。@c
1604 @code{\set} コマンドは以下のような構文を持ちます:
1607 \set @var{context}.@var{property} = #@var{value}
1610 @var{value} は Scheme オブジェクトですので、@c
1611 @code{#} 文字を前に置く必要があります。
1613 通常、コンテキスト プロパティの名前は、@c
1614 小文字で始まる単語に大文字で始まる単語をつなげたものです。@c
1615 これらはたいてい音楽から記譜への翻訳を制御します
1616 -- 例えば、@code{localKeySignature} (臨時記号を表示するかどうかを決定します)
1617 や、@code{measurePosition} (小節線を表示するタイミングを決定します) です。@c
1618 コンテキスト プロパティは、楽曲の解釈をしている間、@c
1619 ずっと値を変更しておくことができます。@c
1620 @code{measurePosition} がその良い例です。@c
1621 コンテキスト プロパティは @code{\set} で変更されます。
1623 例えば、コンテキスト プロパティ @code{skipBars} が
1624 @code{#t} にセットされていれば、@c
1625 複小節休符は 1 つの小節に統合されます:
1627 @lilypond[quote,verbatim,relative=2,fragment]
1629 \set Score.skipBars = ##t
1633 @var{context} 引数が省略されている場合、@c
1634 プロパティはカレントの最下位のコンテキストにセットされます
1635 (一般に、@code{ChordNames}, @code{Voice}, @code{TabVoice},
1636 あるいは @code{Lyrics} です)。
1638 @lilypond[quote,verbatim,relative=2]
1639 \set Score.autoBeaming = ##f
1643 \set autoBeaming = ##t
1651 変更は @q{オンザフライ} (その場、その時々) で適用されるため、@c
1652 設定 @code{\set autoBeaming = ##t} は 2 番目の 8 分音符グループだけに@c
1655 最下位コンテキストが常に変更しようとしているプロパティを持っているとは@c
1657 -- 例えば、@code{skipBars} プロパティをデフォルトの最下位コンテキスト
1658 (この場合は、@code{Voice} です) にセットしようと試みても、効果はありません。@c
1659 なぜなら、@code{skipBars} は @code{Score} コンテキストのプロパティだからです。
1661 @lilypond[quote,verbatim,relative=2]
1667 コンテキストは階層構造をとるため、音楽表記を囲っているコンテキスト
1668 -- 例えば、@code{Staff} -- が指定された場合、@c
1669 変更はカレントの @code{Staff} の中にあるすべての @code{Voice} に適用されます。
1676 \unset @var{context}.@var{property}
1680 は、@var{context} から @var{property} の定義を削除するために使用されます。@c
1681 このコマンドは、@var{context} の中にセットされた場合にのみ、定義を削除します。@c
1682 音楽表記を囲っているコンテキストにセットされたプロパティは、@c
1683 囲まれているコンテキストの中にある @code{\unset} では変更されません:
1685 @lilypond[quote,verbatim,relative=2]
1686 \set Score.autoBeaming = ##t
1691 \unset Score.autoBeaming
1700 最下位コンテキストに対しては @var{context} 引数を指定する必要はありません。@c
1704 \set Voice.autoBeaming = ##t
1705 \set autoBeaming = ##t
1709 は、カレントの最下位コンテキストが @code{Voice} であれば、等価です。
1713 @code{\set} の前に @code{\once} を置くと、@c
1714 その設定は単一の時間ステップにだけ適用されます:
1716 @lilypond[quote,verbatim,relative=2]
1718 \once \set fontSize = #4.7
1723 利用可能なすべてのコンテキスト プロパティについての完全な記述は、@c
1727 @rinternals{Tunable context properties}.
1730 Translation @expansion{} Tunable context properties.
1737 @rinternals{Tunable context properties}
1740 @cindex grob properties (グラフィカル オブジェクト プロパティ)
1741 @cindex properties, grob (グラフィカル オブジェクト プロパティ)
1746 @subsection @code{\override} コマンド
1747 @translationof The override command
1749 特殊なタイプのコンテキスト プロパティがあります:
1750 グラフィカル オブジェクト記述です。@c
1751 グラフィカル オブジェクト記述には @code{StudlyCaps} という名前
1752 (大文字で始まります) が付けられています。@c
1753 これらは、関連リストとして、ある特定の種類のグラフィカル オブジェクト用の
1754 @q{デフォルト設定} を保持します。@c
1755 各グラフィカル オブジェクト記述の設定を調べるには、@c
1756 @file{scm/define-grobs.scm} を参照してください。@c
1757 各グラフィカル オブジェクト記述は @code{\override} を用いて変更します。
1759 @code{\override} は、実際のところ、簡略化した記述です。
1762 \override @var{context}.@var{GrobName} #'@var{property} = #@var{value}
1768 @c leave this long line -gp
1770 \set @var{context}.@var{GrobName} =
1771 #(cons (cons '@var{property} @var{value})
1772 <previous value of @var{context}.@var{GrobName}>)
1775 @code{context}.@code{GrobName} (alist) の値は、@c
1776 個々のグラフィカル オブジェクトのプロパティを初期化するために使用されます。@c
1777 グラフィカル オブジェクトは、Scheme スタイルの名前
1778 (小文字の単語を @code{-} でつないだもの) のプロパティを持ちます。@c
1779 グラフィカル オブジェクト プロパティの値は、@c
1780 フォーマット処理の間ずっと変更されています:
1782 コールバック関数を用いてプロパティを計算することに他なりません。@c
1784 例えば、@code{Stem} オブジェクトの @code{thickness} プロパティを@c
1785 オーバライドすることによって、符幹の太さを太くすることができます:
1787 @lilypond[quote,verbatim,relative=2]
1789 \override Voice.Stem #'thickness = #3.0
1793 If no context is specified in an @code{\override}, the bottom
1796 @lilypond[quote,verbatim,relative=2]
1797 { \override Staff.Stem #'thickness = #3.0
1801 \override Stem #'thickness = #0.5
1811 @cindex reverting overrides (オーバライドを元に戻す)
1812 @cindex overrides, reverting (オーバライドを元に戻す)
1814 @code{\override} の効果は、@code{\revert} によって元に戻すことができます:
1816 @lilypond[quote,verbatim,relative=2]
1818 \override Voice.Stem #'thickness = #3.0
1820 \revert Voice.Stem #'thickness
1824 @code{\override} と @code{\revert} の効果は、@c
1825 その時点から影響を受けるコンテキストの中にある@c
1826 すべてのグラフィカル オブジェクトに適用されます:
1828 @lilypond[quote,verbatim,relative=2]
1833 \override Staff.Stem #'thickness = #3.0
1837 \revert Staff.Stem #'thickness
1845 @cindex overriding for only one moment (一時的にオーバライドする)
1847 @code{\once} を @code{\override} と共に用いることで、@c
1848 カレントの時間ステップだけに効果を与えることができます:
1850 @lilypond[quote,verbatim,relative=2]
1854 \override Stem #'thickness = #3.0
1858 \once \override Stem #'thickness = #3.0
1867 Commands which change output generally look like
1870 \override Voice.Stem #'thickness = #3.0
1874 To construct this tweak we must determine these bits of information:
1877 @item the context: here @code{Voice}.
1878 @item the layout object: here @code{Stem}.
1879 @item the layout property: here @code{thickness}.
1880 @item a sensible value: here @code{3.0}.
1883 Some tweakable options are called @q{subproperties} and reside inside
1884 properties. To tweak those, use commands in the form
1887 \override Stem #'(details beamed-lengths) = #'(4 4 3)
1890 @cindex internal documentation
1891 @cindex finding graphical objects
1892 @cindex graphical object descriptions
1895 @cindex internal documentation
1897 For many properties, regardless of the data type of the property, setting the
1898 property to false ( @code{##f} ) will result in turning it off, causing
1899 LilyPond to ignore that property entirely. This is particularly useful for
1900 turning off grob properties which may otherwise be causing problems.
1902 We demonstrate how to glean this information from the notation manual
1903 and the program reference.
1909 @rinternals{Backend}
1913 @subsection @code{\tweak} コマンド
1914 @translationof The tweak command
1917 @cindex tweaking (調整)
1919 @code{\tweak} を用いたグラフィカル オブジェクト プロパティの変更は、@c
1920 コンテキストの中にあるすべてのグラフィカル オブジェクトに適用されます。@c
1922 影響を受けるコンテキストの中にあるすべてのグラフィカル オブジェクトではなく、@c
1923 1 つのグラフィカル オブジェクトだけに変更を適用したい場合もあります。@c
1924 そうするには、@code{\tweak} コマンドを用います。@c
1925 @code{\tweak} コマンドは以下のような構文を持ちます:
1928 \tweak #'@code{grob-property} #@code{value}
1931 @code{\tweak} コマンドは、音楽の流れの中で
1932 @code{value} のすぐ後に現れるオブジェクトに変更を適用します。
1935 In some cases, it is possible to take a short-cut for tuning
1936 graphical objects. For objects that are created directly from
1937 an item in the input file, you can use the @code{\tweak} command.
1940 @lilypond[relative=2,verbatim,quote]
1945 \tweak #'duration-log #1
1948 -\tweak #'padding #8
1954 But the main use of the @code{\tweak} command is to modify just
1955 one of a number of notation elements which start at the same musical
1956 moment, like the notes of a chord, or tuplet brackets which start
1959 The @code{\tweak} command sets a property in the following object
1960 directly, without requiring the grob name or context to be
1961 specified. For this to work, it is necessary for the @code{\tweak}
1962 command to remain immediately adjacent to the object to which it is
1963 to apply after the input file has been converted to a music stream.
1964 This is often not the case, as many additional elements are inserted
1965 into the music stream implicitly. For example, when a note which is
1966 not part of a chord is processed, LilyPond implicitly inserts a
1967 @code{ChordEvent} event before the note, so separating the tweak
1968 from the note. However, if chord symbols are placed round the
1969 tweak and the note, the @code{\tweak} command comes after the
1970 @code{ChordEvent} in the music stream, so remaining adjacent to the
1971 note, and able to modify it.
1975 @lilypond[relative=2,verbatim,quote]
1976 <\tweak #'color #red c>4
1982 @lilypond[relative=2,verbatim,quote]
1983 \tweak #'color #red c4
1988 調整コマンドの構文と使用方法についての紹介は、@c
1989 @rlearning{調整手段} を参照してください。
1991 同じようなオブジェクトがいくつか、同じ音楽タイミングで配置されている場合、@c
1992 @code{\override} コマンドでそれらの 1 つだけを変更することはできません
1993 -- @code{\tweak} コマンドを用いる必要があります。@c
1994 同じ音楽タイミングで複数出現する可能性があるオブジェクトには、@c
1997 @c TODO expand to include any further uses of \tweak
2000 @item 1 つの音符に付けられるアーティキュレーション記号
2001 @item 和音の中にある音符の間に付けられるタイ
2005 @c TODO add examples of these
2007 @cindex chord, modifying one note in (和音の中にある音符の 1 つを変更する)
2009 以下の例では、和音の中にある符頭の 1 つの色を変更し、@c
2010 さらに他の符頭のタイプを変更しています:
2012 @lilypond[relative=2,verbatim,quote]
2017 \tweak #'duration-log #1
2022 @code{\tweak} を用いて、スラーを変更することができます:
2024 @lilypond[verbatim,quote,relative=1]
2025 c-\tweak #'thickness #5 ( d e f)
2029 @code{\tweak} コマンドが機能するためには、@c
2030 入力ファイルが音楽の流れに変換されたときに、@c
2031 @code{\tweak} コマンドのすぐ後に@c
2032 変更が適用されるオブジェクトが配置されている必要があります。
2033 LilyPond は、構文解釈処理時に、@c
2034 追加のオブジェクトを音楽の流れの中に挿入する場合があります。@c
2035 例えば、明示的には和音の一部になっていない音符を、@c
2036 LilyPond が音符の中に配置する場合があります。@c
2037 そのため、@code{\tweak} で変更される音符は、@c
2038 和音構造の中に配置されている必要があります:
2040 @lilypond[relative=2,verbatim,quote]
2041 \tweak #'color #red c4
2042 <\tweak #'color #red c>4
2045 @code{\tweak} コマンドは、@c
2046 入力ファイルの中で明示的に記述されていないオブジェクトを@c
2047 変更するために用いることはできません。@c
2048 特に、符幹、連桁、あるいは臨時記号を直接変更することはできません。@c
2049 なぜなら、それらは入力の中にある音楽要素の後ではなく、@c
2051 さらに、音部記号や拍子記号を変更することもできません。@c
2052 なぜなら、コンテキストを指定するために必要とされる追加要素の自動挿入により、@c
2053 それらは前に配置された @code{\tweak} コマンドとは分離されるからです。@c
2055 記譜要素の前に複数の @code{\tweak} コマンドを配置することができます
2058 @lilypond[verbatim,quote,relative=1]
2060 -\tweak #'style #'dashed-line
2061 -\tweak #'dash-fraction #0.2
2062 -\tweak #'thickness #3
2063 -\tweak #'color #red
2068 入力ファイルのあるセクションから生成される音楽の流れ
2069 -- 自動的に挿入される要素も含めて --
2071 @rextend{Displaying music expressions} を参照してください。@c
2072 これは、@code{\tweak} コマンドによって変更されるオブジェクトを決定するとき、@c
2074 @code{\tweak} の適用で入力を調整する方法を決定するときに役に立つかもしれません。
2082 @rextend{Displaying music expressions}
2087 @cindex tweaks in a variable (変数の中での調整)
2088 @code{\tweak} コマンドを変数の中で用いることはできません。
2090 @cindex tweaks in lyrics (歌詞の中での調整)
2091 @code{\tweak} コマンドを @code{\lyricmode} の中で用いることはできません。
2093 @cindex tweaking control points (制御ポイントを調整する)
2094 @cindex control points, tweaking (制御ポイントを調整する)
2096 @code{\tweak} コマンドは、和音の中で生成される複数のタイのうち、@c
2100 @node set 対 override
2101 @subsection @code{\set} 対 @code{\override}
2102 @translationof set versus override
2104 TODO -- This section is probably unnecessary now.
2107 We have seen two methods of changing properties: @code{\set} and
2108 @code{\override}. There are actually two different kinds of
2111 @code{fontSize} is a special property: it is equivalent to
2112 entering @code{\override ... #'font-size} for all pertinent
2113 objects. Since this is a common change, the special
2114 property (modified with @code{\set}) was created.
2120 @subsection 連想配列を変更する
2121 @translationof Modifying alists
2123 ユーザが変更可能なプロパティの中には、@c
2124 内部的には @emph{連想配列} として存在しているものがあります
2125 -- 連想配列は @emph{キー} と @emph{値} のペアの配列を保持します。@c
2129 '((@var{キー1} . @var{値1})
2130 (@var{キー2} . @var{値2})
2131 (@var{キー3} . @var{値3})
2135 ある連想配列がグラフィカル オブジェクト プロパティまたは
2136 @code{\paper} 変数である場合、@c
2137 その連想配列の個々のキーを、他のキーに影響を与えることなく、@c
2140 例えば、譜グループの中にある隣り合う譜間のスペースを減らすには、@c
2141 @code{StaffGrouper} グラフィカル オブジェクトの
2142 @code{staff-staff-spacing} プロパティを使用します。@c
2144 -- @code{basic-distance}, @code{minimum-distance},
2145 @code{padding}, それに @code{stretchability} --
2148 内部リファレンスの @qq{Backend} セクションでリストアップされています
2149 (@rinternals{StaffGrouper} を参照してください):
2152 '((basic-distance . 9)
2153 (minimum-distance . 7)
2155 (stretchability . 5))
2158 譜間のスペースを小さくする方法の 1 つは、@c
2159 @code{basic-distance} キーの値 (@code{9}) を
2160 @code{minimum-distance} キーの値 (@code{7}) 近くまで減らすことです。@c
2161 個々のキーを変更するには、@emph{ネストされた宣言} を使います:
2164 @lilypond[quote,verbatim]
2167 \new Staff { \clef treble c''1 }
2168 \new Staff { \clef bass c1 }
2172 \new PianoStaff \with {
2173 % this is the nested declaration
2174 \override StaffGrouper #'staff-staff-spacing #'basic-distance = #7
2176 \new Staff { \clef treble c''1 }
2177 \new Staff { \clef bass c1 }
2181 ネストされた宣言は、プロパティの他のキーに変更を加えることなく、@c
2182 指定されたキー (上の例では @code{basic-distance}) を更新します。
2184 今度は、譜を重ならない範囲でできる限り近づけたいとします。@c
2185 最も簡単な方法は、連想配列の 4 つのキーすべてを 0 にセットすることです。@c
2186 しかしながら、4 つのネストされた宣言を記述する必要はありません。@c
2187 1 つの宣言でプロパティを丸ごと再定義することができます:
2189 @lilypond[quote,verbatim]
2190 \new PianoStaff \with {
2191 \override StaffGrouper #'staff-staff-spacing =
2192 #'((basic-distance . 0)
2193 (minimum-distance . 0)
2195 (stretchability . 0))
2197 \new Staff { \clef treble c''1 }
2198 \new Staff { \clef bass c1 }
2202 連想配列の再定義でリストアップされなかったキーは、@c
2203 @emph{セットされなかった場合のデフォルト値} にリセットされます。@c
2204 @code{staff-staff-spacing} の場合、@c
2205 セットされなかったキーは 0 にリセットされます
2206 (@code{stretchability} は例外で、セットされなかった場合、@c
2207 @code{basic-distance} にリセットされます)。@c
2208 このため、以下の 2 つの宣言は等価です:
2211 \override StaffGrouper #'staff-staff-spacing =
2212 #'((basic-distance . 7))
2214 \override StaffGrouper #'staff-staff-spacing =
2215 #'((basic-distance . 7)
2216 (minimum-distance . 0)
2218 (stretchability . 7))
2221 連想配列の再定義でリストアップされなかったキーがあることにより、@c
2223 入力ファイルがコンパイルされるときに読み込まれた@c
2224 標準設定が (意図せずに) 削除される可能性があります。@c
2225 上の例では、@code{padding} と @code{minimum-distance} の標準設定
2226 (@file{scm/define-grobs.scm} で定義されます) は、@c
2227 @emph{セットされなかった場合のデフォルト値} (両方とも 0) にリセットされます。@c
2228 プロパティや (任意のサイズ) 連想配列を定義した場合、@c
2229 セットされなかったキー値はすべて @emph{セットされなかった場合のデフォルト値}
2231 そうすることを意図しているのでない限り、@c
2232 ネストされた宣言を用いてキー値を個々に更新する方が安全です。
2234 @warning{ネストされた宣言は、コンテキスト プロパティ連想配列
2235 (@code{beamExceptions}, @code{keySignature}, @code{timeSignatureSettings} 等)
2238 連想配列として丸ごと再定義するしかありません。}
2241 @node 役に立つコンセプトとプロパティ
2242 @section 役に立つコンセプトとプロパティ
2243 @translationof Useful concepts and properties
2260 @translationof Input modes
2262 入力ファイルの中に保持されている記譜を解釈する方法は、@c
2263 カレントの入力モードによって決定されます。
2267 このモードは @code{\chordmode} コマンドで有効になり、@c
2268 入力はコード記譜法の構文で解釈されるようになります。@c
2269 @ref{Chord notation} を参照してください。@c
2270 コードは、譜面上に音符として描画されます。
2272 コード モードは @code{\chords} コマンドでも有効になります。@c
2273 このコマンドは新たに @code{ChordNames} コンテキストも作成します。@c
2274 入力はコード記譜法の構文で解釈され、@c
2275 さらに @code{ChordNames} コンテキストの中にコード ネームとして描画されます。@c
2276 @ref{Printing chord names} を参照してください。
2280 このモードは @code{\drummode} コマンドで有効になり、@c
2281 入力はドラム記譜法の構文で解釈されるようになります。@c
2282 @ref{Basic percussion notation} を参照してください。
2284 また、ドラム モードは @code{\drums} コマンドでも有効になります。@c
2285 このモードも新たに @code{DrumStaff} コンテキストを作成し、@c
2286 コマンドの後に続く入力をドラム記譜法の構文で解釈して、@c
2287 ドラム譜上にドラム記号として描画します。@c
2288 @ref{Basic percussion notation} を参照してください。
2292 このモードは @code{\figuremode} コマンドで有効になり、@c
2293 入力は通奏低音の構文で解釈されるようになります。@c
2294 @ref{Entering figured bass} を参照してください。
2296 また、音型モードは @code{\figures} コマンドでも有効になります。@c
2297 このモードも新たに @code{FiguredBass} コンテキストを作成し、@c
2298 コマンドの後に続く入力を通奏低音の構文で解釈して、@c
2299 @code{FiguredBass} コンテキストの中に通奏低音記号として描画します。@c
2300 @ref{Introduction to figured bass} を参照してください。
2302 @strong{フレットとタブ モード}
2304 フレット記号とタブ記号を入力するための特別な入力モードはありません。
2306 タブ図を作成するには、音符モードで音符や和音を入力して、@c
2307 それらを @code{TabStaff} コンテキストの中に描画します。@c
2308 @ref{Default tablatures} を参照してください。
2310 譜の上にフレット図を作成するには、2 つの方法があります。@c
2311 @code{FretBoards} コンテキスト
2312 (@ref{Automatic fret diagrams} を参照してください) を用いるか、@c
2313 あるいは、音符の上に @code{\fret-diagram} コマンド
2314 (@ref{Fret diagram markups}) を用いてフレット図をマークアップとして@c
2319 このモードは @code{\lyricmode} コマンドで有効になり、@c
2320 入力はオプションで演奏時間を持つ歌詞音節として解釈され、@c
2322 通奏低音の構文で解釈されるようになります。@c
2323 @ref{Vocal music} を参照してください。
2325 また、歌詞モードは @code{\addlyrics} コマンドでも有効になります。@c
2326 このモードも新たに @code{Lyrics} コンテキストを作成し、@c
2327 暗黙的に @code{lyricsto} コマンドを作成します。@c
2328 @code{lyricsto} は、後に続く歌詞を、前にある音楽に関連付けします。
2332 このモードは @code{\markup} コマンドで有効になり、@c
2333 入力はマークアップの構文で解釈されるようになります。@c
2334 @ref{Text markup commands} を参照してください。
2336 @c silly work-around for texinfo broken-ness
2337 @c (@strong{Note...} causes a spurious cross-reference in Info)
2340 このモードはデフォルトのモードであり、@c
2341 @code{\notemode} コマンドで有効にすることもできます。@c
2342 入力はピッチ、演奏時間、マークアップなどとして解釈され、@c
2345 通常、音符モードを明示的に指定する必要はありません。@c
2347 -- 例えば、歌詞モード、和音モード、あるいは他のモードを使っていて、@c
2348 音符モードの構文でしか入力できないものを入力しようとしている場合 --
2349 では、音符モードを明示的に指定することが有用な場合があります。
2351 例えば、合唱曲で節ごとに強弱記号を指定するには、@c
2352 音符モードで入力して記号を解釈させる必要があります:
2354 @lilypond[verbatim,relative=2,quote]
2357 \notemode{\set stanza = \markup{ \dynamic f 1. } }
2361 \notemode{\set stanza = \markup{ \dynamic p 2. } }
2369 @translationof Direction and placement
2371 楽譜を写植しているとき、多くの要素の向きと配置には選択の余地があります。@c
2372 例えば、音符の符幹は上向きあるいは下向きにすることができ、@c
2373 歌詞、強弱記号、他の表現記号は譜の上あるいは下に配置することができ、@c
2374 テキストは左揃え、右揃え、あるいは中央揃えにすることができる、などです。@c
2375 これらの選択のほとんどは LilyPond によって自動的に決定されますが、@c
2376 強制的に向きや配置を指定することが望ましい場合もあります。
2378 @strong{アーティキュレーションの方向指示子}
2380 デフォルトでは、アーティキュレーションのいくつかの向きは常に上または下に@c
2381 なっています (例えば、強弱記号やフェルマータ)。@c
2382 一方、他のアーティキュレーションは、符幹の向きによって、@c
2383 向きが上下します (スラーやアクセントなど)。
2385 @c TODO Add table showing these
2387 アーティキュレーションの前に @emph{方向指示子} を置くことで、@c
2388 デフォルトの向きをオーバライドすることができます。@c
2389 3 つの方向指示子があります: @code{^} (@qq{上向き} を意味します)、@c
2390 @code{_} (@qq{下向き} を意味します)、@c
2391 それに @code{-} (@qq{デフォルトの向き} を意味します) です。@c
2392 通常、方向指示子は省略することができ、その場合は @code{-} と見なされます。@c
2393 しかしながら、以下のものの前には @strong{常に} 方向指示子を置く必要があります:
2396 @item @code{\tweak} コマンド
2397 @item @code{\markup} コマンド
2398 @item @code{\tag} コマンド
2399 @item 文字列マークアップ。例えば、-"string"
2400 @item 運指指示。例えば、@code{-1}
2401 @item アーティキュレーションの短縮記法。例えば、@code{-.}, @code{->}, @code{--}
2404 方向指示子は、その後にくる音符だけに効果を持ちます:
2406 @lilypond[verbatim,quote,relative=2]
2415 多くのレイアウト オブジェクトの位置や向きは、@c
2416 @code{direction} プロパティによって制御されます。
2418 @code{direction} プロパティの値は、@c
2419 @code{1} (@qq{上向き} あるいは @qq{上} を意味します)、@c
2420 @code{-1} (@qq{下向き} あるいは @qq{下} を意味します)
2422 記号 @code{UP} と @code{DOWN} は、@c
2423 それぞれ @code{1} と @code{-1} の代わりに用いることができます。@c
2425 @code{direction} を @code{0} あるいは @code{CENTER} にセットします。@c
2427 多くの場合で、向きを指定するための前置コマンドが存在しています。@c
2428 それらはすべて以下のような形式をとります:
2431 @code{\xxxUp}, @code{xxxDown}, @code{xxxNeutral}
2434 ここで、@code{xxxNeutral} は @qq{デフォルトの向きを使用する}
2436 @rlearning{譜表内部オブジェクト} を参照してください。
2439 -- 一般的な例としてはアルペジオしかありません --
2440 @code{direction} プロパティの値は、@c
2441 オブジェクトが親オブジェクトの左右どちらに配置されるかを指定します。
2442 この場合、@code{-1} あるいは @code{LEFT} は @qq{左側} を意味し、@c
2443 @code{1} あるいは @code{RIGHT} は @qq{右側} を意味します。@c
2444 @code{0} あるいは @code{CENTER} は、前のケースと同様に、@c
2445 @qq{デフォルトの向きを使用する} ことを意味します。
2448 These all have side-axis set to #X
2449 AmbitusAccidental - direction has no effect
2451 StanzaNumber - not tried
2452 TrillPitchAccidental - not tried
2453 TrillPitchGroup - not tried
2456 これらの指示子は、キャンセルされるまで効果を持ちます。
2458 @lilypond[verbatim,quote,relative=2]
2468 @node コンテキスト レイアウトの順序
2469 @subsection コンテキスト レイアウトの順序
2470 @translationof Context layout order
2472 @cindex contexts, layout order (コンテキスト レイアウトの順序)
2474 通常、コンテキストは、入力ファイルの中で出現した順番に、@c
2475 システムの上から下へと配置されます。@c
2476 コンテキストがネストされている場合、@c
2477 入力ファイルの中で内側にネストされたコンテキストが@c
2478 外側のコンテキストの @q{accepts} リストの中に含まれているのなら、@c
2479 外側のコンテキストの内部に配置されます。@c
2480 外側のコンテキストの @qq{accepts} リストに含まれていない場合、@c
2481 外側のコンテキストの内部ではなく、下に再配置されます。
2484 出現したコマンドを保持する適当なコンテキストが存在しない場合、@c
2485 コンテキストが暗黙的に作成されます。@c
2486 これは、予期しない譜やスコアを生み出す可能性があります。
2488 コンテキストが配置される順序や @qq{accepts} リストは変更することができます。@c
2489 @ref{コンテキストを揃える} を参照してください。
2493 @rprogram{余計な譜が表示される}
2497 @subsection 距離と距離の単位
2498 @translationof Distances and measurements
2500 @cindex distances, absolute (絶対距離)
2501 @cindex distances, scaled (相対距離)
2508 LilyPond における距離には 2 つのタイプがあります: 絶対距離と相対距離です。
2510 絶対距離は、マージン、インデント、それにその他の詳細なページ レイアウトを@c
2511 指定するために使用され、デフォルトではミリメートルで指定されます。
2512 距離は以下の単位で指定することもできます: @code{\mm}, @code{\cm},
2513 @code{\inch} (インチ), それに @code{\pt} (ポイント。1/73.27 インチ) です。@c
2514 また、ページ レイアウトにおける距離は、@c
2515 値の後ろに @code{\staff-space} を付けることにより、
2516 比率で指定することもできます (次の段落を参照してください)。@c
2517 ページ レイアウトについての詳細は、@c
2518 @ref{ページ レイアウト} に記述されています。
2520 相対距離は常に譜スペースを単位として指定されます
2521 -- 稀に、半譜スペースが使用されます。@c
2522 譜スペースは隣り合う 2 本の譜線間の距離です。@c
2523 グローバル譜サイズを設定することにより、@c
2524 デフォルト値をグローバルに変更することができます。@c
2525 また、@code{StaffSymbol} の @code{staff-space} プロパティを@c
2526 変更することにより、譜スペースをローカルにオーバライドすることもできます。@c
2527 相対距離は、グローバル譜サイズや @code{StaffSymbol} の @code{staff-space}
2528 プロパティのいずれかが変更されると、自動的に変更されます。@c
2529 しかしながら、フォントの比率はグローバル譜サイズが変更された場合にのみ、@c
2532 容易に描画される楽譜全体のサイズを変更することができます。@c
2533 グローバル譜サイズを設定するための手段については、@c
2534 @ref{譜サイズを設定する} を参照してください。
2538 楽譜のある部分だけの比率を変更したいのなら
2539 -- 例えば、オッシア セクションや脚注で --
2540 単純にグローバル譜サイズを変更するわけにはいきません。@c
2541 なぜなら、グローバル譜サイズを変更すると、楽譜全体が影響を受けるからです。@c
2542 そのような場合、@code{StaffSymbol} の @code{staff-space} プロパティと@c
2543 フォントのサイズをオーバライドすることにより、サイズを変更します。@c
2544 フォント サイズの変更を @code{staff-space} 単位の変更に変換するには、@c
2545 Scheme 関数 @code{magstep} を使用することができます。@c
2547 @rlearning{オブジェクトの長さと太さ} を参照してください。
2552 @rlearning{オブジェクトの長さと太さ}
2560 @subsection 譜記号プロパティ
2561 @translationof Staff symbol properties
2563 @cindex adjusting staff symbol (譜記号を調節する)
2564 @cindex drawing staff symbol (譜記号を描画する)
2565 @cindex staff symbol, setting of (譜記号の設定)
2567 @c TODO Extend or remove this section. See also NR 1.6.2 Staff symbol
2568 @c Need to think of uses for these properties. Eg 'line-positions
2569 @c is used in a snippet to thicken centre line.
2570 @c If retained, add @ref to here in 1.6.2 -td
2572 譜線の垂直位置と譜線の本数を同時に定義することができます。@c
2573 以下の例が示すように、音符の位置は譜線の位置には影響されません。
2575 @warning{@code{'line-positions} プロパティは @code{'line-count} を@c
2577 譜線の本数は、@code{'line-positions} の値リストの中にある要素数によって、@c
2580 @lilypond[verbatim,quote,relative=1]
2582 \override StaffSymbol #'line-positions = #'(7 3 0 -4 -6 -7)
2589 譜内部のオブジェクトのスペースは、この設定によって影響を受けません。
2591 @lilypond[verbatim,quote,relative=1]
2593 \override StaffSymbol #'width = #23
2601 @translationof Spanners
2603 多くの音楽記譜オブジェクトは、複数の音符あるいは複数の小節にまたがって、@c
2605 例としては、スラー、連桁、連譜の囲み、volta 繰り返しの囲み、クレッシェンド、@c
2606 トリル、それにグリッサンドがあります。@c
2607 そのようなオブジェクトは総称して @qq{スパナ} と呼ばれ、@c
2608 それらの見た目と振る舞いを制御するための特殊なプロパティを持ちます。@c
2609 これらのプロパティのいくつかは、すべてのスパナに共通しています。@c
2610 他のプロパティはスパナの部分集合に限定されています。
2612 すべてのスパナは @code{spanner-interface} をサポートします。@c
2613 いくつかのスパナ -- 2 つのオブジェクトの間に直線を描くもの -- は、さらに、@c
2614 @code{line-spanner-interface} をサポートします。
2617 @unnumberedsubsubsec @code{spanner-interface} を使用する
2620 いくつかのスパナに適用される 2 つのプロパティを提供します。
2622 @strong{@i{@code{minimum-length} プロパティ}}
2624 スパナの最短の長さは、@code{minimum-length} プロパティによって指定されます。@c
2625 通常、このプロパティを増加させると、@c
2626 スパナの両端の間にある音符の間隔は増加します。@c
2627 しかしながら、このオーバライドは多くのスパナで効果を持ちません。@c
2628 なぜなら、それらの長さは他の要素によって決定されるからです。@c
2629 以下に効果を持つ例を 2, 3 示します。
2639 Works as long as callback is made:
2643 Works not at all for:
2653 @lilypond[verbatim,quote,relative=2]
2657 -\tweak #'minimum-length #5
2662 @lilypond[verbatim,quote,relative=2]
2664 \compressFullBarRests
2667 \once \override MultiMeasureRest #'minimum-length = #20
2673 @lilypond[verbatim,quote,relative=2]
2676 \override Hairpin #'minimum-length = #20
2680 さらに、このオーバライドはスラーとフレージング スラーの長さを@c
2683 @lilypond[verbatim,quote,relative=2]
2686 -\tweak #'minimum-length #5
2691 -\tweak #'minimum-length #5
2695 いくつかのレイアウト オブジェクトでは、@c
2696 @code{minimum-length} プロパティは、@c
2697 @code{set-spacing-rods} プロシージャが明示的に呼び出された場合にのみ@c
2699 このプロシージャを呼び出すには、@code{springs-and-rods} プロパティに@c
2700 @code{ly:spanner::set-spacing-rods} をセットしておく必要があります。@c
2702 @code{springs-and-rods} プロパティが設定されていない限り、@c
2706 @lilypond[verbatim,quote,relative=1]
2711 \once \override Glissando #'minimum-length = #20
2714 % 以下の両方のオーバライドが存在する場合にのみ、効果を持ちます
2715 \once \override Glissando #'minimum-length = #20
2716 \once \override Glissando #'springs-and-rods = #ly:spanner::set-spacing-rods
2720 @code{Beam} オブジェクトでも同じことが言えます:
2723 @lilypond[verbatim,quote,relative=1]
2725 \once \override Beam #'minimum-length = #20
2728 % 以下の両方のオーバライドが存在する場合にのみ、効果を持ちます
2729 \once \override Beam #'minimum-length = #20
2730 \once \override Beam #'springs-and-rods = #ly:spanner::set-spacing-rods
2735 @strong{@i{@code{to-barline} プロパティ}}
2737 @code{spanner-interface} の 2 番目に有用なプロパティは
2738 @code{to-barline} です。@c
2739 デフォルトではこのプロパティは真であり、@c
2740 小節の最初の音符のところで終了するヘアピンや他のスパナは@c
2741 直前の小節線のところで終了させられます。@c
2742 偽に設定すると、スパナは小節線を越えて、音符のところで終了します:
2744 @lilypond[verbatim,quote,relative=2]
2745 a \< a a a a \! a a a \break
2746 \override Hairpin #'to-barline = ##f
2747 a \< a a a a \! a a a
2750 このプロパティはすべてのスパナに対して効果を持つわけではありません。@c
2751 例えば、スラーやフレージング スラー、@c
2752 あるいは小節線で終了させることに意味が無い他のスパナに対して、@c
2753 このプロパティを @code{#t} に設定しても効果がありません。
2756 @unnumberedsubsubsec @code{line-spanner-interface} を使用する
2758 @code{line-spanner-interface} をサポートするオブジェクトには@c
2762 @item @code{DynamicTextSpanner}
2763 @item @code{Glissando}
2764 @item @code{TextSpanner}
2765 @item @code{TrillSpanner}
2766 @item @code{VoiceFollower}
2769 これらのスパナのステンシルを描画する責任を持つルーチンは
2770 @code{ly:line-interface::print} です。@c
2771 このルーチンはスパナの両端の位置を綿密に決定し、@c
2772 求めに応じたスタイルでそれらの間に線を描きます@c
2773 スパナの両端の位置はオンザフライ (その場、その時々) で算出されますが、@c
2774 それらの Y 座標をオーバライドすることができます。@c
2776 プロパティ階層内で 2 階層下にネストされていますが、@c
2777 この @code{\override} コマンドは非常にシンプルです:
2779 @lilypond[relative=2,quote,verbatim]
2781 \once \override Glissando #'(bound-details left Y) = #3
2782 \once \override Glissando #'(bound-details right Y) = #-2
2786 @code{Y} プロパティの単位は @code{staff-space} であり、@c
2788 グリッサンドでは、スパナの両端は各符頭の中心であり、@c
2789 @code{Y} はそれらの点を上下させます。
2791 @code{Y} が設定されていない場合、@c
2792 値はスパナの両端の垂直位置から算出されます。
2794 改行の場合、終点の @code{Y} の値は @code{bound-details} の@c
2795 部分リスト @code{left-broken} や @code{right-broken} のによって指定されます。@c
2798 @lilypond[relative=2,ragged-right,verbatim,fragment]
2799 \override Glissando #'breakable = ##t
2800 \override Glissando #'(bound-details right-broken Y) = #-3
2801 c1 \glissando \break
2806 @code{bound-details} プロパティの部分リスト @code{left} や @code{right} の@c
2807 下位プロパティのいくつかは、@code{Y} と同じ方法で変更することができます:
2812 譜の中央線からの @code{staff-space} オフセットで、設定します。@c
2813 デフォルトでは、終点オブジェクトの中心です。@c
2814 ですから、グリッサンドは符頭の中心に向かって進みます。
2816 水平方向に広がるスパナ -- テキスト スパナやトリル スパナなど --
2817 では、この値は 0 に固定されています。
2820 スパナのラインがオブジェクトの左右どちらから始まり、終わるのかを決定します。@c
2821 @code{-1} (あるいは @code{LEFT}) であれば、@c
2822 ラインは符頭の左側から開始あるいは終了します。
2826 通常、オンザフライ (その場、その時々) で算出され、@c
2827 これをオーバライドしてもあまり意味がありません。
2830 ライン スパナは開始点や終了点で記号を持つ場合があり、@c
2831 その記号はこのサブ プロパティに保持されています。@c
2832 このサブ プロパティは内部で使用するためのものです。@c
2833 このサブ プロパティの代わりに @code{text} を使用することを推奨します。
2836 ステンシルを作成するために評価されるマークアップです。@c
2837 水平スパナに @i{cresc.}, @i{tr} それに他のテキストを配置するために使用されます。
2839 @lilypond[quote,ragged-right,fragment,relative=2,verbatim]
2840 \override TextSpanner #'(bound-details left text)
2841 = \markup { \small \bold Slower }
2842 c2\startTextSpan b c a\stopTextSpan
2845 @item stencil-align-dir-y
2846 @item stencil-offset
2848 ステンシルは、@code{X} と @code{Y} サブ プロパティで定義されたとおりに、@c
2849 ラインに中央揃えで、終点に配置されます。@c
2850 @code{stencil-align-dir-y} あるいは @code{stencil-offset} の@c
2854 @lilypond[relative=1,fragment,verbatim]
2855 \override TextSpanner
2856 #'(bound-details left stencil-align-dir-y) = #-2
2857 \override TextSpanner
2858 #'(bound-details right stencil-align-dir-y) = #UP
2860 \override TextSpanner
2861 #'(bound-details left text) = #"ggg"
2862 \override TextSpanner
2863 #'(bound-details right text) = #"hhh"
2864 c4^\startTextSpan c c c \stopTextSpan
2868 負の値はテキストを @emph{上げる} ということに注意してください。@c
2869 なぜなら、@code{-1} あるいは @code{DOWN} は@c
2870 テキストの @emph{下端} をスパナ ラインに揃え、
2871 @code{1} あるいは @code{UP} は@c
2872 テキストの @emph{上端} をスパナ ラインに揃えるからです。
2875 このサブ プロパティに @code{#t} をセットするとラインの終点に矢印が描かれます。
2878 このサブ プロパティはラインの終点と実際の終点の間のスペースを制御します。@c
2879 パディングがなければ、グリッサンドは両端の符頭の中心から描かれます。
2883 音楽関数 @code{\endSpanners} は@c
2884 直後の音符から始まるスパナをすぐに終了させます。@c
2885 ちょうど 1 音符分でスパナを終了させますが、@c
2886 @code{to-barline} が真で、かつ、次の音符の前に小節線がある場合は@c
2887 その小節線のところでスパナを終了させます。
2889 @lilypond[verbatim,quote,ragged-right,relative=2,fragment]
2891 c2 \startTextSpan c2 c2
2896 @code{\endSpanners} を使用している場合、@c
2897 @code{\startTextSpan} を @code{\endTextSpan} で閉じる必要はなく、@c
2898 ヘアピンを @code{\!} で閉じる必要もありません。
2903 @rinternals{TextSpanner},
2904 @rinternals{Glissando},
2905 @rinternals{VoiceFollower},
2906 @rinternals{TrillSpanner},
2907 @rinternals{line-spanner-interface}
2911 @subsection オブジェクトの可視性
2912 @translationof Visibility of objects
2914 @cindex objects, visibility of (オブジェクトの可視性)
2915 @cindex grobs, visibility of (グラフィカル オブジェクトの可視性)
2916 @cindex visibility of objects (オブジェクトの可視性)
2918 レイアウト オブジェクトの可視性を制御する主な方法は 4 つあります:
2919 オブジェクトのステンシルを削除する方法、オブジェクトを透明にする方法、@c
2920 オブジェクトの色を白にする方法、あるいは、@c
2921 オブジェクトの @code{break-visibility} プロパティをオーバライドする方法です。
2922 最初の 3 つの方法はすべてのレイアウト オブジェクトに適用されますが、@c
2923 最後の方法はいくつかの -- @emph{改行可能な} オブジェクト --
2925 学習マニュアルでは、これら 4 つのテクニックについて紹介しています。@c
2926 @rlearning{オブジェクトの可視性と色} を参照してください。
2928 さらに、特定のレイアウト オブジェクト特有のテクニックがいくつかあります。@c
2929 それらについては、特別な考慮でカバーされています。
2935 * break-visibility を用いる::
2941 @unnumberedsubsubsec ステンシルを削除する
2942 @translationof Removing the stencil
2944 @cindex stencil, removing (ステンシルを削除する)
2946 レウアウト オブジェクトはそれぞれステンシル プロパティを持ちます。@c
2948 このプロパティはそのオブジェクトを描画する特殊な関数にセットされています。@c
2949 このプロパティが @code{#f} にオーバライドされた場合、@c
2950 関数は呼び出されず、そのオブジェクトは描画されません。@c
2951 @code{\rever} でデフォルトの動作に戻すことができます。
2953 @lilypond[quote,verbatim,relative=1]
2955 \override Score.BarLine #'stencil = ##f
2957 \revert Score.BarLine #'stencil
2962 @unnumberedsubsubsec オブジェクトを透明にする
2963 @translationof Making objects transparent
2965 @cindex transparent, making objects (オブジェクトを透明にする)
2967 レイアウト オブジェクトはそれぞれ @code{transparent} プロパティを持っていて、@c
2968 デフォルトでは @code{#f} にセットされています。@c
2969 @code{#t} にセットされると、そのオブジェクトはスペースを占めたままですが、@c
2972 @lilypond[quote,verbatim,relative=2]
2974 \once \override NoteHead #'transparent = ##t
2979 @unnumberedsubsubsec オブジェクトを白で描く
2980 @translationof Painting objects white
2982 @cindex objects, coloring (オブジェクトに色を付ける)
2983 @cindex coloring objects (オブジェクトに色を付ける)
2984 @cindex layers (レイヤ)
2985 @cindex printing order (描画の順番)
2986 @cindex overwriting objects (オブジェクトを上書きする)
2987 @cindex objects, overwriting (オブジェクトを上書きする)
2988 @cindex grobs, overwriting (グラフィカル オブジェクトを上書きする)
2990 レイアウト オブジェクトはそれぞれ @code{color} プロパティを持っていて、@c
2991 デフォルトでは @code{black} にセットされています。@c
2992 このプロパティが @code{white} にセットされてると、@c
2993 そのオブジェクトは白い背景と区別が付かなくなります。@c
2994 しかしながら、そのオブジェクトが他のオブジェクトと交差している場合、@c
2995 交差している場所の色はオブジェクトの描画順序によって決定されます。@c
2997 白いオブジェクトの画像が幽霊のように浮かび上がることがあります:
2999 @lilypond[quote,verbatim,relative=2]
3000 \override Staff.Clef #'color = #white
3004 オブジェクトの描画順序を変更することにより、これを回避することができます。@c
3005 すべてのレイアウト オブジェクトは @code{layer} プロパティを持っており、@c
3006 このプロパティには整数がセットされています。@c
3007 より小さな値の @code{layer} を持つオブジェクトが最初に描画され、@c
3008 より大きな値の @code{layer} を持つオブジェクトが後になってから描画されます。@c
3010 より大きな値を持つオブジェクトがより小さな値を持つオブジェクトを上書きします。@c
3012 たいていのオブジェクトの @code{layer} には @code{1} が代入されています。@c
3014 -- @code{StaffSymbol} や @code{BarLine} など --
3015 には @code{0} が代入されています。@c
3016 同じ値の @code{layer} を持つオブジェクトを描画する順番は不確定です。
3019 (この @code{layer} のデフォルト値は @code{1} です)
3021 (この @code{layer} のデフォルト値は @code{0} です)
3023 そのため、音部記号は譜線を上書きしています。@c
3024 これを変更するには、@code{Clef} オブジェクトの @code{layer} に@c
3025 より小さな値 -- 例えば、@code{-1} -- を与えて、@c
3026 音部記号を先に描画させる必要があります:
3028 @lilypond[quote,verbatim,relative=2]
3029 \override Staff.Clef #'color = #white
3030 \override Staff.Clef #'layer = #-1
3034 @node break-visibility を用いる
3035 @unnumberedsubsubsec break-visibility を用いる
3036 @translationof Using break-visibility
3038 @c TODO Add making other objects breakable
3040 @cindex break-visibility
3042 たいていのレイアウト オブジェクトは 1 回だけ描画されます。@c
3043 しかしながら、小節線、音部記号、拍子記号、それに調号などのオブジェクトは、@c
3044 改行が起こると 2 回描画する必要があります
3045 -- 行の最後で 1 回、次の行の最初でもう 1 回。@c
3046 そのようなオブジェクトは @emph{改行可能} と呼ばれ、@c
3047 それらのオブジェクトが描画される可能性がある 3 つの場所
3048 -- 行の先頭、行の途中 (それらが変更された場合)、@c
3049 それに、行の最後 (そこで変更が行われた場合) --
3050 における可視性を制御する @code{break-visibility} プロパティを持ちます。
3052 例えば、デフォルトでは拍子記号は最初の行の先頭で描画されますが、@c
3053 変更されない限り他の場所には描画されません。@c
3054 変更された場合、拍子記号は変更が行われた場所に描画されます。@c
3055 この変更が行の最後で行われた場合、新しい拍子記号は次の行の先頭に描画され、@c
3056 その前の行の最後にも忠告の拍子記号が描画されます。
3058 この振る舞いは @code{break-visibility} プロパティによって制御されます。@c
3060 @c Leave this ref on a newline - formats incorrectly otherwise -td
3061 @rlearning{オブジェクトの可視性と色}
3063 このプロパティは 3 つのブール値からなるベクトルをとり、@c
3064 順に、そのオブジェクトが行の最後で描画されるかどうか、@c
3066 そして、行の先頭で描画されるかどうかを決定します。@c
3067 より正確には、改行の前、改行がない場合、改行の後です。
3069 @code{break-visibility} プロパティによって制御する代わりに、@c
3070 これら 8 通りの組み合わせを @file{scm/output-lib.scm} で定義されている@c
3071 定義済み関数によって指定することもできます。@c
3072 このファイルの中で、最後の 3 列がその列のヘッダで示される場所での@c
3075 @multitable {@code{begin-of-line-invisible}} {@code{'#(#t #t #t)}} {yes} {yes} {yes}
3076 @headitem 関数 @tab ベクトル @tab 改行前 @tab 改行なし @tab 改行後
3078 @item @code{all-visible} @tab @code{'#(#t #t #t)} @tab yes @tab yes @tab yes
3079 @item @code{begin-of-line-visible} @tab @code{'#(#f #f #t)} @tab no @tab no @tab yes
3080 @item @code{center-visible} @tab @code{'#(#f #t #f)} @tab no @tab yes @tab no
3081 @item @code{end-of-line-visible} @tab @code{'#(#t #f #f)} @tab yes @tab no @tab no
3082 @item @code{begin-of-line-invisible} @tab @code{'#(#t #t #f)} @tab yes @tab yes @tab no
3083 @item @code{center-invisible} @tab @code{'#(#t #f #t)} @tab yes @tab no @tab yes
3084 @item @code{end-of-line-invisible} @tab @code{'#(#f #t #t)} @tab no @tab yes @tab yes
3085 @item @code{all-invisible} @tab @code{'#(#f #f #f)} @tab no @tab no @tab no
3088 @code{break-visibility} のデフォルト設定は@c
3089 レイアウト オブジェクトによって異なります。@c
3090 以下の表は、@code{break-visibility} によって影響をうける@c
3091 すべてのレイアウト オブジェクトと、そのプロパティのデフォルト設定を示しています:
3093 @multitable @columnfractions .3 .3 .4
3095 @headitem レイアウト オブジェクト @tab 通常のコンテキスト @tab デフォルト設定
3097 @c omit Ambitus as it appears not to be affected by break-visibility -td
3098 @c @item @code{Ambitus} @tab as specified @tab @code{begin-of-line-visible}
3099 @item @code{BarLine} @tab @code{Score} @tab calculated
3100 @item @code{BarNumber} @tab @code{Score} @tab @code{begin-of-line-visible}
3101 @c omit the following item until it can be explained -td
3102 @c @item @code{BreakAlignGroup} @tab @code{Score} @tab calculated
3103 @item @code{BreathingSign} @tab @code{Voice} @tab @code{begin-of-line-invisible}
3104 @item @code{Clef} @tab @code{Staff} @tab @code{begin-of-line-visible}
3105 @item @code{Custos} @tab @code{Staff} @tab @code{end-of-line-visible}
3106 @item @code{DoublePercentRepeat} @tab @code{Voice} @tab @code{begin-of-line-invisible}
3107 @c omit KeyCancellation until it can be explained -td
3108 @c @item @code{KeyCancellation} @tab ?? @tab @code{begin-of-line-invisible}
3109 @item @code{KeySignature} @tab @code{Staff} @tab @code{begin-of-line-visible}
3110 @c omit LeftEdge until it can be explained -td
3111 @c @item @code{LeftEdge} @tab @code{Score} @tab @code{center-invisible}
3112 @item @code{OctavateEight} @tab @code{Staff} @tab @code{begin-of-line-visible}
3113 @item @code{RehearsalMark} @tab @code{Score} @tab @code{end-of-line-invisible}
3114 @item @code{TimeSignature} @tab @code{Staff} @tab @code{all-visible}
3118 以下の例は、小節線の可視性を制御するベクトルの使用方法を示しています:
3121 @lilypond[quote,verbatim,relative=1,ragged-right]
3124 % カレント行の最後で小節線を削除します
3125 \once \override Score.BarLine #'break-visibility = #'#(#f #t #t)
3131 @code{break-visibility} をオーバライドするために使用される@c
3132 ベクトルの要素 3 つをすべて記述する必要がありますが、@c
3133 それらすべてが各レイアウト オブジェクトに対して効果を持つわけではなく、@c
3134 組み合わせによってはエラーになる場合もあります。@c
3136 even give errors. The following limitations apply:
3139 @item 小節線を行の先頭に描画することはできません。
3140 @item 小節番号は 1 から始まるのでなければ、@c
3141 最初の行の先頭に描画することはできません。
3142 @item 音部記号 -- 以下を参照してください
3143 @item 2 重線のパーセント繰り返しはすべて描画するか、@c
3145 描画するには @code{begin-of-line-invisible} を用い、@c
3146 描画しないのなら @code{all-invisible} を用います。
3147 @item Key signature -- 以下を参照してください
3148 @item OctavateEight -- 以下を参照してください
3152 @unnumberedsubsubsec 特別な考慮を必要とするもの
3153 @translationof Special considerations
3155 @strong{@emph{明示的な変更の後の可視性}}
3157 @cindex key signature, visibility following explicit change (明示的な変更の後の調号の可視性)
3158 @cindex explicitKeySignatureVisibility
3159 @cindex clef, visibility following explicit change (明示的な変更の後の音部記号の可視性)
3160 @cindex explicitClefVisibility
3162 @code{break-visibility} プロパティが調号の可視性と音部記号の変更を@c
3163 制御するのは、行の先頭 -- つまり、改行の後 -- においてだけです。@c
3164 行の途中や終わりでの明示的な調の変更や音部記号の変更の後に出現する@c
3165 調合や音部記号の可視性には効果を持ちません。@c
3166 以下の例では、@code{all-invisible} がセットされていますが、@c
3167 B フラット メジャーへの明示的な変更の後に出現する調号は可視のままです。
3170 @lilypond[quote,verbatim,relative=1,ragged-right]
3174 \override Staff.KeySignature #'break-visibility = #all-invisible
3182 そのような明示的な調号や音部記号の変更の可視性は
3183 @code{explicitKeySignatureVisibility} プロパティや
3184 @code{explicitClefVisibility} プロパティによって制御されます。@c
3185 これらは @code{break-visibility} プロパティと等価であり、@c
3186 どちらも @code{break-visibility} と同様に 3 つのブール値からなるベクトルか@c
3187 上でリストアップした定義済み関数をとります。@c
3188 どちらも @code{Staff} コンテキストのプロパティであり、@c
3189 レイアウト オブジェクト自体のプロパティではありません。@c
3190 ですから、これらは @code{\set} コマンドでセットします。@c
3191 どちらもデフォルトでは @code{all-visible} がセットされています。@c
3192 これらのプロパティは明示的な変更の結果として生じる@c
3193 調号と音部記号の可視性だけを制御し、@c
3194 行の先頭での調号や音部記号には効果を持ちませんので、@c
3195 オブジェクトを削除するには適切な @code{break-visibility}
3198 @lilypond[quote,verbatim,relative=1,ragged-right]
3201 \set Staff.explicitKeySignatureVisibility = #all-invisible
3202 \override Staff.KeySignature #'break-visibility = #all-invisible
3209 @strong{@emph{忠告の臨時記号の可視性}}
3211 明示的な調の変更で描画される忠告の臨時記号を削除するには、@c
3212 @code{Staff} コンテキスト プロパティ @code{printKeyCancellation} に
3215 @lilypond[quote,verbatim,relative=1,ragged-right]
3218 \set Staff.explicitKeySignatureVisibility = #all-invisible
3219 \set Staff.printKeyCancellation = ##f
3220 \override Staff.KeySignature #'break-visibility = #all-invisible
3227 このオーバライドによって、調の変更を示す臨時記号だけが残ります。
3229 @c TODO Add visibility of cautionary accidentals before notes
3231 @strong{@emph{自動小節線}}
3233 @cindex automaticBars
3234 @cindex bar lines, suppressing (小節線を消す)
3237 @code{Score} コンテキストの @code{automaticBars} プロパティを@c
3238 設定することにより、小節線の描画を Off にすることもできます。@c
3239 @code{#f} をセットされた場合、小節線は自動的には描画されなくなり、@c
3240 @code{\bar} コマンドで明示的に作成しなければならなくなります。@c
3241 定義済みコマンド @code{\cadenzaOn} とは異なり、小節数はカウントされ続けます。@c
3242 後になってこのプロパティに @code{#t} がセットされると、@c
3243 このカウントに従って小節線の生成が再開されます。@c
3244 @code{#f} がセットされている場合、@c
3245 改行が起こりえるのは明示的な @code{\bar} コマンドがある場所でだけになります。
3249 @strong{@emph{オクターブ移調付きの音部記号}}
3251 @cindex octavated clefs, visibility of (オクターブ移調付きの音部記号の可視性)
3252 @cindex visibility of octavated clefs (オクターブ移調付きの音部記号の可視性)
3253 @cindex clefs, visibility of octavation (オクターブ移調付きの音部記号の可視性)
3255 オクターブ移調付きの音部記号上の小さなオクターブ記号は
3256 @code{OctavateEight} レイアウト オブジェクトによって作り出されます。@c
3258 @code{Clef} オブジェクトの可視性とは独立して制御されます。@c
3259 そのため、各行の先頭においてそのような音部記号を完全に消そうとするなら、@c
3260 @code{Clef} オブジェクトと @code{OctavateEight} オブジェクトの両方に対して@c
3261 必要な @code{break-visibility} のオーバライドを行う必要があります。
3264 @code{explicitClefVisibility} プロパティが@c
3265 音部記号とそれに関連するオクターブ記号の両方を制御します。
3270 @rlearning{オブジェクトの可視性と色}
3274 @subsection ライン スタイル
3275 @translationof Line styles
3278 -- 例えば、@i{rallentando}, @i{accelerando} それに @i{trills} など --
3280 線で (点線や波線の場合もあります) でいくつもの小節にわたって広がります。
3282 これらはすべてグリッサンドと同じルーチンを用いてテキストと線を描きます。@c
3283 そのため、それらの振る舞いの調整も同じように行います。@c
3284 これらはスパナによって実現され、スパナを描くルーチンは
3285 @code{ly:line-interface::print} です。@c
3286 このルーチンは 2 つの @i{スパン ポイント} の位置を決定し、@c
3287 要求されたスタイルに応じてそれら 2 点の間に線を描きます。
3289 利用可能なライン スタイルと、それらをどのように調整するかを示す例を挙げます。
3291 @lilypond[relative=2,ragged-right,verbatim,fragment]
3293 \once \override Glissando #'style = #'dashed-line
3295 \override Glissando #'style = #'dotted-line
3297 \override Glissando #'style = #'zigzag
3299 \override Glissando #'style = #'trill
3303 スパナの終点の位置は各グラフィック オブジェクトごとに@c
3304 オンザフライ (その場、その時々) で計算されますが、@c
3305 それらをオーバライドすることもできます:
3308 @lilypond[relative=2,ragged-right,verbatim,quote]
3310 \once \override Glissando #'(bound-details right Y) = #-2
3314 グリッサンドの終点の @code{Y} には @code{-2} がセットされています。@c
3315 @code{right} の代わりに @code{left} を指定することにより、@c
3316 始点も同じように調整することができます。
3318 @code{Y} がセットされていない場合、@c
3319 その値はスパナが取り付けられるポイントの垂直位置から算出されます。
3321 スパナに他の調整を行うことも可能です。@c
3322 詳細は @ref{スパナ} を参照してください。
3326 @subsection オブジェクトを回転させる
3327 @translationof Rotating objects
3329 レイアウト オブジェクトとマークアップ テキストの要素はどちらも@c
3330 任意のポイントを中心にして任意の角度で回転させることができます。@c
3331 しかしながら、回転させる方法はまったく異なります。
3334 * レイアウト オブジェクトを回転させる::
3338 @node レイアウト オブジェクトを回転させる
3339 @unnumberedsubsubsec レイアウト オブジェクトを回転させる
3340 @translationof Rotating layout objects
3342 @cindex rotating objects (オブジェクトを回転させる)
3343 @cindex objects, rotating (オブジェクトを回転させる)
3345 @code{grob-interface} をサポートするすべてのレイアウト オブジェクトは、@c
3346 それらのオブジェクトの @code{rotation} プロパティを設定することにより、@c
3348 これは 3 要素のリストをとります: 反時計回りの回転の角度、@c
3349 オブジェクトの参照ポイントからの相対座標 x と y
3350 (この座標が回転の中心になります) です。@c
3351 回転の角度は @q{°}で指定し、座標は譜スペースで指定します。
3353 回転の角度と回転の中心座標は、トライ&エラーで決定する必要があります。
3355 @cindex hairpins, angled (回転させられたヘアピン)
3356 @cindex angled hairpins (回転させられたヘアピン)
3358 レイアウト オブジェクトを回転させることが有用な状況はあまりありません。@c
3359 以下の例は、有用であるかもしれないシチュエーションの 1 つを示しています:
3361 @lilypond[quote,verbatim,relative=1]
3363 \override Hairpin #'rotation = #'(20 -1 0)
3368 @unnumberedsubsubsec マークアップを回転させる
3369 @translationof Rotating markup
3371 すべてのマークアップ テキストは、@code{\rotate} コマンドを前に置くことにより、@c
3372 任意の角度に回転させることができます。@c
3373 このコマンドは 2 つの引数をとります: 反時計回りの回転の角度 @q{°} と、@c
3376 テキストの領域は回転させられるテキストの四隅になります。@c
3377 以下の例では、自動衝突回避を不可にするために@c
3378 テキストの @code{outside-staff-priority} プロパティに @code{#f} を@c
3380 そうしなければテキストのいくつかは高く押し上げられてしまいます。
3382 @lilypond[quote,verbatim,relative=1]
3383 \override TextScript #'outside-staff-priority = ##f
3384 g4^\markup { \rotate #30 "a G" }
3385 b^\markup { \rotate #30 "a B" }
3386 des^\markup { \rotate #30 "a D-Flat" }
3387 fis^\markup { \rotate #30 "an F-Sharp" }
3393 @translationof Advanced tweaks
3396 楽譜の見た目を細かく調節するためのさまざまなアプローチについて議論します。
3400 * グラフィカル オブジェクトを垂直方向にグループ化する::
3408 @rlearning{出力を調整する},
3416 @file{scm/define-grobs.scm}
3419 @rlsr{Tweaks and overrides}
3422 @rextend{Interfaces for programmers}
3425 @rinternals{All layout objects}
3429 @subsection オブジェクトを揃える
3430 @translationof Aligning objects
3432 @code{self-alignment-interface} と/あるいは @code{side-position-interface} を@c
3433 サポートするグラフィカル オブジェクトは、@c
3434 さまざまな形式で配置済みのオブジェクトに揃えることができます。@c
3435 そのようなオブジェクトのリストは、@rinternals{self-alignment-interface} と
3436 @rinternals{side-position-interface} を参照してください。@c
3438 すべてのグラフィカル オブジェクトは参照ポイント、水平方向の広がり、@c
3441 参照ポイントから左端と右端までの距離を意味する数値のペアであり、@c
3444 参照ポイントから下端と上端までの距離を意味する数値のペアであり、@c
3447 あるオブジェクトの譜面上の位置は、@code{X-offset} プロパティと
3448 @code{Y-offset} プロパティの値によって与えられます。@c
3449 @code{X-offset} の値は、親オブジェクトの参照ポイントの X 座標からの@c
3451 @code{Y-offset} の値は、譜の中央線からの距離を意味します。@c
3452 @code{X-offset} と @code{Y-offset} の値は直接設定されることもありますし、@c
3453 いくつかの形式で親オブジェクトと揃えるために@c
3454 プロシージャによって算出されることもあります。
3456 @c positioning considerations: 配置のための考慮 -> 配置規則
3457 @warning{多くのオブジェクトは特殊な配置規則を持っています。@c
3458 そのため、そのオブジェクトが @code{self-alignment-interface} を@c
3460 @code{X-offset} あるいは @code{Y-offset} の設定は無視されたり、@c
3463 例えば、臨時記号は @code{Y-offset} を設定することにより@c
3464 垂直方向の位置を変更することができますが、@code{X-offset} は効果を持ちません。
3466 リハーサル記号は、小節線、音部記号、拍子記号それに調号などの@c
3467 改行可能なオブジェクトに揃えることができます。@c
3468 リハーサル記号をそのようなオブジェクトに合わせて配置するために、@c
3469 @code{break-aligned-interface} の中に特別なプロパティがあります。
3472 @ref{break-alignable-interface を使用する},
3473 @rextend{Callback functions}
3476 * X-offset と Y-offset を直接設定する::
3477 * side-position-interface を使用する::
3478 * self-alignment-interface を使用する::
3479 * break-alignable-interface を使用する::
3482 @node X-offset と Y-offset を直接設定する
3483 @unnumberedsubsubsec @code{X-offset} と @code{Y-offset} を直接設定する
3484 @translationof Setting X-offset and Y-offset directly
3486 多くのオブジェクトの @code{X-offset} プロパティと @code{Y-offset} プロパティに@c
3488 以下の例は、3 つの音符を示していて、1 つはデフォルト配置の運指記号を持ち、@c
3489 他の 2 つの運指記号は @code{X-offset} と @code{Y-offset} が変更されています。
3491 @lilypond[verbatim,quote,relative=2]
3494 -\tweak #'X-offset #0
3495 -\tweak #'Y-offset #0
3498 -\tweak #'X-offset #-1
3499 -\tweak #'Y-offset #1
3505 @node side-position-interface を使用する
3506 @unnumberedsubsubsec @code{side-position-interface} を使用する
3507 @translationof Using the @code{side-position-interface}
3509 @code{side-position-interface} をサポートするオブジェクトは、@c
3510 その親オブジェクトの隣に配置することができ、@c
3512 それら 2 つのオブジェクトの指定された端をくっつけることができます。@c
3513 オブジェクトを親オブジェクトの上、下、右、あるいは左に配置することができます。@c
3514 親オブジェクトを指定することはできません:
3515 親オブジェクトは入力ストリームの中での要素の順序によって決定されます。@c
3516 たいていのオブジェクトの親オブジェクトは、@c
3517 そのオブジェクトに関連する符頭となります。
3519 @code{side-axis} プロパティと @code{direction} プロパティの値は、@c
3520 以下のように、オブジェクトが配置される場所を決定します:
3522 @c TODO add an example of each to the table
3524 @multitable @columnfractions .3 .3 .3
3525 @headitem @code{side-axis} @tab @code{direction} @tab
3526 @headitem property @tab property @tab Placement
3528 @item @code{0} @tab @code{-1} @tab 左
3529 @item @code{0} @tab @code{1} @tab 右
3530 @item @code{1} @tab @code{-1} @tab 下
3531 @item @code{1} @tab @code{1} @tab 上
3535 @code{side-axis} が @code{0} である場合、@code{X-offset} には@c
3536 プロシージャ @code{ly:side-position-interface::x-aligned-side} を@c
3538 このプロシージャは、@code{direction} の値に基づいて@c
3539 親オブジェクトの左あるいは右にオブジェクトを配置するための適切な値を
3540 @code{X-offset} に返します。
3542 @code{side-axis} が @code{1} である場合、@code{Y-offset} には@c
3543 プロシージャ @code{ly:side-position-interface::y-aligned-side} を@c
3545 このプロシージャは、@code{direction} の値に基づいて@c
3546 親オブジェクトの上あるいは下にオブジェクトを配置するための適切な値を
3547 @code{Y-offset} に返します。
3549 @c TODO Add examples
3551 @node self-alignment-interface を使用する
3552 @unnumberedsubsubsec @code{self-alignment-interface} を使用する
3553 @translationof Using the @code{self-alignment-interface}
3555 @emph{オブジェクトを自動的に水平方向に揃える}
3557 @code{self-alignment-interface} をサポートするオブジェクトの水平方向の揃えは、@c
3558 @code{self-alignment-X} プロパティの値によって制御され、@c
3559 そのオブジェクトの @code{X-offset} プロパティには@c
3561 @code{ly:self-alignment-interface::x-aligned-on-self}.
3562 @code{self-alignment-X} がセットされます。@c
3563 与える実数値は、そのオブジェクトの X 方向の広がりの半分を単位とします。@c
3564 負値はオブジェクトを右に移動させ、正値はオブジェクトを左に移動させます。@c
3565 値が @code{0} であればそのオブジェクトは親オブジェクトの参照ポイントに@c
3567 値が @code{-1} であればそのオブジェクトの左端が親オブジェクトの参照ポイントに@c
3569 値が @code{1} であればそのオブジェクトの右端が親オブジェクトの参照ポイントに@c
3571 記号 @code{LEFT}, @code{CENTER}, それに @code{RIGHT} は@c
3572 それぞれ @w{@code{-1}, @code{0}, それに @code{1}} に対応します。
3574 通常、@code{\override} コマンドを用いて @code{self-alignment-X} の値を@c
3576 @code{\tweak} コマンドを用いることで@c
3577 単一の音符に付けられている複数の注釈を個別に揃えることができます:
3579 @lilypond[quote,verbatim,relative=1]
3581 -\tweak #'self-alignment-X #-1
3583 -\tweak #'self-alignment-X #0
3585 -\tweak #'self-alignment-X #RIGHT
3587 -\tweak #'self-alignment-X #-2.5
3588 ^"aligned further to the right"
3591 @emph{オブジェクトを自動的に垂直方向に揃える}
3593 オブジェクトの @code{Y-offset} プロパティに
3594 @code{ly:self-alignment-interface::y-aligned-on-self} がセットされていれば、@c
3595 水平方向の揃えと同じように、垂直方向に揃えることができます。@c
3596 しかしながら、垂直方向の揃えには他のメカニズムも関与します:
3597 @code{Y-offset} の値は、垂直方向の揃えに関与する変数の 1 つに過ぎません。@c
3598 このことにより、いくつかのオブジェクトの @code{Y-offset} 値の調整は@c
3600 単位はそのオブジェクトの垂直方向の広がりの半分です。@c
3601 通常これは非常に小さいため、非常に大きな数値が必要になる可能性があります。@c
3602 値が @code{-1} であればそのオブジェクトの下端が親オブジェクトの参照ポイントに@c
3604 値が @code{0} であればそのオブジェクトの中央が親オブジェクトの参照ポイントに@c
3606 値が @code{1} であればそのオブジェクトの上端が親オブジェクトの参照ポイントに@c
3608 記号 @code{DOWN}, @code{CENTER}, それに @code{UP} は@c
3609 それぞれ @w{@code{-1}, @code{0}, それに @code{1}} に対応します。
3611 @emph{オブジェクトを自動的に両方向に揃える}
3613 @code{X-offset} と @code{Y-offset} の両方の設定を行うことで、@c
3614 オブジェクトの水平方向と垂直方向の揃えを同時に行うことができます。
3616 以下の例は、運指記号を符頭に近づけるための調整方法を示しています。
3619 @lilypond[quote,verbatim,relative=2]
3621 -\tweak #'self-alignment-X #0.5 % 左方向に移動させます
3622 -\tweak #'Y-offset #ly:self-alignment-interface::y-aligned-on-self
3623 -\tweak #'self-alignment-Y #-1 % 上方向に移動させます
3628 @unnumberedsubsubsec Using the @code{aligned-on-parent} procedures
3630 @c Cannot document as they do not seem to operate consistently on all objects -td
3631 @c TODO investigate further
3633 The @code{aligned-on-parent} procedures are used in the same way
3634 as the @code{aligned-on-self} procedures, they difference being
3635 that they permit an object to be aligned with the @emph{edges} of
3636 the parent rather than the parent's reference point. The following
3637 example shows the difference:
3641 @lilypond[verbatim,quote]
3647 @unnumberedsubsubsec Using the @code{centered-on-parent} procedures
3649 @c Cannot document as they do not seem to operate consistently on all objects -td
3650 @c TODO investigate further
3654 @c TODO The align-interface, BassFigureAlignment and VerticalAlignment
3656 @node break-alignable-interface を使用する
3657 @unnumberedsubsubsec @code{break-alignable-interface} を使用する
3658 @translationof Using the @code{break-alignable-interface}
3660 @cindex align to objects (オブジェクトに揃える)
3661 @cindex break-align-symbols
3663 リハーサル記号と小節番号を小節線ではなく、@c
3664 記譜オブジェクトに揃えることができます。@c
3665 対象となる記譜オブジェクトには、@code{ambitus},
3666 @code{breathing-sign}, @code{clef}, @code{custos}, @code{staff-bar},
3667 @code{left-edge}, @code{key-cancellation}, @code{key-signature}, それに
3668 @code{time-signature} があります。
3671 リハーサル記号と小節番号はオブジェクトの上で水平方向に中央揃えされます:
3674 @lilypond[verbatim,quote,relative=1]
3675 % リハーサル記号は音部記号の上に中央揃えされます
3676 \override Score.RehearsalMark #'break-align-symbols = #'(clef)
3681 % リハーサル記号は拍子記号の上に中央揃えされます
3682 \override Score.RehearsalMark #'break-align-symbols = #'(time-signature)
3688 % リハーサル記号はブレス記号の上に中央揃えされます
3689 \override Score.RehearsalMark #'break-align-symbols = #'(breathing-sign)
3698 揃えの対象となり得るオブジェクトのリストを指定することができます。@c
3699 揃えを行う時点で対象リストの中にあるオブジェクトのいくつかが不可視である
3700 -- @code{break-visibility} の設定や、@c
3701 調号と音部に対する明示的な可視性の設定により --
3702 場合、リハーサル記号あるいは小節番号はリストの中にある@c
3703 最初の可視のオブジェクトに揃えられます。@c
3704 リストの中にあるオブジェクトがすべて不可視である場合、小節線に揃えられます。@c
3705 小節線が不可視である場合、小節線があるはずの場所に揃えられます。
3708 @lilypond[verbatim,quote,relative=1]
3709 % リハーサル記号は調号の上に中央揃えされます
3710 \override Score.RehearsalMark #'break-align-symbols = #'(key-signature clef)
3715 % リハーサル記号は音部記号の上に中央揃えされます
3716 \set Staff.explicitKeySignatureVisibility = #all-invisible
3717 \override Score.RehearsalMark #'break-align-symbols = #'(key-signature clef)
3722 % リハーサル記号は小節線の上に中央揃えされます
3723 \set Staff.explicitKeySignatureVisibility = #all-invisible
3724 \set Staff.explicitClefVisibility = #all-invisible
3725 \override Score.RehearsalMark #'break-align-symbols = #'(key-signature clef)
3733 記譜オブジェクトに対するリハーサル記号の揃えを変更することができます。@c
3734 複数の譜を持つ楽譜では、この設定はすべての譜に適用されます。
3737 @lilypond[verbatim,quote,relative=1]
3738 % RehearsalMark は KeySignature の上に中央揃えされます
3739 \override Score.RehearsalMark #'break-align-symbols = #'(key-signature)
3745 % RehearsalMark は KeySignature の左端に揃えられます
3746 \once \override Score.KeySignature #'break-align-anchor-alignment = #LEFT
3750 % RehearsalMark は KeySignature の右端に揃えられます
3751 \once \override Score.KeySignature #'break-align-anchor-alignment = #RIGHT
3757 また、リハーサル記号を左端に揃えて、@c
3758 さらに任意の量だけ右あるいは左にずらすことができます。@c
3762 @lilypond[verbatim,quote,relative=1]
3763 % リハーサル記号は調号の左端に揃えられて
3764 % さらに 3.5 譜スペース右にずらされます
3765 \override Score.RehearsalMark #'break-align-symbols = #'(key-signature)
3766 \once \override Score.KeySignature #'break-align-anchor = #3.5
3770 % リハーサル記号は調号の左端に揃えられて
3771 % さらに 2 譜スペース左にずらされます
3772 \once \override Score.KeySignature #'break-align-anchor = #-2
3779 @node グラフィカル オブジェクトを垂直方向にグループ化する
3780 @subsection グラフィカル オブジェクトを垂直方向にグループ化する
3781 @translationof Vertical grouping of grobs
3783 @c FIXME Expand this section
3785 VerticalAlignment グラフィカル オブジェクトと
3786 VerticalAxisGroup グラフィカル オブジェクトは対で機能します。@c
3787 VerticalAxisGroup は Staff, Lyrics, 等のような@c
3788 異なるグラフィカル オブジェクトをグループにまとめます。@c
3789 それから、VerticalAlignment が
3790 VerticalAxisGroup によってグループ化されたグラフィカル オブジェクトを@c
3792 通常、楽譜には VerticalAlignment は 1 つしかありませんが、@c
3793 Staff, Lyrics 等はそれ自体でそれぞれに VerticalAxisGroup を持ちます。
3797 @subsection ステンシルを変更する
3798 @translationof Modifying stencils
3800 すべてのレイアウト オブジェクトは、@c
3801 @code{grob-interface} の一部である @code{stencil} プロパティを持ちます。@c
3802 通常、デフォルトでこのプロパティには、@c
3803 出力でそのオブジェクトを具現化する記号を描画するための@c
3805 例えば、@code{MultiMeasureRest} オブジェクトの @code{stencil} プロパティに@c
3806 対する標準設定は、@code{ly:multi-measure-rest::print} です。
3808 @code{stencil} プロパティを変更して異なる描画関数を参照させることにより、@c
3809 オブジェクトの標準記号を置き換えることができます。@c
3810 これには LilyPond 内部機能についての高い知識が求められます。@c
3811 しかしながら、多くの場合にまずまずの結果を生み出すもっと簡単な方法があります。
3813 簡単な方法では、@code{stencil} プロパティにテキストを描画する関数
3814 -- @code{ly:text-interface::print} -- をセットし、@c
3815 必要な記号を生み出すマークアップ テキストを保持するよう設定された
3816 @code{text} プロパティ与えます。@c
3817 マークアップの自由度の高さにより、多くのことを達成できます。@c
3818 詳細は、@ref{マークアップ内部でのグラフィック記譜法} を参照してください。
3820 以下の例では、この方法を用いて符頭記号を内部に×を持つ円に変更しています。
3822 @lilypond[verbatim,quote]
3824 \once \override NoteHead #'stencil = #ly:text-interface::print
3825 \once \override NoteHead #'text = \markup {
3827 \halign #-0.7 \draw-circle #0.85 #0.2 ##f
3828 \musicglyph #"noteheads.s2cross"
3836 @code{\musicglyph} マークアップ コマンドには、@c
3837 Feta フォントに含まれる任意の図柄を提供することができます。@c
3838 @ref{The Feta font} を参照してください。
3840 @c TODO Add inserting eps files or ref to later
3842 @c TODO Add inserting Postscript or ref to later
3847 @ref{マークアップ内部でのグラフィック記譜法},
3848 @ref{テキストをフォーマットする},
3849 @ref{Text markup commands},
3855 @translationof Modifying shapes
3861 @node タイとスラーの形状を変更する
3862 @unnumberedsubsubsec タイとスラーの形状を変更する
3863 @translationof Modifying ties and slurs
3865 @cindex slurs, modifying (スラーの形状を変更する)
3866 @cindex ties, modifying (タイの形状を変更する)
3867 @cindex Bézier curves (ベジエ曲線)
3868 @cindex Bézier control points (ベジエ曲線の制御ポイント)
3870 タイ、スラー、それにフレージング スラーは 3 次のベジエ曲線として描かれます。@c
3871 自動的に算出されるタイあるいはスラーの形状が最適ではない場合、@c
3872 3 次ベジエ曲線を定義するのに必要な 4 つの制御ポイントを@c
3873 明示的に指定することによって、形状を変更することができます。
3875 3 次あるいは 3 乗のベジエ曲線は、4 つの制御ポイントによって定義されます。@c
3876 1 番目と 4 番目の制御ポイントは曲線の始点と終点になります。@c
3877 間にある 2 つの制御ポイントは曲線の形状を定義します。@c
3878 Web でベジエ曲線が描かれる様子を示すアニメーションを@c
3880 しかしながら、以下の記述も役に立つかもしれません。@c
3881 ベジエ曲線は最初の制御ポイントから 2 番目の制御ポイントに進み、@c
3882 徐々に 3 番目の制御ポイントの方へ向きを変えながら
3883 4 番目の制御ポイントの方へ向かい続け、@c
3884 3 番目の制御ポイントから 4 番目の制御ポイントに到達します。@c
3885 ベジエ曲線は 4 つの制御ポイントからなる四角形の中に納まります。
3888 タイが最適化されず、@code{\tieDown} が役に立たないケースを例として挙げます。
3890 @lilypond[verbatim,quote,relative=1]
3894 { r4 <g c,> <g c,> <g c,> }
3898 以下のようにタイの制御ポイントを手動で変更することにより、@c
3899 このタイの形状を改善することができます。
3901 ベジエ制御ポイントの座標は譜スペースを単位として指定されます。@c
3902 X@tie{}座標はそのタイあるいはスラーを取り付けられる音符の参照ポイントからの@c
3903 相対座標であり、Y@tie{}座標は譜の中央線からの相対座標です。@c
3904 制御ポイント座標は 10 進数 (実数) のペアを 4 つ持つリストとして設定されます。@c
3905 最適な制御ポイントを決定するための手順は、
3906 2 つの終点の座標を見積もり、それから 2 つの中間ポイントを推測することで、@c
3908 最適値はトライ&エラーで見つけ出します。
3910 左右対称の曲線にするには制御ポイントを左右対称に配置する必要があるということを@c
3912 また、ベジエ曲線の制御ポイントに平行移動、回転、それに拡大縮小などの変換を@c
3914 その曲線を変換できるという特性があるとも覚えておいてください。
3916 上記の実例として、以下の例のオーバライドで満足のいくタイが得られています。@c
3918 -- タイ (あるいはスラー) が開始する音符の直前に配置する必要があります --
3921 @lilypond[verbatim,quote,relative=1]
3925 #'control-points = #'((1 . -1) (3 . 0.6) (12.5 . 0.6) (14.5 . -1))
3929 { r4 <g c,> <g c,> <g c,> }
3935 同じ音楽タイミングに複数のタイあるいはスラーが存在する場合、@c
3936 @code{control-points} プロパティを変更しても@c
3937 それらの形状を変更することはできません。@c
3938 @code{\tweak} コマンドを用いたとしても変更できません。@c
3939 しかしながら、@code{TieColumn} の @code{tie-configuration} プロパティを@c
3940 オーバライドすることで、タイの垂直方向の位置と領域を変更することができます。
3944 @rinternals{TieColumn}
3949 @translationof Using music functions
3951 @c TODO -- add @seealso, etc. to these subsections
3953 調整を異なる音楽表記に再利用する必要がある場合、@c
3954 その調整を音楽関数にしておくと便利です。@c
3955 このセクションでは、@emph{置換} 関数についてだけ議論します。@c
3956 置換関数は変数を LilyPond 入力コードに置き換えます。@c
3957 他のもっと複雑な関数については、@rextend{Music functions} で記述されています。
3966 @translationof Substitution function syntax
3968 変数を LilyPond コードに置換する関数を作成することは簡単にできます。@c
3969 置換関数の一般的な形式は以下のようなものです:
3973 #(define-music-function
3974 (parser location @var{arg1} @var{arg2} @dots{})
3975 (@var{type1?} @var{type2?} @dots{})
3977 @var{@dots{}music@dots{}}
3984 @multitable @columnfractions .33 .66
3985 @item @code{@var{argN}}
3988 @item @code{@var{typeN?}}
3989 @tab @code{@var{argN}} が @code{#t} を返す Scheme の @emph{型述語} (type predicate)。
3991 @item @code{@var{@dots{}music@dots{}}}
3992 @tab 通常の LilyPond 入力。@code{$} を用いて引数を参照します
3999 共通の変数タイプについては @ref{共通の引数タイプ} で記述されています。@c
4001 @rextend{Music function syntax} にあります。
4004 引数 @code{parser} と @code{location} を省略することはできず、@c
4005 @rextend{Music function syntax} で記述されている高度な状況で@c
4007 置換関数において、必ずこれらの引数を記述してください。
4009 引数として、型述語のリストも必須です。@c
4010 音楽関数で用いられる一般的な型述語には下記のものがあります:
4014 cheap-list? @emph{(}@q{list?}@emph{ の代わりに用いることで、処理を高速にします)}
4025 @ref{Predefined type predicates} を参照してください。@c
4026 ユーザが型述語を定義することもできます。
4032 @ref{Predefined type predicates}
4035 @rextend{Music function syntax}
4038 @file{lily/music-scheme.cc},
4045 @subsection 共通の引数タイプ
4046 @translationof Common argument types
4049 音楽関数に渡される各引数タイプを定義しておく必要があります。@c
4050 共通の引数タイプのいくつかを以下の表で示します。@c
4052 以下の入力タイプを音楽関数で変数として使用することができます。@c
4053 このリストは完全なものではありません。@c
4054 取り得る変数タイプについての更なる情報は、
4055 @rextend{Music function syntax} にあります。
4057 @multitable @columnfractions .33 .66
4058 @headitem 入力タイプ @tab @var{vari-type?} での記述方法
4059 @item 整数 @tab @code{integer?}
4060 @item 浮動小数点数 (10 進数) @tab @code{number?}
4061 @item テキスト文字列 @tab @code{string?}
4062 @item マークアップ @tab @code{markup?}
4063 @item 音楽表記 @tab @code{ly:music?}
4064 @item Scheme ペア @tab @code{pair?}
4070 @rextend {Music function syntax}
4073 @file{lily/music-scheme.cc},
4081 @translationof Substitution function examples
4083 このセクションでは、置換関数の例をいくつか紹介します。@c
4084 高度なことはしていませんが、シンプルな置換関数を実現する方法を示しています。
4087 @code{TextScript} のパディング設定を容易にするための関数が定義されています:
4089 @lilypond[quote,verbatim,ragged-right]
4091 #(define-music-function
4092 (parser location padding)
4095 \once \override TextScript #'padding = $padding
4099 c4^"piu mosso" b a b
4101 c4^"piu mosso" d e f
4103 c4^"piu mosso" fis a g
4107 数値のほかに、音符などの音楽表記を音楽関数への引数にすることができます:
4109 @c TODO: use a better example (the music argument is redundant).
4111 @lilypond[quote,verbatim,ragged-right]
4113 #(define-music-function
4114 (parser location note)
4117 \once \override Voice.NoteHead #'stencil =
4118 #ly:text-interface::print
4119 \once \override Voice.NoteHead #'text =
4120 \markup \musicglyph #"custodes.mensural.u0"
4121 \once \override Voice.Stem #'stencil = ##f
4125 \relative c' { c4 d e f \custosNote g }
4128 複数の引数をとる置換関数を定義することもできます:
4130 @lilypond[quote,verbatim,ragged-right]
4132 #(define-music-function
4133 (parser location padding tempotext)
4136 \once \override Score.MetronomeMark #'padding = $padding
4137 \tempo \markup { \bold $tempotext }
4141 \tempo \markup { "Low tempo" }
4143 \tempoPadded #4.0 #"High tempo"
4148 @c TODO: add appropriate @@ref's here.