]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/ja/notation/changing-defaults.itely
Merge branch 'master' into lilypond/translation
[lilypond.git] / Documentation / ja / notation / changing-defaults.itely
1 @c -*- coding: utf-8; mode: texinfo; documentlanguage: ja -*-
2
3 @ignore
4     Translation of GIT committish: 45329bd378eedfebca34c746fff9e53b46cf2fe5
5
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..
9 @end ignore
10
11 @c \version "2.14.0"
12
13 @c Translators: Yoshiki Sawada
14 @c Translation status: post-GDP
15
16 @node デフォルトを変更する
17 @chapter デフォルトを変更する
18 @translationof Changing defaults
19
20 LilyPond はデフォルトで最高品質の出力を提供できるよう設計されています。@c
21 それにもかかわらず、@c
22 デフォルトのレイアウトを変更する必要が発生する場合もあります。@c
23 レイアウトは、@q{プロパティ} と呼ばれる多数の @q{つまみとスイッチ} によって@c
24 制御されています。@c
25 これらのプロパティにアクセスし、変更するための手引は学習マニュアルの中にあります
26 -- @rlearning{出力を調整する} を参照してください。@c
27 まずはこれを読むべきです。@c
28 本章は同様の内容をカバーしていますが、@c
29 よりリファレンス マニュアルに適したスタイルで提供します。
30
31 @cindex Internals Reference (内部リファレンス)
32
33 調整のために利用できる制御の定義についての説明は、@c
34 別のドキュメントの中にあります: @rinternalsnamed{Top,内部リファレンス} です。@c
35 このマニュアルは利用可能なすべての変数、関数、それにオプションを@c
36 リストアップしています。@c
37 これは HTML ドキュメントとして記述されていて、@c
38 @uref{http://@/lilypond@/.org/@/doc/@/stable/@/Documentation/@/user/@/lilypond@/-internals/,オンライン}
39 で入手可能であり、@c
40 LilyPond ドキュメント パッケージにも含まれています。
41
42 内部的には、LilyPond は Scheme (LISP 派生語) を用いて機能を提供しています。@c
43 レイアウトについての決定をオーバライドすることは、@c
44 プログラムの内部にアクセスすることであり、@c
45 Scheme 入力が必要になります。@c
46 Scheme の要素は、@code{.ly} の中で、@c
47 ハッシュ記号 @code{#} を付けて記述します。@footnote{@rextend{Scheme tutorial}
48 の中に、Scheme 形式で数、リスト、文字列、それに記号を入力するための@c
49 簡単な手引きがあります。}
50
51
52 @menu
53 * コンテキストを理解する::
54 * 内部リファレンスの説明::
55 * プロパティを変更する::
56 * 役に立つコンセプトとプロパティ::
57 * 高度な調整::
58 * 音楽関数を使用する::
59 @end menu
60
61
62 @node コンテキストを理解する
63 @section コンテキストを理解する
64 @translationof Interpretation contexts
65
66 このセクションでは、コンテキストとは何なのか、@c
67 それをどのように変更するのかについて説明します。
68
69 @menu
70 * コンテキストの説明::
71 * コンテキストを作成する::
72 * コンテキストを残しておく::
73 * コンテキストのプラグインを変更する::
74 * コンテキストのデフォルト設定を変更する::
75 * 新しいコンテキストを定義する::
76 * コンテキストを揃える::
77 @end menu
78
79
80 @seealso
81 学習マニュアル:
82 @rlearning{コンテキストとエングラーバ}
83
84 インストール済みファイル:
85 @file{ly/@/engraver@/-init@/.ly},
86 @file{ly/@/performer@/-init@/.ly}
87
88 コード断片集:
89 @rlsr{Contexts and engravers}
90
91 内部リファレンス:
92 @rinternals{Contexts},
93 @rinternals{Engravers and Performers}
94
95
96 @node コンテキストの説明
97 @subsection コンテキストの説明
98 @translationof Contexts explained
99
100 @ignore
101 @c TODO Rethink and rewrite
102
103 >> > > - list of contexts: my *danger unmaintainable*
104 >> > > alarm just went off.  I'm
105
106 I knew it would... And leaving out some of them is perfectly fine
107 with me.
108 I do think that a list like this, with the main contexts and a
109 brief
110 description of  what they do (perhaps also with a note about what
111 default
112 behavior is associated with each of them, but this may be
113 unmanageable),
114 should be there, and then we could simply list the remaining ones
115 without
116 further explanation and with links to the IR.
117 @end ignore
118
119 @c TODO Improve layout, order and consistency of wording -td
120
121 @c TODO Add introduction which explains contexts in generality  -td
122
123 @c TODO Describe propagation of property values -td
124
125 コンテキストは階層的に配置されます:
126
127 @menu
128 * Score - すべてのコンテキストのマスタ::
129 * 上位コンテキスト - 譜コンテナ::
130 * 中位コンテキスト - 譜::
131 * 下位コンテキスト - ボイス::
132 @end menu
133
134 @node Score - すべてのコンテキストのマスタ
135 @unnumberedsubsubsec Score - すべてのコンテキストのマスタ
136 @translationof Score - the master of all contexts
137
138 これは最上位の記譜コンテキストです。@c
139 他のコンテキストが Score コンテキストを保持することはできません。@c
140 デフォルトでは、Score コンテキストが拍子記号の管理を扱い、@c
141 音部記号、拍子記号、調号などのアイテムが譜間で揃っていることを保証します。
142
143 Score コンテキストは、@code{\score @{@dots{}@}} や @code{\layout @{@dots{}@}}
144 ブロックが処理されたときに暗黙的にインスタンス化されます。@c
145 @c また、@code{\new Score} コマンドが実行されたときに@c
146 @c 明示的にインスタンス化されます。
147
148
149 @node 上位コンテキスト - 譜コンテナ
150 @unnumberedsubsubsec 上位コンテキスト - 譜コンテナ
151 @translationof Top-level contexts - staff containers
152
153 @strong{@emph{StaffGroup}}
154
155 譜をグループ化して、左端に角括弧を付けます。@c
156 このコンテキストに保持されている譜の小節線は垂直につながります。@c
157 @code{StaffGroup} は譜のコレクション、@c
158 それに左端の角括弧と延長された小節線だけを保持します。
159
160 @strong{@emph{ChoirStaff}}
161
162 保持されている譜の小節線が垂直につながらないことを除けば、@c
163 @code{StaffGroup} と同じです。
164
165 @strong{@emph{GrandStaff}}
166
167 譜をグループ化して、左端に波括弧を付けます。@c
168 このコンテキストに保持されている譜の小節線は垂直につながります。@c
169
170 @strong{@emph{PianoStaff}}
171
172 @code{GrandStaff} と似ていますが、@c
173 各システムの左端に楽器名を付けることができます。
174
175
176 @node 中位コンテキスト - 譜
177 @unnumberedsubsubsec 中位コンテキスト - 譜
178 @translationof Intermediate-level contexts - staves
179
180 @strong{@emph{Staff}}
181
182 音部記号、小節線、調、臨時記号を扱います。@c
183 このコンテキストは @code{Voice} コンテキストを保持することができます。
184
185 @strong{@emph{RhythmicStaff}}
186
187 @code{Staff} と似ていますが、リズムを表示するためのものです。@c
188 ピッチは無視され、音符は線として表示されます。
189
190 @strong{@emph{TabStaff}}
191
192 タブ譜を生成するためのコンテキストです。@c
193 デフォルトでは、音楽表記を 6 線のギター タブ譜として配置します。
194
195 @strong{@emph{DrumStaff}}
196
197 打楽器の譜刻を扱います。@c
198 @code{DrumVoice} を保持することができます。
199
200 @strong{@emph{VaticanaStaff}}
201
202 @code{Staff} と同じですが、@c
203 グレゴリア形式の楽曲を譜刻するためにデザインされている点が異なります。
204
205 @strong{@emph{MensuralStaff}}
206
207 @code{Staff} と同じでが、@c
208 定量形式の楽曲を譜刻するためにデザインされている点が異なります。
209
210 @node 下位コンテキスト - ボイス
211 @unnumberedsubsubsec 下位コンテキスト - ボイス
212 @translationof Bottom-level contexts - voices
213
214 Voice レベルのコンテキストはある特定のプロパティを初期化し、@c
215 適切なエングラーバを開始させます。@c
216 下位コンテキストであるため、他のコンテキストを保持することはできません。
217
218 @strong{@emph{Voice}}
219
220 譜の上にあるボイスに相当します。@c
221 このコンテキストは、強弱記号、符幹、連桁、上付き/下付き文字、タイ、@c
222 それに休符の変換を扱います。@c
223 1 つの譜に複数のボイスを配置する必要がある場合、@c
224 ボイスを明示的にインスタンス化する必要があります。
225
226 @strong{@emph{VaticanaVoice}}
227
228 @code{Voice} と同じですが、@c
229 グレゴリア形式の楽曲を譜刻するためにデザインされている点が異なります。
230
231 @strong{@emph{MensuralVoice}}
232
233 @code{Voice} と同じですが、@c
234 定量形式の楽曲を譜刻するためにデザインされている点が異なります。
235
236 @strong{@emph{Lyrics}}
237
238 歌詞を保持するボイスに相当します。単一行の歌詞の表示を扱います。
239
240 @strong{@emph{DrumVoice}}
241
242 打楽器譜で使用されるボイス コンテキストです。
243
244 @strong{@emph{FiguredBass}}
245
246 このコンテキストの中で、@c
247 @code{\figuremode} モードで記述された入力から
248 @code{BassFigure} オブジェクトが作成されます。
249
250 @strong{@emph{TabVoice}}
251
252 @code{TabStaff} コンテキスト内部で使用されるボイス コンテキストです。@c
253 通常、暗黙的に作成されます。
254
255 @strong{@emph{CueVoice}}
256
257 小さなサイズの音符を描画するために使用されるボイス コンテキストです。@c
258 主に合図音符を譜に付け加えることを目的としています。@c
259 @ref{合図音符をフォーマットする} を参照してください。@c
260 通常、暗黙的に作成されます。
261
262 @strong{@emph{ChordNames}}
263
264 コード ネームを譜刻します。
265
266 @ignore
267 TODO
268
269 Then the following, which I don't know what to do with:
270
271     * GregorianTranscriptionVoice
272     * GregorianTranscriptionStaff
273
274     * FretBoards
275         Engraves fretboards from chords. Not easy... Not
276 documented.
277         There is now some documentation on FretBoards in the NR, under
278          instrument-specific notation -- cds.
279
280     * NoteNames
281
282     * Global
283         Hard coded entry point for LilyPond. Cannot be tuned.
284     * Devnull
285         Silently discards all musical information given to this
286 context.
287
288 @end ignore
289
290 @node コンテキストを作成する
291 @subsection コンテキストを作成する
292 @translationof Creating contexts
293
294 @c TODO more complete descriptions rather than learning style
295
296 ボイスと譜が 1 つだけの楽譜では、コンテキストは自動的に作成されます。@c
297 もっと複雑な楽譜では、手動でコンテキストを作成する必要があります。@c
298 コンテキスを作成するために 3 つのコマンドがあります。
299
300 @itemize
301
302 @item
303 もっとも簡単なコマンドは @code{\new} であり、@c
304 もっとも素早く入力できるコマンドでもあります。@c
305 このコマンドは音楽表記の前に置きます。例えば、以下のように:
306
307 @funindex \new
308 @cindex new contexts (新しいコンテキスト)
309 @cindex Context, creating (コンテキストを作成する)
310
311 @example
312 \new @var{type} @var{music expression}
313 @end example
314
315 @noindent
316 ここで、@var{type} はコンテキスト名 (@code{Staff} や @code{Voice} など) です。@c
317 このコマンドは新しいコンテキストを作成し、@c
318 そのコンテキストに付属する @var{音楽表記} の解釈を開始します。
319
320 @code{\new} の実際的な使用例には、多くの譜を持つ楽譜があります。@c
321 それぞれの譜に配置される各パートの前に @code{\new Staff} を記述します。
322
323 @lilypond[quote,verbatim,relative=2,ragged-right,fragment]
324 <<
325   \new Staff { c4 c }
326   \new Staff { d4 d }
327 >>
328 @end lilypond
329
330 @code{\new} コマンドは、コンテキストに名前を与えることもできます:
331
332 @example
333 \new @var{type} = @var{id} @var{music}
334 @end example
335
336 しかしながら、ユーザが指定したコンテキスト名は、
337 そのコンテキスト以前に同じ名前を与えられたコンテキストが無い場合にのみ、@c
338 使用できます。
339
340
341 @funindex \context
342
343 @item
344 @code{\new} と同様に、@c
345 @code{\context} コマンドも音楽表記をコンテキスト オブジェクトに代入します。@c
346 しかしながら、このコマンドはコンテキストに明示的に名前を与えます。@c
347 構文は以下の通りです:
348
349 @example
350 \context @var{type} = @var{id} @var{music}
351 @end example
352
353 この構文は @var{id} という名前の @var{type} タイプのコンテキストが@c
354 すで存在していないか検索します。@c
355 コンテキストがまだ存在していなければ、@c
356 指定された名前を持つコンテキストが新たに作成されます。@c
357 これは、コンテキストを後で参照する場合に有用です。@c
358 例えば、以下のように名前を付けられたメロディ:
359
360 @example
361 \context Voice = "@b{tenor}" @var{music}
362 @end example
363
364 @noindent
365 に、以下のように歌詞を設定すると、テキストは適切に音符に揃えられます:
366
367 @example
368 \new Lyrics \lyricsto "@b{tenor}" @var{lyrics}
369 @end example
370
371 @noindent
372
373 名前付きコンテキストの他の使用例として、2 つの音楽表記をつなげて
374 1 つのコンテキストにすることができます。@c
375 以下の例では、アーティキュレーションと音符は別々に入力されています:
376
377 @example
378 music = @{ c4 c4 @}
379 arts = @{ s4-. s4-> @}
380 @end example
381
382 これらを同じ @code{Voice} コンテキストに送ることによって@c
383 組み合わせることができます:
384
385 @example
386 <<
387   \new Staff \context Voice = "A" \music
388   \context Voice = "A" \arts
389 >>
390 @end example
391 @lilypond[quote,ragged-right]
392 music = { c4 c4 }
393 arts = { s4-. s4-> }
394 \relative c'' <<
395   \new Staff \context Voice = "A" \music
396   \context Voice = "A" \arts
397 >>
398 @end lilypond
399
400 このメカニズムを用いることで、原典版 (オリジナル版) を定義し、@c
401 オプションとしてそれに異なるアーティキュレーションを付けることができます。
402
403 @cindex creating contexts (コンテキストを作成する)
404
405 @item
406 コンテキストを作成する 3 つ目のコマンドは以下の通りです:
407
408 @example
409 \context @var{type} @var{music}
410 @end example
411
412 @noindent
413 これは @code{= @var{id}} を持つ @code{\context} に似ていますが、@c
414 タイプ @var{type} のすべてのコンテキストに適用されます
415 -- そのコンテキストに与えられた名前とは関係なく適用されます。@c
416
417 この構文の変形版は、@c
418 異なる階層で解釈される可能性がある音楽表記に対して使用されます。@c
419 例えば、@code{\applyOutput} コマンド
420 (@rextend{Running a function on all layout objects} を参照してください)
421 です。@c
422 明示的に @code{\context} を指定しなければ、通常は @code{Voice} に適用されます。
423
424 @example
425 \applyOutput #'@var{context} #@var{function}   % Voice に適用されます
426 @end example
427
428 @code{Score} レベルや @code{Staff} レベルで解釈させるには、以下のようにします:
429
430 @example
431 \applyOutput #'Score #@var{function}
432 \applyOutput #'Staff #@var{function}
433 @end example
434
435 @end itemize
436
437
438 @node コンテキストを残しておく
439 @subsection コンテキストを残しておく
440 @translationof Keeping contexts alive
441
442 @cindex contexts, keeping alive (コンテキストを残しておく)
443 @cindex contexts, lifetime (コンテキストのライフタイム)
444
445 通常、コンテキストは何もすることが無くなった最初の音楽的タイミングで@c
446 消滅させられます。@c
447 そのため、@code{Voice} コンテキストはすべてのイベントを終えるとすぐに消滅し、@c
448 @code{Staff} コンテキストは保持しているすべての @code{Voice} コンテキストの@c
449 イベントが終了するとすぐに消滅する、などとなっています。@c
450 このことは、早い段階のすでに消滅したコンテキスを参照する必要がある場合に、@c
451 障害となります。@c
452 例えば、@code{\change} コマンドで譜を変更する場合、@c
453 @code{\lyricsto} コマンドで歌詞をボイスに結び付ける場合、@c
454 あるいは、早い段階で登場したコンテキストに音楽イベントを追加する場合に@c
455 障害となります。
456
457 この規則には 1 つ例外があります:
458 @code{Staff} コンテキストや @code{<<...>>} 構造の中にある @code{Voice}
459 コンテキストのうち 1 つだけは、例え途中ですることが無くなったとしても、@c
460 @code{Staff} コンテキストあるいは
461 @code{<<...>>} 構造の終わりまで維持されます。@c
462 このように維持されるコンテキストは、最初の @code{@{...@}} 構造の中にある@c
463 最初のコンテキストであり、@code{<<...>>} 構造の中にあるものは無視されます。
464
465 各音楽タイミングで何かすることを持たせることにより、@c
466 任意のコンテキストを残しておくことができます。@c
467 @code{Staff} コンテキストを残しておくには、それに含まれるボイスの 1 つが@c
468 維持されることを保証する必要があります。@c
469 ボイスを残しておく方法の 1 つに、ボイスに含まれる実際の音楽と並列に、@c
470 空白休符をそのボイスに付け加えるという方法があります。@c
471 残しておく必要があるすべての @code{Voice} コンテキストに対して、@c
472 空白休符を付け加える必要があります。@c
473 ところどころで使用されるボイスがある場合、@c
474 前述の例外によって必要なボイスを残そうとするよりは、@c
475 それらのボイスすべてを残しておく方が安全です。
476
477 以下の例では、空白休符の追加を用いる方法で、@c
478 ボイス A とボイス B の両方が楽曲全体を通して維持されます:
479
480 @c KEEP LY
481 @lilypond[quote,verbatim]
482 musicA = \relative c'' { d4 d d d }
483 musicB = \relative c'' { g4 g g g }
484 keepVoicesAlive = {
485   <<
486     \new Voice = "A" { s1*5 }  % Voice "A" を 5 小節の間、維持する
487     \new Voice = "B" { s1*5 }  % Voice "B" を 5 小節の間、維持する
488   >>
489 }
490
491 music = {
492   \context Voice = "A" {
493     \voiceOneStyle
494     \musicA
495   }
496   \context Voice = "B" {
497     \voiceTwoStyle
498     \musicB
499   }
500   \context Voice = "A" { \musicA }
501   \context Voice = "B" { \musicB }
502   \context Voice = "A" { \musicA }
503 }
504
505 \score {
506   \new Staff <<
507     \keepVoicesAlive
508     \music
509   >>
510 }
511 @end lilypond
512
513 @cindex lyrics, aligning with sporadic melody (途切れ途切れのメロディに歌詞を揃える)
514
515 以下の例は、空白休符を用いる方法で、@c
516 途切れ途切れのメロディに歌詞を持たせる方法を示しています。@c
517 もちろん、実際に楽譜を書く場合は、@c
518 メロディや伴奏は複数のセクションによって構成されることになります。
519
520 @c KEEP LY
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 }
525 \score {
526   <<
527     \new Staff = "music" {
528       <<
529         \new Voice = "melody" {
530           \voiceOne
531           s1*4  % Voice "melody" を 4 小節の間、残します
532         }
533         {
534           \new Voice = "accompaniment" {
535             \voiceTwo
536             \accompaniment
537           }
538           <<
539             \context Voice = "melody" { \melody }
540             \context Voice = "accompaniment" { \accompaniment }
541           >>
542           \context Voice = "accompaniment" { \accompaniment }
543           <<
544             \context Voice = "melody" { \melody }
545             \context Voice = "accompaniment" { \accompaniment }
546           >>
547         }
548       >>
549     }
550     \new Lyrics \with { alignAboveContext = #"music" }
551     \lyricsto "melody" { \words }
552   >>
553 }
554 @end lilypond
555
556 これに代わる方法として、メロディに直接空白休符を付け加えて、@c
557 メロディが伴奏と揃うようにする方法があります
558 -- 多くの場合、こちらの方法の方が良いかもしれません:
559
560 @c KEEP LY
561 @lilypond[quote,verbatim]
562 melody = \relative c'' {
563   s1  % 1 小節スキップします
564   a4 a a a
565   s1  % 1 小節スキップします
566   a4 a a a
567 }
568 accompaniment = \relative c' {
569   d4 d d d
570   d4 d d d
571   d4 d d d
572   d4 d d d
573 }
574 words = \lyricmode { These words fol -- low the mel -- o -- dy }
575
576 \score {
577   <<
578     \new Staff = "music" {
579       <<
580         \new Voice = "melody" {
581           \voiceOne
582           \melody
583         }
584         \new Voice = "accompaniment" {
585           \voiceTwo
586           \accompaniment
587         }
588       >>
589     }
590     \new Lyrics \with { alignAboveContext = #"music" }
591     \lyricsto "melody" { \words }
592   >>
593 }
594 @end lilypond
595
596
597 @node コンテキストのプラグインを変更する
598 @subsection コンテキストのプラグインを変更する
599 @translationof Modifying context plug-ins
600
601 @c TODO Should this be Modifying engravers or Modifying contexts?
602
603 記譜コンテキスト (@code{Score} や @code{Staff} のような) は@c
604 プロパティを保存するだけなく、@c
605 @q{エングラーバ} と呼ばれる記譜要素を作成するプラグインを保持します。@c
606 例えば、@code{Voice} コンテキストは @code{Note_head_engraver} を保持し、@c
607 @code{Staff} コンテキストは @code{Key_signature_engraver} を保持します。
608
609 各プラグインについての説明は、
610 @ifhtml
611 @rinternals{Engravers and Performers}.
612 @end ifhtml
613 @ifnothtml
614 Internals Reference @expansion{} Translation @expansion{} Engravers.
615 @end ifnothtml
616 を参照してください。@c
617 @ifhtml
618 @rinternals{Contexts}
619 @end ifhtml
620 @ifnothtml
621 Internals Reference @expansion{} Translation @expansion{} Context.
622 @end ifnothtml
623 の中にある各コンテキストについての説明では、@c
624 そのコンテキストで使用されるエングラーバがリストアップされています。
625
626 これらのプラグインを入れ換えると有用な場合があります。@c
627 プラグインを入れ換えるには、新たに作成するコンテキストを
628 @code{\new} あるいは @code{\context} で開始し、@c
629 そのコンテキストを以下のように変更します:
630
631 @funindex \with
632
633 @example
634 \new @var{context} \with @{
635   \consists @dots{}
636   \consists @dots{}
637   \remove @dots{}
638   \remove @dots{}
639   @emph{etc.}
640 @}
641 @{
642   @emph{..music..}
643 @}
644 @end example
645
646 @noindent
647 ここで、@dots{} はエングラーバの名前になります。@c
648 ここで、@code{Staff} コンテキストから @code{Time_signature_engraver} と
649 @code{Clef_engraver} を削除する簡単な例を示します:
650
651 @lilypond[quote,relative=1,verbatim,fragment]
652 <<
653   \new Staff {
654     f2 g
655   }
656   \new Staff \with {
657      \remove "Time_signature_engraver"
658      \remove "Clef_engraver"
659   } {
660     f2 g2
661   }
662 >>
663 @end lilypond
664
665 2 番目の譜には、拍子記号と音部記号がありません。@c
666 この方法は、オブジェクトを不可視にするよりも乱暴な方法です。@c
667 なぜなら、譜全体に影響を与えるからです。@c
668 さらに、望む望まないに係わらず、この方法はスペースにも影響を与えます。@c
669 オブジェクトを消すもっと洗練された方法については、@c
670 @rlearning{オブジェクトの可視性と色} を参照してください。
671
672 次の例は、ある実用的な応用です。@c
673 通常、小節線と拍子記号は楽譜全体で同期されます。@c
674 これは @code{Timing_translator} と @code{Default_bar_line_engraver}
675 によって行われます。@c
676 このプラグインは拍子記号の管理や、小節内の配置の管理などを行います。@c
677 これらのエングラーバを @code{Score} コンテキストから
678 @code{Staff} コンテキストへ異動させることにより、@c
679 楽譜の各譜に独自の拍子記号を持たせることが可能になります。
680
681 @cindex polymetric scores (複合拍子楽譜)
682 @cindex Time signatures, multiple (複数の拍子記号)
683
684 @lilypond[quote,relative=1,ragged-right,verbatim,fragment]
685 \new Score \with {
686   \remove "Timing_translator"
687   \remove "Default_bar_line_engraver"
688 } <<
689   \new Staff \with {
690     \consists "Timing_translator"
691     \consists "Default_bar_line_engraver"
692   } {
693       \time 3/4
694       c4 c c c c c
695   }
696   \new Staff \with {
697     \consists "Timing_translator"
698     \consists "Default_bar_line_engraver"
699   } {
700        \time 2/4
701        c4 c c c c c
702   }
703 >>
704 @end lilypond
705
706 @knownissues
707
708 通常、エングラーバが指定される順序は問題にはなりません。@c
709 しかしながら、いくつかの特殊なケースでは、この順序が重要になります。@c
710 例えば、あるエングラーバがプロパティを記述して、@c
711 それを他のエングラーバが読む場合、あるいは、@c
712 あるエングラーバがグラフィカル オブジェクトを作成し、@c
713 それを他のエングラーバが処理しなければならない場合です。@c
714 エングラーバは指定された順序に従って呼び出され、処理を実行します。
715
716 以下の順序は重要です:
717 通常、@code{Bar_engraver} を最初に指定し、@c
718 @code{New_fingering_engraver} を @code{Script_column_engraver} の前で@c
719 指定する必要があります。@c
720 他にも指定順序が問題になるケースがあるかもしれません。
721
722
723 @node コンテキストのデフォルト設定を変更する
724 @subsection コンテキストのデフォルト設定を変更する
725 @translationof Changing context default settings
726
727 @code{Score}, @code{Staff} それに @code{Voice} コンテキストにおいて@c
728 デフォルトで使用されるコンテキスト設定は、以下の例で示すように、@c
729 @code{\layout} ブロックの中で指定することができます。@c
730 @code{\layout} ブロックは、それを適用する @code{\score} ブロックの中で、かつ、@c
731 音楽表記の外側に配置する必要があります。
732
733 以下のような方法でコンテキストのデフォルト値を指定する場合、@c
734 @code{\set} コマンドとコンテキストを@c
735 省略する必要があるということに注意してください:
736
737 @lilypond[quote,verbatim]
738 \score {
739   \relative c'' {
740     a4^"Really small, thicker stems, no time signature" a a a
741     a a a a
742   }
743   \layout {
744     \context {
745       \Staff
746       fontSize = #-4
747       \override Stem #'thickness = #4.0
748       \remove "Time_signature_engraver"
749     }
750   }
751 }
752 @end lilypond
753
754 上記の例の中で、@code{\Staff} コマンドは、@c
755 後に続く記述をその score ブロックの中にあるすべての譜に適用するということを@c
756 指定しています。
757
758 同様の方法で、@c
759 @code{Score} コンテキストや @code{Voice} コンテキストに@c
760 変更を適用することができます。
761
762 @knownissues
763
764 変数に加えられたコンテキストの変更を収集すること、それに、@c
765 その変数を参照することでそれらの変更を @code{\context} 定義に@c
766 適用することはできません。
767
768 @code{\RemoveEmptyStaffContext} はカレントの
769 @code{\Staff} 設定を上書きします。@c
770 @code{\RemoveEmptyStaffContext} を使用する staff
771 のデフォルト設定を変更したいのならば、@c
772 @code{\RemoveEmptyStaffContext} を呼び出した後に@c
773 変更を加える必要があります。@c
774 つまり、以下のようにします:
775
776 @example
777 \layout @{
778   \context @{
779     \RemoveEmptyStaffContext
780
781     \override Stem #'thickness = #4.0
782   @}
783 @}
784 @end example
785
786 @c TODO: add \with in here.
787
788
789 @node 新しいコンテキストを定義する
790 @subsection 新しいコンテキストを定義する
791 @translationof Defining new contexts
792
793 @cindex contexts, defining new (新しいコンテキストを定義する)
794 @cindex engravers, including in contexts (エングラーバをコンテキストに含める)
795
796 @funindex \alias
797 @funindex alias
798 @funindex \name
799 @funindex name
800 @funindex \type
801 @funindex type
802 @funindex \consists
803 @funindex consists
804 @funindex \accepts
805 @funindex accepts
806 @funindex \denies
807 @funindex denies
808
809 @code{Staff} や @code{Voice} のようなコンテキストは、@c
810 簡単なブロックの組み合わせで構成されています。
811 エングラーバ プラグインの組み合わせを変えることで、@c
812 新しいタイプのコンテキスを作成することができます。
813
814 次の例は、ゼロからタイプの異なる @code{Voice} コンテキストを作り上げる方法を@c
815 示しています。@c
816 このコンテキストは @code{Voice} コンテキストに似ていますが、@c
817 音符の代わりにスラッシュを譜の中央に譜刻します。@c
818 これはジャズで即興を表すのに使うことができます。
819
820 @lilypond[quote,ragged-right]
821 \layout { \context {
822   \name ImproVoice
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   \alias Voice
832 }
833 \context { \Staff
834   \accepts "ImproVoice"
835 }}
836
837 \relative c'' {
838   a4 d8 bes8 \new ImproVoice { c4^"ad lib" c
839    c4 c^"undress" c_"while playing :)" c }
840   a1
841 }
842 @end lilypond
843
844
845 これらの設定は @code{\layout} ブロック内部の @code{\context} ブロック@c
846 の中で定義します:
847
848 @example
849 \layout @{
850   \context @{
851     @dots{}
852   @}
853 @}
854 @end example
855
856 以下では、上記の例の @dots{} に入るべき入力について議論します。
857
858 最初に、新しいコンテキストの名前を定義する必要があります:
859
860 @example
861 \name ImproVoice
862 @end example
863
864 このコンテキストは @code{Voice} に似せる必要があるため、@c
865 (既存の) @code{Voice} と同じ機能を実現するコマンドが必要です。@c
866 これは、新しいコンテキストにエイリアス @code{Voice} を与えることで実現できます。
867
868 @example
869 \alias Voice
870 @end example
871
872 このコンテキストは音符と指示テキストを譜刻しますので、@c
873 それらの機能を提供するエングラーバを付け加える必要があります:
874
875 @example
876 \consists Note_heads_engraver
877 \consists Text_engraver
878 @end example
879
880 しかしながら、音符の代わりにスラッシュを譜の中央線上に配置します:
881
882 @example
883 \consists Pitch_squash_engraver
884 squashedPosition = #0
885 @end example
886
887 @rinternals{Pitch_squash_engraver} は
888 (@rinternals{Note_heads_engraver} によって作成される) 符頭を変更し、@c
889 符頭の垂直位置を @code{squashedPosition} にセットします
890 -- 今回は @code{0}、つまり中央線上です。
891
892 音符はスラッシュで、符幹を持ちません:
893
894 @example
895 \override NoteHead #'style = #'slash
896 \override Stem #'transparent = ##t
897 \override Flag #'transparent = ##t
898 @end example
899
900 これらのプラグインすべてが共同する必要があり、@c
901 それには特殊なプラグインが必要です。@c
902 このプラグインは常に @code{Engraver_group} であり、@c
903 キーワード @code{\type} を付ける必要があります。
904
905 @example
906 \type "Engraver_group"
907 @end example
908
909 まとめると、以下のようになります:
910
911 @example
912 \context @{
913   \name ImproVoice
914   \type "Engraver_group"
915   \consists "Note_heads_engraver"
916   \consists "Text_engraver"
917   \consists Pitch_squash_engraver
918   squashedPosition = #0
919   \override NoteHead #'style = #'slash
920   \override Stem #'transparent = ##t
921   \override Flag #'transparent = ##t
922   \alias Voice
923 @}
924 @end example
925
926 @funindex \accepts
927 コンテキストは階層を構成します。c
928 通常の @code{Voice} と同様に、@c
929 @code{ImproVoice} を @code{Staff} の下に置く必要があります。@c
930 それゆえ、@code{Staff} 定義を @code{\accepts} コマンドで変更します:
931
932 @example
933 \context @{
934   \Staff
935   \accepts ImproVoice
936 @}
937 @end example
938
939 @funindex \denies
940 @code{\accepts} の反対は @code{\denies} です。@c
941 これは既存のコンテキスト定義を再利用する場合に必要となります。
942
943 以下のように、両方を @code{\layout} ブロックの中に置きます:
944
945 @example
946 \layout @{
947   \context @{
948     \name ImproVoice
949     @dots{}
950   @}
951   \context @{
952     \Staff
953     \accepts "ImproVoice"
954   @}
955 @}
956 @end example
957
958 それから、このサブセクションの最初にあった出力を入力します:
959
960 @example
961 \relative c'' @{
962   a4 d8 bes8
963   \new ImproVoice @{
964     c4^"ad lib" c
965     c4 c^"undress"
966     c c_"while playing :)"
967   @}
968   a1
969 @}
970 @end example
971
972
973 @node コンテキストを揃える
974 @subsection コンテキストを揃える
975 @translationof Aligning contexts
976
977 新しいコンテキストを既存のコンテキストの上または下に揃えることができます。@c
978 これはボーカル譜 (@rlearning{合唱}) を組む場合やオッシアで役に立ちます。
979
980 @c TODO Better example needed.  Ref LM, and expand on it.
981
982 @cindex ossia (オッシア)
983 @funindex alignAboveContext
984 @funindex alignBelowContext
985
986 @lilypond[quote,ragged-right]
987 ossia = { f4 f f f }
988 \score{
989   \relative c' \new Staff = "main" {
990     c4 c c c
991     <<
992       \new Staff \with { alignAboveContext = #"main" } \ossia
993       { d8 f d f d f d f }
994     >>
995   }
996 }
997 @end lilypond
998
999 @cindex nested contexts (ネストされたコンテキスト)
1000 @cindex contexts, nested (ネストされたコンテキスト)
1001
1002 @funindex \accepts
1003 @funindex \denies
1004
1005 @code{PianoStaff} のようなコンテキストは、@c
1006 ネスト (入れ子) 構造をとって、@c
1007 他のコンテキストを内部に保持することができます。@c
1008 ネスト構造をとることができるコンテキストは、@c
1009 コンテキストの @qq{accepts} リストによって定義されています。@c
1010 このリストには存在しないコンテキストは、楽譜が譜刻されるとき、@c
1011 (@code{PianoStaff} などの) 親コンテキストの下に配置されます。@c
1012 例えば、@code{PianoStaff} コンテキストは、デフォルトで、@c
1013 @code{Staff} と @code{FiguredBass} コンテキストを内部に受け入れるよう@c
1014 定義されていますが、(例えば) @code{Lyrics} コンテキストは受け入れません。@c
1015 そのため、以下の例では、歌詞は 2 つの譜の間ではなく、@c
1016 ピアノ譜の下に配置されています:
1017
1018 @lilypond[verbatim,quote,relative=1]
1019 \new PianoStaff
1020 <<
1021   \new Staff { e4 d c2 }
1022   \addlyrics { Three blind mice }
1023   \new Staff {
1024     \clef "bass"
1025     { c,1 }
1026   }
1027 >>
1028 @end lilypond
1029
1030 コンテキストの @qq{accepts} リストを変更することで、
1031 ネストされるコンテキストを追加するができます。@c
1032 ですから、歌詞を 2 つの譜の間に表示させたいのなら、以下のようにします:
1033
1034 @lilypond[verbatim,quote,relative=1]
1035 \new PianoStaff \with { \accepts Lyrics }
1036 <<
1037   \new Staff { e4 d c2 }
1038   \addlyrics { Three blind mice }
1039   \new Staff {
1040     \clef "bass"
1041     { c,1 }
1042   }
1043 >>
1044 @end lilypond
1045
1046 @code{\accepts} の反対は @code{\denies} です。@c
1047 これはコンテキストを @qq{accepts} リストから削除します。
1048
1049
1050 @node 内部リファレンスの説明
1051 @section 内部リファレンスの説明
1052 @translationof Explaining the Internals Reference
1053
1054
1055 @menu
1056 * 内部リファレンスを使いこなす::
1057 * レイアウト インターフェイス::
1058 * グラフィカル オブジェクトを決定する::
1059 * 命名規約::
1060 @end menu
1061
1062 @node 内部リファレンスを使いこなす
1063 @subsection 内部リファレンスを使いこなす
1064 @translationof Navigating the program reference
1065
1066 @c TODO remove this (it's in the LM)
1067 @c Replace with more factual directions
1068
1069 以下の譜面の運指記号を移動させたいとします:
1070
1071 @lilypond[quote,relative=2,verbatim]
1072 c-2
1073 \stemUp
1074 f
1075 @end lilypond
1076
1077 運指指示のドキュメント (@ref{運指の指示}) を見ると、@c
1078 以下のようなセクションがあることに気付くはずです:
1079
1080 @quotation
1081 @strong{参照}
1082
1083 内部リファレンス: @rinternals{Fingering}
1084
1085 @end quotation
1086
1087
1088 @c  outdated info; probably will delete.
1089 @ignore
1090 This fragment points to two parts of the program reference: a page
1091 on @code{FingeringEvent} and one on @code{Fingering}.
1092
1093 The page on @code{FingeringEvent} describes the properties of the music
1094 expression for the input @code{-2}.  The page contains many links
1095 forward.  For example, it says
1096
1097 @quotation
1098 Accepted by: @rinternals{Fingering_engraver},
1099 @end quotation
1100
1101 @noindent
1102 That link brings us to the documentation for the Engraver, the
1103 plug-in, which says
1104
1105 @quotation
1106 This engraver creates the following layout objects: @rinternals{Fingering}.
1107 @end quotation
1108
1109 In other words, once the @code{FingeringEvent}s are interpreted, the
1110 @code{Fingering_engraver} plug-in will process them.
1111 @end ignore
1112
1113 @ignore
1114 @c  I can't figure out what this is supposed to mean.  -gp
1115
1116 The @code{Fingering_engraver} is also listed to create
1117 @rinternals{Fingering} objects,
1118
1119 @c  old info?  it doesn't make any sense to me with our current docs.
1120 This is also the
1121 second bit of information listed under @b{See also} in the Notation
1122 manual.
1123 @end ignore
1124
1125 @ifnothtml
1126 内部リファレンスは HTML ドキュメント形式で入手可能です。@c
1127 内部リファレンスは、オンラインか HTML ドキュメントをダウンロードするかして、@c
1128 HTML 形式で読むことを強く推奨します。@c
1129 PDF マニュアルを使用していると、@c
1130 このセクションを理解するのはずっと困難になります。@c
1131 (訳者: 日本語では PDF 形式での提供はありません。)
1132 @end ifnothtml
1133
1134 @rinternals{Fingering} へのリンクを辿ってください。@c
1135 ページの先頭に、以下のような記述があります:
1136
1137 @quotation
1138 Fingering objects are created by: @rinternals{Fingering_engraver} and
1139 @rinternals{New_fingering_engraver}.
1140 @end quotation
1141
1142 内部リファレンスの中にある関連リンクを辿っていくことで、@c
1143 プログラム内部の情報フローを追っていくことができます:
1144
1145 @itemize
1146
1147 @item @rinternals{Fingering}:
1148 @rinternals{Fingering} objects are created by:
1149 @rinternals{Fingering_engraver}
1150
1151 (@rinternals{Fingering}:
1152 @rinternals{Fingering} オブジェクトを作成するのは:
1153 @rinternals{Fingering_engraver})
1154
1155
1156 @item @rinternals{Fingering_engraver}:
1157 Music types accepted:
1158 @rinternals{fingering-event}
1159
1160 (@rinternals{Fingering_engraver}:
1161 受け取る音楽タイプは: @rinternals{fingering-event})
1162
1163 @item @rinternals{fingering-event}:
1164 Music event type @code{fingering-event} is in
1165 Music expressions named @rinternals{FingeringEvent}
1166
1167 (@rinternals{fingering-event}:
1168 音楽イベント タイプ @code{fingering-event} は
1169 @rinternals{FingeringEvent} という名前の音楽表記の中にあります)
1170
1171 @end itemize
1172
1173 このパスは、プログラム内部での情報フローとは逆向きです:
1174 出力からスタートして、入力イベントで終わっています。@c
1175 入力イベントからスタートして、情報フローを読み進め、@c
1176 最後は出力オブジェクトに辿り着くこともできます。
1177
1178 内部リファレンスを通常のドキュメントのように読むこともできます。@c
1179 内部リファレンスに含まれる章は、
1180 @ifhtml
1181 @rinternals{Music definitions},
1182 @end ifhtml
1183 @ifnothtml
1184 @code{Music definitions},
1185 @end ifnothtml
1186 @rinternals{Translation}, それに @rinternals{Backend} です。
1187 各章は、使用されているすべての定義と調整可能なすべてのプロパティを@c
1188 リストアップしています。
1189
1190
1191 @node レイアウト インターフェイス
1192 @subsection レイアウト インターフェイス
1193 @translationof Layout interfaces
1194
1195 @cindex interface, layout (レイアウト インターフェイス)
1196 @cindex layout interface (レイアウト インターフェイス)
1197 @cindex grob (グラフィカル オブジェクト)
1198
1199 前のセクションで見た HTML ページには、@c
1200 @rinternals{Fingering} と呼ばれるレイアウト オブジェクトについての@c
1201 記述がありました。@c
1202 そのようなオブジェクトは楽譜で記号となります。@c
1203 レイアウト オブジェクトは (太さや向きのような) 数値を保持する@c
1204 プロパティを持っていますが、@c
1205 関連オブジェクトへのポインタも持っています。@c
1206 レイアウト オブジェクトは @emph{Grob}
1207 -- これはグラフィカル オブジェクトを縮めたものです --
1208 とも呼ばれます。@c
1209 Grob についての詳細は、@rinternals{grob-interface} を参照してください。
1210
1211 @code{Fingering} のページは、@c
1212 @code{Fingering} オブジェクトの定義をリストアップしています。@c
1213 例えば、このページには以下のような記述があります:
1214
1215 @quotation
1216 @code{padding} (dimension, in staff space):
1217
1218 @code{0.5}
1219 @end quotation
1220
1221 @noindent
1222 これは、この数値は少なくとも符頭の 0.5 倍の距離を保つということを意味します。
1223
1224
1225 各レイアウト オブジェクトは、記譜要素あるいは写植要素としての機能を@c
1226 いくつか持つ場合があります。@c
1227 例えば、@code{Fingering} オブジェクトは以下の側面を持っています:
1228
1229 @itemize
1230 @item
1231 Its size is independent of the horizontal spacing, unlike slurs or beams.
1232
1233 (このオブジェクトのサイズは、スラーや連桁と異なり、@c
1234 水平方向のスペースとは無関係です)
1235
1236 @item
1237 It is a piece of text.  Granted, it is usually a very short text.
1238
1239 (このオブジェクトはテキストです。通常、これは非常に短いテキストです。)
1240
1241 @item
1242 That piece of text is typeset with a font, unlike slurs or beams.
1243
1244 (このテキストは、スラーや連桁と異なり、フォントで写植されます。)
1245
1246 @item
1247 Horizontally, the center of the symbol should be aligned to the
1248 center of the note head.
1249
1250 (水平方向では、この記号の中心は符頭の中心に揃えられます。)
1251
1252 @item
1253 Vertically, the symbol is placed next to the note and the staff.
1254
1255 (垂直方向では、この記号は音符や譜の近く配置されます。)
1256
1257 @item
1258 The vertical position is also coordinated with other superscript
1259 and subscript symbols.
1260
1261 (また、垂直方向の位置は、他の上付き記号や下付き記号との調整によって決まります。)
1262 @end itemize
1263
1264 これらの側面はそれぞれ、いわゆる @emph{インターフェイス}
1265 として捉ええられます。@c
1266 それらは、@rinternals{Fingering} ページの最下部でリストアップされています。
1267
1268 @quotation
1269 This object supports the following interfaces:
1270
1271 (このオブジェクトは以下のインターフェイスをサポートします:)
1272
1273 @rinternals{item-interface},
1274 @rinternals{self-alignment-interface},
1275 @rinternals{side-position-interface}, @rinternals{text-interface},
1276 @rinternals{text-script-interface}, @rinternals{font-interface},
1277 @rinternals{finger-interface}, and @rinternals{grob-interface}.
1278 @end quotation
1279
1280 リンクのいずれかをクリックすると、@c
1281 それぞれのオブジェクト インターフェイスのページに行くことができます。@c
1282 各インターフェイスはいくつかのプロパティを持ちます。@c
1283 それらプロパティの中には、ユーザにとって役に立たないもの
1284 (@q{内部プロパティ}) もありますが、それ以外は変更可能です。
1285
1286 これまで @code{Fingering} オブジェクトについて話してきましたが、@c
1287 これは実際にはそれほど多くのことをしているわけではありません。@c
1288 初期化ファイル (@rlearning{その他の情報源} を参照してください)
1289 @file{scm/define-grobs.scm} がこの @q{オブジェクト} の本質を示しています:
1290
1291 @example
1292 (Fingering
1293   . ((padding . 0.5)
1294      (avoid-slur . around)
1295      (slur-padding . 0.2)
1296      (staff-padding . 0.5)
1297      (self-alignment-X . 0)
1298      (self-alignment-Y . 0)
1299      (script-priority . 100)
1300      (stencil . ,ly:text-interface::print)
1301      (direction . ,ly:script-interface::calc-direction)
1302      (font-encoding . fetaText)
1303      (font-size . -5)           ; don't overlap when next to heads.
1304      (meta . ((class . Item)
1305      (interfaces . (finger-interface
1306                     font-interface
1307                     text-script-interface
1308                     text-interface
1309                     side-position-interface
1310                     self-alignment-interface
1311                     item-interface))))))
1312 @end example
1313
1314 @noindent
1315 見て取ることができるように、@c
1316 @code{Fingering} オブジェクトは変数設定の塊に過ぎず、@c
1317 内部リファレンスの中にある Web ページは、@c
1318 この定義から直接生成されたに過ぎません。
1319
1320
1321 @node グラフィカル オブジェクトを決定する
1322 @subsection グラフィカル オブジェクトを決定する
1323 @translationof Determining the grob property
1324
1325 @c TODO remove this (it's in the LM)
1326 @c Replace with more factual directions
1327
1328 以下の @b{2} の位置を変更しようとしていたことを思い出してください:
1329
1330 @lilypond[quote,fragment,relative=2,verbatim]
1331 c-2
1332 \stemUp
1333 f
1334 @end lilypond
1335
1336 垂直方向で見て、@b{2} は元の音符の隣に配置されるのですから、@c
1337 この配置に関連するインターフェイスに干渉する必要があります。@c
1338 これは @code{side-position-interface} を用いて行います。@c
1339 このインターフェイスについてのページには、以下のように記述されています:
1340
1341 @quotation
1342 @code{side-position-interface}
1343
1344 Position a victim object (this one) next to other objects (the
1345 support).  The property @code{direction} signifies where to put the
1346 victim object relative to the support (left or right, up or down?)
1347
1348 (対象オブジェクトを他のオブジェクト (サポート オブジェクト)
1349 の隣に配置します。@c
1350 このプロパティ @code{direction} は、@c
1351 対象オブジェクトをどこに配置するかを@c
1352 サポート オブジェクトからの相対位置で示します
1353 (左あるいは右、上あるいは下?))
1354 @end quotation
1355
1356 @cindex padding
1357 @noindent
1358 この記述の下に、以下のような変数 @code{padding} についての記述があります:
1359
1360 @quotation
1361 @table @code
1362 @item padding
1363 (dimension, in staff space)
1364 (譜スペースを単位とする距離)
1365
1366 Add this much extra space between objects that are next to each other.
1367 (隣り合うオブジェクトの間にスペースを付け加えます)
1368 @end table
1369 @end quotation
1370
1371 @code{padding} の値を増やすことで、@c
1372 運指記号を符頭から離すことができます。@c
1373 以下のコマンドは、音符と運指記号の間に 3 譜スペースを挿入します:
1374
1375 @example
1376 \once \override Voice.Fingering #'padding = #3
1377 @end example
1378
1379 このコマンドを @code{Fingering} オブジェクトが作成される前に挿入する
1380 -- つまり @code{c2} の前に挿入する -- と、以下のような結果が得られます:
1381
1382 @lilypond[quote,relative=2,fragment,verbatim]
1383 \once \override Voice.Fingering #'padding = #3
1384 c-2
1385 \stemUp
1386 f
1387 @end lilypond
1388
1389
1390 このケースでは、調整されるコンテキストは @code{Voice} です。@c
1391 このことは、内部リファレンスの @rinternals{Fingering_engraver}
1392 プラグインについてのページからわかります。@c
1393 このページには、以下のような記述があります:
1394
1395 @quotation
1396 Fingering_engraver is part of contexts: @dots{} @rinternals{Voice}
1397 (Fingering_engraver は次のコンテキストの一部です: @dots{} @rinternals{Voice})
1398 @end quotation
1399
1400
1401 @node 命名規約
1402 @subsection 命名規約
1403 @translationof Naming conventions
1404
1405 内部リファレンスについて他に説明しておくべき事柄として、@c
1406 さまざまな命名規約についての概要があります:
1407
1408 @itemize
1409 @item Scheme スタイル: 小文字の単語をハイフンでつなぎます
1410 (1 単語の名前を含みます) -- 例: lowercase-with-hyphens
1411 @item Scheme 関数: Scheme スタイルの先頭に @code{ly:} を付けます
1412 -- 例: ly:plus-scheme-style
1413 @item 音楽イベント、音楽クラス、それに音楽プロパティ: Scheme スタイルです
1414 -- 例: as-scheme-functions
1415 @item グラフィカル オブジェクト インターフェイス: Scheme スタイルです
1416 -- 例: scheme-style
1417 @c 未訳
1418 @item バックエンド プロパティ: Scheme スタイルです (が、X と Y があります!)
1419 @item コンテキスト (それに、音楽表記とグラフィカル オブジェクト):
1420 大文字で始まる単語、あるいはそれらをつなげます
1421 -- 例: Capitalized, CamelCase
1422 @item コンテキスト プロパティ:
1423 小文字で始まる単語に、大文字で始まる単語をつなげます
1424 -- 例: lowercaseFollowedByCamelCase
1425 @item エングラーバ:
1426 大文字で始まる単語に、小文字で始まる単語をアンダスコアでつなげます
1427 -- 例: Capitalized_followed_by_lowercase_and_with_underscores
1428 @end itemize
1429
1430 疑問:
1431 @itemize
1432 @item 命名規約のうち、慣習なのはどれで、規則なのはどれか?
1433 @item 命名規約のうち、どれが基本言語の規則で、@c
1434 どれが LP (訳者: LilyPond?) 特有の規則なのか?
1435 @end itemize
1436
1437
1438 @node プロパティを変更する
1439 @section プロパティを変更する
1440 @translationof Modifying properties
1441
1442 @c TODO change the menu and subsection node names to use
1443 @c backslash once the new macro to handle the refs
1444 @c is available.  Need to find and change all refs at
1445 @c the same time. -td
1446
1447 @menu
1448 * プロパティ変更の概要::
1449 * set コマンド::
1450 * override コマンド::
1451 * tweak コマンド::
1452 * set 対 override::
1453 * 連想配列を変更する::
1454 @end menu
1455
1456
1457 @node プロパティ変更の概要
1458 @subsection プロパティ変更の概要
1459 @translationof Overview of modifying properties
1460
1461 各コンテキストは、ある特定のタイプのグラフィカル オブジェクトを作成することに@c
1462 ついて責任を持ちます。@c
1463 それらのオブジェクトを表示するために使用される設定も、@c
1464 コンテキストによって保存されます。@c
1465 それらの設定を変更することにより、オブジェクトの見た目を変えることができます。
1466
1467 コンテキストに保存されるプロパティには 2 種類あります:
1468 コンテキスト プロパティとグラフィカル オブジェクト プロパティです。@c
1469 コンテキスト プロパティは、コンテキスト全体に適用され、@c
1470 コンテキスト自体をどのように表示するかを制御します。@c
1471 対照的に、グラフィカル オブジェクト プロパティは、コンテキストの中に表示される@c
1472 ある特定のタイプのグラフィカル オブジェクトに適用されます。
1473
1474 @code{\set} コマンドと @code{\unset} コマンドは、@c
1475 コンテキスト プロパティの値を変更するために使用されます。@c
1476 @code{\override} コマンドと @code{\revert} コマンドは、@c
1477 グラフィカル オブジェクト プロパティの値を変更するために使用されます。
1478
1479 @ignore
1480 The syntax for this is
1481
1482 @example
1483 \override @var{context}.@var{name} #'@var{property} = #@var{value}
1484 @end example
1485
1486 Here @var{name} is the name of a graphical object, like
1487 @code{Stem} or @code{NoteHead}, and @var{property} is an internal
1488 variable of the formatting system (@q{grob property} or @q{layout
1489 property}).  The latter is a symbol, so it must be quoted.  The
1490 subsection @ref{Modifying properties}, explains what to fill in
1491 for @var{name}, @var{property}, and @var{value}.  Here we only
1492 discuss the functionality of this command.
1493
1494 The command
1495
1496 @verbatim
1497 \override Staff.Stem #'thickness = #4.0
1498 @end verbatim
1499
1500 @noindent
1501 makes stems thicker (the default is 1.3, with staff line thickness as a
1502 unit).  Since the command specifies @code{Staff} as context, it only
1503 applies to the current staff.  Other staves will keep their normal
1504 appearance.  Here we see the command in action:
1505
1506 @lilypond[quote,verbatim,relative=2,fragment]
1507 c4
1508 \override Staff.Stem #'thickness = #4.0
1509 c4
1510 c4
1511 c4
1512 @end lilypond
1513
1514 The @code{\override} command changes the definition of the @code{Stem}
1515 within the current @code{Staff}.  After the command is interpreted
1516 all stems are thickened.
1517
1518 Analogous to @code{\set}, the @var{context} argument may be left out,
1519 causing the default context @code{Voice} to be used.  Adding
1520 @code{\once} applies the change during one timestep only.
1521
1522 @lilypond[quote,fragment,verbatim,relative=2]
1523 c4
1524 \once \override Stem #'thickness = #4.0
1525 c4
1526 c4
1527 @end lilypond
1528
1529 The @code{\override} must be done before the object is
1530 started.  Therefore, when altering @emph{Spanner} objects such as slurs
1531 or beams, the @code{\override} command must be executed at the moment
1532 when the object is created.  In this example,
1533
1534 @lilypond[quote,fragment,verbatim,relative=2]
1535 \override Slur #'thickness = #3.0
1536 c8[( c
1537 \override Beam #'thickness = #0.6
1538 c8 c])
1539 @end lilypond
1540
1541 @noindent
1542 the slur is fatter but the beam is not.  This is because the command for
1543 @code{Beam} comes after the Beam is started, so it has no effect.
1544
1545 Analogous to @code{\unset}, the @code{\revert} command for a context
1546 undoes an @code{\override} command; like with @code{\unset}, it only
1547 affects settings that were made in the same context.  In other words, the
1548 @code{\revert} in the next example does not do anything.
1549
1550 @example
1551 \override Voice.Stem #'thickness = #4.0
1552 \revert Staff.Stem #'thickness
1553 @end example
1554
1555 Some tweakable options are called @q{subproperties} and reside inside
1556 properties.  To tweak those, use commands of the form
1557
1558 @c leave this as a long long
1559 @example
1560 \override @var{context}.@var{name} #'@var{property} #'@var{subproperty} = #@var{value}
1561 @end example
1562
1563 @noindent
1564 such as
1565
1566 @example
1567 \override Stem #'(details beamed-lengths) = #'(4 4 3)
1568 @end example
1569
1570 @end ignore
1571
1572 @seealso
1573 内部リファレンス:
1574 @rinternals{Backend},
1575 @rinternals{All layout objects},
1576 @rinternals{OverrideProperty},
1577 @rinternals{RevertProperty},
1578 @rinternals{PropertySet}
1579
1580
1581 @knownissues
1582
1583 バックエンドはオブジェクト プロパティのタイプ チェックを@c
1584 それほど厳密には行いません。@c
1585 Scheme 値の循環参照は、ハング アップまたはクラッシュ、@c
1586 あるいは両方を引き起こす可能性があります。
1587
1588
1589
1590 @node set コマンド
1591 @subsection @code{\set} コマンド
1592 @translationof The set command
1593
1594 @cindex properties (プロパティ)
1595 @funindex \set
1596 @cindex changing properties (プロパティを変更する)
1597
1598 各コンテキストは @emph{プロパティ} の集合を持ちます。@c
1599 プロパティとは、コンテキストの中に保持されている変数です。@c
1600 コンテキスト プロパティは、@code{\set} コマンドによって変更されます。@c
1601 @code{\set} コマンドは以下のような構文を持ちます:
1602
1603 @example
1604 \set @var{context}.@var{property} = #@var{value}
1605 @end example
1606
1607 @var{value} は Scheme オブジェクトですので、@c
1608 @code{#} 文字を前に置く必要があります。
1609
1610 通常、コンテキスト プロパティの名前は、@c
1611 小文字で始まる単語に大文字で始まる単語をつなげたものです。@c
1612 これらはたいてい音楽から記譜への翻訳を制御します
1613 -- 例えば、@code{localKeySignature} (臨時記号を表示するかどうかを決定します)
1614 や、@code{measurePosition} (小節線を表示するタイミングを決定します) です。@c
1615 コンテキスト プロパティは、楽曲の解釈をしている間、@c
1616 ずっと値を変更しておくことができます。@c
1617 @code{measurePosition} がその良い例です。@c
1618 コンテキスト プロパティは @code{\set} で変更されます。
1619
1620 例えば、コンテキスト プロパティ @code{skipBars} が
1621 @code{#t} にセットされていれば、@c
1622 複小節休符は 1 つの小節に統合されます:
1623
1624 @lilypond[quote,verbatim,relative=2,fragment]
1625 R1*2
1626 \set Score.skipBars = ##t
1627 R1*2
1628 @end lilypond
1629
1630 @var{context} 引数が省略されている場合、@c
1631 プロパティはカレントの最下位のコンテキストにセットされます
1632 (一般に、@code{ChordNames}, @code{Voice}, @code{TabVoice},
1633 あるいは @code{Lyrics} です)。
1634
1635 @lilypond[quote,verbatim,relative=2]
1636 \set Score.autoBeaming = ##f
1637 <<
1638   {
1639     e8 e e e
1640     \set autoBeaming = ##t
1641     e8 e e e
1642   } \\ {
1643     c8 c c c c8 c c c
1644   }
1645 >>
1646 @end lilypond
1647
1648 変更は @q{オンザフライ} (その場、その時々) で適用されるため、@c
1649 設定 @code{\set autoBeaming = ##t} は 2 番目の 8 分音符グループだけに@c
1650 効果を持ちます。
1651
1652 最下位コンテキストが常に変更しようとしているプロパティを持っているとは@c
1653 限らないということに注意してください
1654 -- 例えば、@code{skipBars} プロパティをデフォルトの最下位コンテキスト
1655 (この場合は、@code{Voice} です) にセットしようと試みても、効果はありません。@c
1656 なぜなら、@code{skipBars} は @code{Score} コンテキストのプロパティだからです。
1657
1658 @lilypond[quote,verbatim,relative=2]
1659 R1*2
1660 \set skipBars = ##t
1661 R1*2
1662 @end lilypond
1663
1664 コンテキストは階層構造をとるため、音楽表記を囲っているコンテキスト
1665 -- 例えば、@code{Staff} -- が指定された場合、@c
1666 変更はカレントの @code{Staff} の中にあるすべての @code{Voice} に適用されます。
1667
1668 @funindex \unset
1669
1670 @code{\unset} コマンド:
1671
1672 @example
1673 \unset @var{context}.@var{property}
1674 @end example
1675
1676 @noindent
1677 は、@var{context} から @var{property} の定義を削除するために使用されます。@c
1678 このコマンドは、@var{context} の中にセットされた場合にのみ、定義を削除します。@c
1679 音楽表記を囲っているコンテキストにセットされたプロパティは、@c
1680 囲まれているコンテキストの中にある @code{\unset} では変更されません:
1681
1682 @lilypond[quote,verbatim,relative=2]
1683 \set Score.autoBeaming = ##t
1684 <<
1685   {
1686     \unset autoBeaming
1687     e8 e e e
1688     \unset Score.autoBeaming
1689     e8 e e e
1690   } \\ {
1691     c8 c c c c8 c c c
1692   }
1693 >>
1694 @end lilypond
1695
1696 @code{\set} と同様に、
1697 最下位コンテキストに対しては @var{context} 引数を指定する必要はありません。@c
1698 ですから、以下の 2 つの記述:
1699
1700 @example
1701 \set Voice.autoBeaming = ##t
1702 \set autoBeaming = ##t
1703 @end example
1704
1705 @noindent
1706 は、カレントの最下位コンテキストが @code{Voice} であれば、等価です。
1707
1708
1709 @cindex \once
1710 @code{\set} の前に @code{\once} を置くと、@c
1711 その設定は単一の時間ステップにだけ適用されます:
1712
1713 @lilypond[quote,verbatim,relative=2]
1714 c4
1715 \once \set fontSize = #4.7
1716 c4
1717 c4
1718 @end lilypond
1719
1720 利用可能なすべてのコンテキスト プロパティについての完全な記述は、@c
1721 内部リファレンスにあります。@c
1722 以下を参照してください:
1723 @ifhtml
1724 @rinternals{Tunable context properties}.
1725 @end ifhtml
1726 @ifnothtml
1727 Translation @expansion{} Tunable context properties.
1728 @end ifnothtml
1729
1730 @seealso
1731
1732 内部リファレンス:
1733
1734 @rinternals{Tunable context properties}
1735
1736
1737 @cindex grob properties (グラフィカル オブジェクト プロパティ)
1738 @cindex properties, grob (グラフィカル オブジェクト プロパティ)
1739 @funindex \override
1740
1741
1742 @node override コマンド
1743 @subsection @code{\override} コマンド
1744 @translationof The override command
1745
1746 特殊なタイプのコンテキスト プロパティがあります:
1747 グラフィカル オブジェクト記述です。@c
1748 グラフィカル オブジェクト記述には @code{StudlyCaps} という名前
1749 (大文字で始まります) が付けられています。@c
1750 これらは、関連リストとして、ある特定の種類のグラフィカル オブジェクト用の
1751 @q{デフォルト設定} を保持します。@c
1752 各グラフィカル オブジェクト記述の設定を調べるには、@c
1753 @file{scm/define-grobs.scm} を参照してください。@c
1754 各グラフィカル オブジェクト記述は @code{\override} を用いて変更します。
1755
1756 @code{\override} は、実際のところ、簡略化した記述です。
1757
1758 @example
1759 \override @var{context}.@var{GrobName} #'@var{property} = #@var{value}
1760 @end example
1761
1762 @noindent
1763 これは、以下と等価です:
1764
1765 @c  leave this long line -gp
1766 @example
1767 \set @var{context}.@var{GrobName}  =
1768   #(cons (cons '@var{property} @var{value})
1769          <previous value of @var{context}.@var{GrobName}>)
1770 @end example
1771
1772 @code{context}.@code{GrobName} (alist) の値は、@c
1773 個々のグラフィカル オブジェクトのプロパティを初期化するために使用されます。@c
1774 グラフィカル オブジェクトは、Scheme スタイルの名前
1775 (小文字の単語を @code{-} でつないだもの) のプロパティを持ちます。@c
1776 グラフィカル オブジェクト プロパティの値は、@c
1777 フォーマット処理の間ずっと変更されています:
1778 基本的に、フォーマット処理は、@c
1779 コールバック関数を用いてプロパティを計算することに他なりません。@c
1780
1781 例えば、@code{Stem} オブジェクトの @code{thickness} プロパティを@c
1782 オーバライドすることによって、符幹の太さを太くすることができます:
1783
1784 @lilypond[quote,verbatim,relative=2]
1785 c4 c
1786 \override Voice.Stem #'thickness = #3.0
1787 c4 c
1788 @end lilypond
1789
1790 If no context is specified in an @code{\override}, the bottom
1791 context is used:
1792
1793 @lilypond[quote,verbatim,relative=2]
1794 { \override Staff.Stem #'thickness = #3.0
1795   <<
1796     {
1797       e4 e
1798       \override Stem #'thickness = #0.5
1799       e4 e
1800     } \\ {
1801       c4 c c c
1802     }
1803   >>
1804 }
1805 @end lilypond
1806
1807 @funindex \revert
1808 @cindex reverting overrides (オーバライドを元に戻す)
1809 @cindex overrides, reverting (オーバライドを元に戻す)
1810
1811 @code{\override} の効果は、@code{\revert} によって元に戻すことができます:
1812
1813 @lilypond[quote,verbatim,relative=2]
1814 c4
1815 \override Voice.Stem #'thickness = #3.0
1816 c4 c
1817 \revert Voice.Stem #'thickness
1818 c4
1819 @end lilypond
1820
1821 @code{\override} と @code{\revert} の効果は、@c
1822 その時点から影響を受けるコンテキストの中にある@c
1823 すべてのグラフィカル オブジェクトに適用されます:
1824
1825 @lilypond[quote,verbatim,relative=2]
1826 {
1827   <<
1828     {
1829       e4
1830       \override Staff.Stem #'thickness = #3.0
1831       e4 e e
1832     } \\ {
1833       c4 c c
1834       \revert Staff.Stem #'thickness
1835       c4
1836     }
1837   >>
1838 }
1839 @end lilypond
1840
1841 @funindex \once
1842 @cindex overriding for only one moment (一時的にオーバライドする)
1843
1844 @code{\once} を @code{\override} と共に用いることで、@c
1845 カレントの時間ステップだけに効果を与えることができます:
1846
1847 @lilypond[quote,verbatim,relative=2]
1848 {
1849   <<
1850     {
1851       \override Stem #'thickness = #3.0
1852       e4 e e e
1853     } \\ {
1854       c4
1855       \once \override Stem #'thickness = #3.0
1856       c4 c c
1857     }
1858   >>
1859 }
1860 @end lilypond
1861
1862
1863 @ignore
1864 Commands which change output generally look like
1865
1866 @example
1867 \override Voice.Stem #'thickness = #3.0
1868 @end example
1869
1870 @noindent
1871 To construct this tweak we must determine these bits of information:
1872
1873 @itemize
1874 @item the context: here @code{Voice}.
1875 @item the layout object: here @code{Stem}.
1876 @item the layout property: here @code{thickness}.
1877 @item a sensible value: here @code{3.0}.
1878 @end itemize
1879
1880 Some tweakable options are called @q{subproperties} and reside inside
1881 properties.  To tweak those, use commands in the form
1882
1883 @example
1884 \override Stem #'(details beamed-lengths) = #'(4 4 3)
1885 @end example
1886
1887 @cindex internal documentation
1888 @cindex finding graphical objects
1889 @cindex graphical object descriptions
1890 @cindex tweaking
1891 @funindex \override
1892 @cindex internal documentation
1893
1894 For many properties, regardless of the data type of the property, setting the
1895 property to false ( @code{##f} ) will result in turning it off, causing
1896 LilyPond to ignore that property entirely.  This is particularly useful for
1897 turning off grob properties which may otherwise be causing problems.
1898
1899 We demonstrate how to glean this information from the notation manual
1900 and the program reference.
1901 @end ignore
1902
1903 @seealso
1904
1905 内部リファレンス:
1906 @rinternals{Backend}
1907
1908
1909 @node tweak コマンド
1910 @subsection @code{\tweak} コマンド
1911 @translationof The tweak command
1912
1913 @funindex \tweak
1914 @cindex tweaking (調整)
1915
1916 @code{\tweak} を用いたグラフィカル オブジェクト プロパティの変更は、@c
1917 コンテキストの中にあるすべてのグラフィカル オブジェクトに適用されます。@c
1918 しかしながら、@c
1919 影響を受けるコンテキストの中にあるすべてのグラフィカル オブジェクトではなく、@c
1920 1 つのグラフィカル オブジェクトだけに変更を適用したい場合もあります。@c
1921 そうするには、@code{\tweak} コマンドを用います。@c
1922 @code{\tweak} コマンドは以下のような構文を持ちます:
1923
1924 @example
1925 \tweak #'@code{grob-property} #@code{value}
1926 @end example
1927
1928 @code{\tweak} コマンドは、音楽の流れの中で
1929 @code{value} のすぐ後に現れるオブジェクトに変更を適用します。
1930
1931 @ignore
1932 In some cases, it is possible to take a short-cut for tuning
1933 graphical objects.  For objects that are created directly from
1934 an item in the input file, you can use the @code{\tweak} command.
1935 For example:
1936
1937 @lilypond[relative=2,verbatim,quote]
1938 < c
1939   \tweak #'color #red
1940   d
1941   g
1942   \tweak #'duration-log #1
1943   a
1944 > 4
1945 -\tweak #'padding #8
1946 -^
1947 @end lilypond
1948
1949
1950
1951 But the main use of the @code{\tweak} command is to modify just
1952 one of a number of notation elements which start at the same musical
1953 moment, like the notes of a chord, or tuplet brackets which start
1954 at the same time.
1955
1956 The @code{\tweak} command sets a property in the following object
1957 directly, without requiring the grob name or context to be
1958 specified.  For this to work, it is necessary for the @code{\tweak}
1959 command to remain immediately adjacent to the object to which it is
1960 to apply after the input file has been converted to a music stream.
1961 This is often not the case, as many additional elements are inserted
1962 into the music stream implicitly.  For example, when a note which is
1963 not part of a chord is processed, LilyPond implicitly inserts a
1964 @code{ChordEvent} event before the note, so separating the tweak
1965 from the note.  However, if chord symbols are placed round the
1966 tweak and the note, the @code{\tweak} command comes after the
1967 @code{ChordEvent} in the music stream, so remaining adjacent to the
1968 note, and able to modify it.
1969
1970 So, this works:
1971
1972 @lilypond[relative=2,verbatim,quote]
1973 <\tweak #'color #red c>4
1974 @end lilypond
1975
1976 @noindent
1977 but this does not:
1978
1979 @lilypond[relative=2,verbatim,quote]
1980 \tweak #'color #red c4
1981 @end lilypond
1982
1983 @end ignore
1984
1985 調整コマンドの構文と使用方法についての紹介は、@c
1986 @rlearning{調整手段} を参照してください。
1987
1988 同じようなオブジェクトがいくつか、同じ音楽タイミングで配置されている場合、@c
1989 @code{\override} コマンドでそれらの 1 つだけを変更することはできません
1990 -- @code{\tweak} コマンドを用いる必要があります。@c
1991 同じ音楽タイミングで複数出現する可能性があるオブジェクトには、@c
1992 以下のようなものがあります:
1993
1994 @c TODO expand to include any further uses of \tweak
1995 @itemize
1996 @item 和音の中にある音符の符頭
1997 @item 1 つの音符に付けられるアーティキュレーション記号
1998 @item 和音の中にある音符の間に付けられるタイ
1999 @item 同時に始まる連符の囲み
2000 @end itemize
2001
2002 @c TODO add examples of these
2003
2004 @cindex chord, modifying one note in (和音の中にある音符の 1 つを変更する)
2005
2006 以下の例では、和音の中にある符頭の 1 つの色を変更し、@c
2007 さらに他の符頭のタイプを変更しています:
2008
2009 @lilypond[relative=2,verbatim,quote]
2010 < c
2011   \tweak #'color #red
2012   d
2013   g
2014   \tweak #'duration-log #1
2015   a
2016 > 4
2017 @end lilypond
2018
2019 @code{\tweak} を用いて、スラーを変更することができます:
2020
2021 @lilypond[verbatim,quote,relative=1]
2022 c-\tweak #'thickness #5 ( d e f)
2023 @end lilypond
2024
2025
2026 @code{\tweak} コマンドが機能するためには、@c
2027 入力ファイルが音楽の流れに変換されたときに、@c
2028 @code{\tweak} コマンドのすぐ後に@c
2029 変更が適用されるオブジェクトが配置されている必要があります。
2030 LilyPond は、構文解釈処理時に、@c
2031 追加のオブジェクトを音楽の流れの中に挿入する場合があります。@c
2032 例えば、明示的には和音の一部になっていない音符を、@c
2033 LilyPond が音符の中に配置する場合があります。@c
2034 そのため、@code{\tweak} で変更される音符は、@c
2035 和音構造の中に配置されている必要があります:
2036
2037 @lilypond[relative=2,verbatim,quote]
2038 \tweak #'color #red c4
2039 <\tweak #'color #red c>4
2040 @end lilypond
2041
2042 @code{\tweak} コマンドは、@c
2043 入力ファイルの中で明示的に記述されていないオブジェクトを@c
2044 変更するために用いることはできません。@c
2045 特に、符幹、連桁、あるいは臨時記号を直接変更することはできません。@c
2046 なぜなら、それらは入力の中にある音楽要素の後ではなく、@c
2047 符頭の後に生成されるからです。@c
2048 さらに、音部記号や拍子記号を変更することもできません。@c
2049 なぜなら、コンテキストを指定するために必要とされる追加要素の自動挿入により、@c
2050 それらは前に配置された @code{\tweak} コマンドとは分離されるからです。@c
2051
2052 記譜要素の前に複数の @code{\tweak} コマンドを配置することができます
2053 -- それらはすべて効果を持ちます:
2054
2055 @lilypond[verbatim,quote,relative=1]
2056 c
2057 -\tweak #'style #'dashed-line
2058 -\tweak #'dash-fraction #0.2
2059 -\tweak #'thickness #3
2060 -\tweak #'color #red
2061  \glissando
2062 f'
2063 @end lilypond
2064
2065 入力ファイルのあるセクションから生成される音楽の流れ
2066 -- 自動的に挿入される要素も含めて --
2067 が、検証されます。@c
2068 @rextend{Displaying music expressions} を参照してください。@c
2069 これは、@code{\tweak} コマンドによって変更されるオブジェクトを決定するとき、@c
2070 あるいは、@c
2071 @code{\tweak} の適用で入力を調整する方法を決定するときに役に立つかもしれません。
2072
2073
2074 @seealso
2075 学習マニュアル:
2076 @rlearning{調整手段}
2077
2078 拡張:
2079 @rextend{Displaying music expressions}
2080
2081
2082 @knownissues
2083
2084 @cindex tweaks in a variable (変数の中での調整)
2085 @code{\tweak} コマンドを変数の中で用いることはできません。
2086
2087 @cindex tweaks in lyrics (歌詞の中での調整)
2088 @code{\tweak} コマンドを @code{\lyricmode} の中で用いることはできません。
2089
2090 @cindex tweaking control points (制御ポイントを調整する)
2091 @cindex control points, tweaking (制御ポイントを調整する)
2092
2093 @code{\tweak} コマンドは、和音の中で生成される複数のタイのうち、@c
2094 最初のタイだけに適用されます。
2095
2096
2097 @node set 対 override
2098 @subsection @code{\set} 対 @code{\override}
2099 @translationof set versus override
2100
2101 TODO -- This section is probably unnecessary now.
2102
2103 @ignore
2104 We have seen two methods of changing properties: @code{\set} and
2105 @code{\override}.  There are actually two different kinds of
2106 properties.
2107
2108 @code{fontSize} is a special property: it is equivalent to
2109 entering @code{\override ... #'font-size} for all pertinent
2110 objects.  Since this is a common change, the special
2111 property (modified with @code{\set}) was created.
2112
2113 @end ignore
2114
2115
2116 @node 連想配列を変更する
2117 @subsection 連想配列を変更する
2118 @translationof Modifying alists
2119
2120 ユーザが変更可能なプロパティの中には、@c
2121 内部的には @emph{連想配列} として存在しているものがあります
2122 -- 連想配列は @emph{キー} と @emph{値} のペアの配列を保持します。@c
2123 連想配列の構造は下記のとおりです:
2124
2125 @example
2126 '((@var{キー1} . @var{値1})
2127   (@var{キー2} . @var{値2})
2128   (@var{キー3} . @var{値3})
2129   @dots{})
2130 @end example
2131
2132 ある連想配列がグラフィカル オブジェクト プロパティまたは
2133 @code{\paper} 変数である場合、@c
2134 その連想配列の個々のキーを、他のキーに影響を与えることなく、@c
2135 変更することができます。
2136
2137 例えば、譜グループの中にある隣り合う譜間のスペースを減らすには、@c
2138 @code{StaffGrouper} グラフィカル オブジェクトの
2139 @code{staff-staff-spacing} プロパティを使用します。@c
2140 このプロパティは 4 つのキー
2141 -- @code{basic-distance}, @code{minimum-distance},
2142 @code{padding}, それに @code{stretchability} --
2143 を持つ連想配列です。@c
2144 このプロパティの標準設定は、@c
2145 内部リファレンスの @qq{Backend} セクションでリストアップされています
2146 (@rinternals{StaffGrouper} を参照してください):
2147
2148 @example
2149 '((basic-distance . 9)
2150   (minimum-distance . 7)
2151   (padding . 1)
2152   (stretchability . 5))
2153 @end example
2154
2155 譜間のスペースを小さくする方法の 1 つは、@c
2156 @code{basic-distance} キーの値 (@code{9}) を
2157 @code{minimum-distance} キーの値 (@code{7}) 近くまで減らすことです。@c
2158 個々のキーを変更するには、@emph{ネストされた宣言} を使います:
2159
2160 @c KEEP LY
2161 @lilypond[quote,verbatim]
2162 % デフォルトの譜間スペース
2163 \new PianoStaff <<
2164   \new Staff { \clef treble c''1 }
2165   \new Staff { \clef bass   c1   }
2166 >>
2167
2168 % 譜間スペースを減らします
2169 \new PianoStaff \with {
2170   % this is the nested declaration
2171   \override StaffGrouper #'staff-staff-spacing #'basic-distance = #7
2172 } <<
2173   \new Staff { \clef treble c''1 }
2174   \new Staff { \clef bass   c1   }
2175 >>
2176 @end lilypond
2177
2178 ネストされた宣言は、プロパティの他のキーに変更を加えることなく、@c
2179 指定されたキー (上の例では @code{basic-distance}) を更新します。
2180
2181 今度は、譜を重ならない範囲でできる限り近づけたいとします。@c
2182 最も簡単な方法は、連想配列の 4 つのキーすべてを 0 にセットすることです。@c
2183 しかしながら、4 つのネストされた宣言を記述する必要はありません。@c
2184 1 つの宣言でプロパティを丸ごと再定義することができます:
2185
2186 @lilypond[quote,verbatim]
2187 \new PianoStaff \with {
2188   \override StaffGrouper #'staff-staff-spacing =
2189     #'((basic-distance . 0)
2190        (minimum-distance . 0)
2191        (padding . 0)
2192        (stretchability . 0))
2193 } <<
2194   \new Staff { \clef treble c''1 }
2195   \new Staff { \clef bass   c1   }
2196 >>
2197 @end lilypond
2198
2199 連想配列の再定義でリストアップされなかったキーは、@c
2200 @emph{セットされなかった場合のデフォルト値} にリセットされます。@c
2201 @code{staff-staff-spacing} の場合、@c
2202 セットされなかったキーは 0 にリセットされます
2203 (@code{stretchability} は例外で、セットされなかった場合、@c
2204 @code{basic-distance} にリセットされます)。@c
2205 このため、以下の 2 つの宣言は等価です:
2206
2207 @example
2208 \override StaffGrouper #'staff-staff-spacing =
2209   #'((basic-distance . 7))
2210
2211 \override StaffGrouper #'staff-staff-spacing =
2212   #'((basic-distance . 7)
2213      (minimum-distance . 0)
2214      (padding . 0)
2215      (stretchability . 7))
2216 @end example
2217
2218 連想配列の再定義でリストアップされなかったキーがあることにより、@c
2219 初期化ファイルでセットされたり、@c
2220 入力ファイルがコンパイルされるときに読み込まれた@c
2221 標準設定が (意図せずに) 削除される可能性があります。@c
2222 上の例では、@code{padding} と @code{minimum-distance} の標準設定
2223 (@file{scm/define-grobs.scm} で定義されます) は、@c
2224 @emph{セットされなかった場合のデフォルト値} (両方とも 0) にリセットされます。@c
2225 プロパティや (任意のサイズ) 連想配列を定義した場合、@c
2226 セットされなかったキー値はすべて @emph{セットされなかった場合のデフォルト値}
2227 にリセットされます。@c
2228 そうすることを意図しているのでない限り、@c
2229 ネストされた宣言を用いてキー値を個々に更新する方が安全です。
2230
2231 @warning{ネストされた宣言は、コンテキスト プロパティ連想配列
2232 (@code{beamExceptions}, @code{keySignature}, @code{timeSignatureSettings} 等)
2233 に対しては機能しません。@c
2234 これらのプロパティを変更するには、@c
2235 連想配列として丸ごと再定義するしかありません。}
2236
2237
2238 @node 役に立つコンセプトとプロパティ
2239 @section 役に立つコンセプトとプロパティ
2240 @translationof Useful concepts and properties
2241
2242 @menu
2243 * 入力モード::
2244 * 向きと配置::
2245 * コンテキスト レイアウトの順序::
2246 * 距離と距離の単位::
2247 * 譜記号プロパティ::
2248 * スパナ::
2249 * オブジェクトの可視性::
2250 * ライン スタイル::
2251 * オブジェクトを回転させる::
2252 @end menu
2253
2254
2255 @node 入力モード
2256 @subsection 入力モード
2257 @translationof Input modes
2258
2259 入力ファイルの中に保持されている記譜を解釈する方法は、@c
2260 カレントの入力モードによって決定されます。
2261
2262 @strong{コード モード}
2263
2264 このモードは @code{\chordmode} コマンドで有効になり、@c
2265 入力はコード記譜法の構文で解釈されるようになります。@c
2266 @ref{Chord notation} を参照してください。@c
2267 コードは、譜面上に音符として描画されます。
2268
2269 コード モードは @code{\chords} コマンドでも有効になります。@c
2270 このコマンドは新たに @code{ChordNames} コンテキストも作成します。@c
2271 入力はコード記譜法の構文で解釈され、@c
2272 さらに @code{ChordNames} コンテキストの中にコード ネームとして描画されます。@c
2273 @ref{Printing chord names} を参照してください。
2274
2275 @strong{ドラム モード}
2276
2277 このモードは @code{\drummode} コマンドで有効になり、@c
2278 入力はドラム記譜法の構文で解釈されるようになります。@c
2279 @ref{Basic percussion notation} を参照してください。
2280
2281 また、ドラム モードは @code{\drums} コマンドでも有効になります。@c
2282 このモードも新たに @code{DrumStaff} コンテキストを作成し、@c
2283 コマンドの後に続く入力をドラム記譜法の構文で解釈して、@c
2284 ドラム譜上にドラム記号として描画します。@c
2285 @ref{Basic percussion notation} を参照してください。
2286
2287 @strong{音型モード}
2288
2289 このモードは @code{\figuremode} コマンドで有効になり、@c
2290 入力は通奏低音の構文で解釈されるようになります。@c
2291 @ref{Entering figured bass} を参照してください。
2292
2293 また、音型モードは @code{\figures} コマンドでも有効になります。@c
2294 このモードも新たに @code{FiguredBass} コンテキストを作成し、@c
2295 コマンドの後に続く入力を通奏低音の構文で解釈して、@c
2296 @code{FiguredBass} コンテキストの中に通奏低音記号として描画します。@c
2297 @ref{Introduction to figured bass} を参照してください。
2298
2299 @strong{フレットとタブ モード}
2300
2301 フレット記号とタブ記号を入力するための特別な入力モードはありません。
2302
2303 タブ図を作成するには、音符モードで音符や和音を入力して、@c
2304 それらを @code{TabStaff} コンテキストの中に描画します。@c
2305 @ref{Default tablatures} を参照してください。
2306
2307 譜の上にフレット図を作成するには、2 つの方法があります。@c
2308 @code{FretBoards} コンテキスト
2309 (@ref{Automatic fret diagrams} を参照してください) を用いるか、@c
2310 あるいは、音符の上に @code{\fret-diagram} コマンド
2311 (@ref{Fret diagram markups}) を用いてフレット図をマークアップとして@c
2312 入力するかのどちらかになります。
2313
2314 @strong{歌詞モード}
2315
2316 このモードは @code{\lyricmode} コマンドで有効になり、@c
2317 入力はオプションで演奏時間を持つ歌詞音節として解釈され、@c
2318 歌詞識別子に関連付けされます。@c
2319 通奏低音の構文で解釈されるようになります。@c
2320 @ref{Vocal music} を参照してください。
2321
2322 また、歌詞モードは @code{\addlyrics} コマンドでも有効になります。@c
2323 このモードも新たに @code{Lyrics} コンテキストを作成し、@c
2324 暗黙的に @code{lyricsto} コマンドを作成します。@c
2325 @code{lyricsto} は、後に続く歌詞を、前にある音楽に関連付けします。
2326
2327 @strong{マークアップ モード}
2328
2329 このモードは @code{\markup} コマンドで有効になり、@c
2330 入力はマークアップの構文で解釈されるようになります。@c
2331 @ref{Text markup commands} を参照してください。
2332
2333 @c silly work-around for texinfo broken-ness
2334 @c (@strong{Note...} causes a spurious cross-reference in Info)
2335 @strong{音符モード}
2336
2337 このモードはデフォルトのモードであり、@c
2338 @code{\notemode} コマンドで有効にすることもできます。@c
2339 入力はピッチ、演奏時間、マークアップなどとして解釈され、@c
2340 譜面上に音楽記譜として写植されます。
2341
2342 通常、音符モードを明示的に指定する必要はありません。@c
2343 しかしながら、ある特定の状況
2344 -- 例えば、歌詞モード、和音モード、あるいは他のモードを使っていて、@c
2345 音符モードの構文でしか入力できないものを入力しようとしている場合 --
2346 では、音符モードを明示的に指定することが有用な場合があります。
2347
2348 例えば、合唱曲で節ごとに強弱記号を指定するには、@c
2349 音符モードで入力して記号を解釈させる必要があります:
2350
2351 @lilypond[verbatim,relative=2,quote]
2352 { c4 c4 c4 c4 }
2353 \addlyrics {
2354   \notemode{\set stanza = \markup{ \dynamic f 1. } }
2355   To be sung loudly
2356 }
2357 \addlyrics {
2358   \notemode{\set stanza = \markup{ \dynamic p 2. } }
2359   To be sung quietly
2360 }
2361 @end lilypond
2362
2363
2364 @node 向きと配置
2365 @subsection 向きと配置
2366 @translationof Direction and placement
2367
2368 楽譜を写植しているとき、多くの要素の向きと配置には選択の余地があります。@c
2369 例えば、音符の符幹は上向きあるいは下向きにすることができ、@c
2370 歌詞、強弱記号、他の表現記号は譜の上あるいは下に配置することができ、@c
2371 テキストは左揃え、右揃え、あるいは中央揃えにすることができる、などです。@c
2372 これらの選択のほとんどは LilyPond によって自動的に決定されますが、@c
2373 強制的に向きや配置を指定することが望ましい場合もあります。
2374
2375 @strong{アーティキュレーションの方向指示子}
2376
2377 デフォルトでは、アーティキュレーションのいくつかの向きは常に上または下に@c
2378 なっています (例えば、強弱記号やフェルマータ)。@c
2379 一方、他のアーティキュレーションは、符幹の向きによって、@c
2380 向きが上下します (スラーやアクセントなど)。
2381
2382 @c TODO Add table showing these
2383
2384 アーティキュレーションの前に @emph{方向指示子} を置くことで、@c
2385 デフォルトの向きをオーバライドすることができます。@c
2386 3 つの方向指示子があります: @code{^} (@qq{上向き} を意味します)、@c
2387 @code{_} (@qq{下向き} を意味します)、@c
2388 それに @code{-} (@qq{デフォルトの向き} を意味します) です。@c
2389 通常、方向指示子は省略することができ、その場合は @code{-} と見なされます。@c
2390 しかしながら、以下のものの前には @strong{常に} 方向指示子を置く必要があります:
2391
2392 @itemize
2393 @item @code{\tweak} コマンド
2394 @item @code{\markup} コマンド
2395 @item @code{\tag} コマンド
2396 @item 文字列マークアップ。例えば、-"string"
2397 @item 運指指示。例えば、@code{-1}
2398 @item アーティキュレーションの短縮記法。例えば、@code{-.}, @code{->}, @code{--}
2399 @end itemize
2400
2401 方向指示子は、その後にくる音符だけに効果を持ちます:
2402
2403 @lilypond[verbatim,quote,relative=2]
2404 c2( c)
2405 c2_( c)
2406 c2( c)
2407 c2^( c)
2408 @end lilypond
2409
2410 @strong{方向プロパティ}
2411
2412 多くのレイアウト オブジェクトの位置や向きは、@c
2413 @code{direction} プロパティによって制御されます。
2414
2415 @code{direction} プロパティの値は、@c
2416 @code{1} (@qq{上向き} あるいは @qq{上} を意味します)、@c
2417 @code{-1} (@qq{下向き} あるいは @qq{下} を意味します)
2418 にセットすることができます。@c
2419 記号 @code{UP} と @code{DOWN} は、@c
2420 それぞれ @code{1} と @code{-1} の代わりに用いることができます。@c
2421 デフォルトの向きを指定するには、@c
2422 @code{direction} を @code{0} あるいは @code{CENTER} にセットします。@c
2423 このような方法を用いる代わりに、@c
2424 多くの場合で、向きを指定するための前置コマンドが存在しています。@c
2425 それらはすべて以下のような形式をとります:
2426
2427 @noindent
2428 @code{\xxxUp}, @code{xxxDown}, @code{xxxNeutral}
2429
2430 @noindent
2431 ここで、@code{xxxNeutral} は @qq{デフォルトの向きを使用する}
2432 ことを意味します。@c
2433 @rlearning{譜表内部オブジェクト} を参照してください。
2434
2435 いくつかのケースでは
2436 -- 一般的な例としてはアルペジオしかありません --
2437 @code{direction} プロパティの値は、@c
2438 オブジェクトが親オブジェクトの左右どちらに配置されるかを指定します。
2439 この場合、@code{-1} あるいは @code{LEFT} は @qq{左側} を意味し、@c
2440 @code{1} あるいは @code{RIGHT} は @qq{右側} を意味します。@c
2441 @code{0} あるいは @code{CENTER} は、前のケースと同様に、@c
2442 @qq{デフォルトの向きを使用する} ことを意味します。
2443
2444 @ignore
2445 These all have side-axis set to #X
2446 AmbitusAccidental - direction has no effect
2447 Arpeggio - works
2448 StanzaNumber - not tried
2449 TrillPitchAccidental - not tried
2450 TrillPitchGroup - not tried
2451 @end ignore
2452
2453 これらの指示子は、キャンセルされるまで効果を持ちます。
2454
2455 @lilypond[verbatim,quote,relative=2]
2456 c2( c)
2457 \slurDown
2458 c2( c)
2459 c2( c)
2460 \slurNeutral
2461 c2( c)
2462 @end lilypond
2463
2464
2465 @node コンテキスト レイアウトの順序
2466 @subsection コンテキスト レイアウトの順序
2467 @translationof Context layout order
2468
2469 @cindex contexts, layout order (コンテキスト レイアウトの順序)
2470
2471 通常、コンテキストは、入力ファイルの中で出現した順番に、@c
2472 システムの上から下へと配置されます。@c
2473 コンテキストがネストされている場合、@c
2474 入力ファイルの中で内側にネストされたコンテキストが@c
2475 外側のコンテキストの @q{accepts} リストの中に含まれているのなら、@c
2476 外側のコンテキストの内部に配置されます。@c
2477 外側のコンテキストの @qq{accepts} リストに含まれていない場合、@c
2478 外側のコンテキストの内部ではなく、下に再配置されます。
2479
2480 入力ファイルの中で、@c
2481 出現したコマンドを保持する適当なコンテキストが存在しない場合、@c
2482 コンテキストが暗黙的に作成されます。@c
2483 これは、予期しない譜やスコアを生み出す可能性があります。
2484
2485 コンテキストが配置される順序や @qq{accepts} リストは変更することができます。@c
2486 @ref{コンテキストを揃える} を参照してください。
2487
2488 @seealso
2489 アプリケーション使用方法:
2490 @rprogram{余計な譜が表示される}
2491
2492
2493 @node 距離と距離の単位
2494 @subsection 距離と距離の単位
2495 @translationof Distances and measurements
2496
2497 @cindex distances, absolute (絶対距離)
2498 @cindex distances, scaled (相対距離)
2499
2500 @funindex \mm
2501 @funindex \cm
2502 @funindex \in
2503 @funindex \pt
2504
2505 LilyPond における距離には 2 つのタイプがあります: 絶対距離と相対距離です。
2506
2507 絶対距離は、マージン、インデント、それにその他の詳細なページ レイアウトを@c
2508 指定するために使用され、デフォルトではミリメートルで指定されます。
2509 距離は以下の単位で指定することもできます: @code{\mm}, @code{\cm},
2510 @code{\inch} (インチ), それに @code{\pt} (ポイント。1/73.27 インチ) です。@c
2511 また、ページ レイアウトにおける距離は、@c
2512 値の後ろに @code{\staff-space} を付けることにより、
2513 比率で指定することもできます (次の段落を参照してください)。@c
2514 ページ レイアウトについての詳細は、@c
2515 @ref{ページ レイアウト} に記述されています。
2516
2517 相対距離は常に譜スペースを単位として指定されます
2518  -- 稀に、半譜スペースが使用されます。@c
2519 譜スペースは隣り合う 2 本の譜線間の距離です。@c
2520 グローバル譜サイズを設定することにより、@c
2521 デフォルト値をグローバルに変更することができます。@c
2522 また、@code{StaffSymbol} の @code{staff-space} プロパティを@c
2523 変更することにより、譜スペースをローカルにオーバライドすることもできます。@c
2524 相対距離は、グローバル譜サイズや @code{StaffSymbol} の @code{staff-space}
2525 プロパティのいずれかが変更されると、自動的に変更されます。@c
2526 しかしながら、フォントの比率はグローバル譜サイズが変更された場合にのみ、@c
2527 自動的に変更されます。@c
2528 そのため、グローバル譜サイズは@c
2529 容易に描画される楽譜全体のサイズを変更することができます。@c
2530 グローバル譜サイズを設定するための手段については、@c
2531 @ref{譜サイズを設定する} を参照してください。
2532
2533 @funindex magstep
2534
2535 楽譜のある部分だけの比率を変更したいのなら
2536 -- 例えば、オッシア セクションや脚注で --
2537 単純にグローバル譜サイズを変更するわけにはいきません。@c
2538 なぜなら、グローバル譜サイズを変更すると、楽譜全体が影響を受けるからです。@c
2539 そのような場合、@code{StaffSymbol} の @code{staff-space} プロパティと@c
2540 フォントのサイズをオーバライドすることにより、サイズを変更します。@c
2541 フォント サイズの変更を @code{staff-space} 単位の変更に変換するには、@c
2542 Scheme 関数 @code{magstep} を使用することができます。@c
2543 この関数の説明と使用例については、@c
2544 @rlearning{オブジェクトの長さと太さ} を参照してください。
2545
2546
2547 @seealso
2548 学習マニュアル:
2549 @rlearning{オブジェクトの長さと太さ}
2550
2551 記譜法リファレンス:
2552 @ref{ページ レイアウト},
2553 @ref{譜サイズを設定する}
2554
2555
2556 @node 譜記号プロパティ
2557 @subsection 譜記号プロパティ
2558 @translationof Staff symbol properties
2559
2560 @cindex adjusting staff symbol (譜記号を調節する)
2561 @cindex drawing staff symbol (譜記号を描画する)
2562 @cindex staff symbol, setting of (譜記号の設定)
2563
2564 @c TODO Extend or remove this section.  See also NR 1.6.2 Staff symbol
2565 @c      Need to think of uses for these properties.  Eg 'line-positions
2566 @c      is used in a snippet to thicken centre line.
2567 @c      If retained, add @ref to here in 1.6.2  -td
2568
2569 譜線の垂直位置と譜線の本数を同時に定義することができます。@c
2570 以下の例が示すように、音符の位置は譜線の位置には影響されません。
2571
2572 @warning{@code{'line-positions} プロパティは @code{'line-count} を@c
2573 オーバライドします。@c
2574 譜線の本数は、@code{'line-positions} の値リストの中にある要素数によって、@c
2575 暗黙的に定義されます。}
2576
2577 @lilypond[verbatim,quote,relative=1]
2578 \new Staff \with {
2579   \override StaffSymbol #'line-positions = #'(7 3 0 -4 -6 -7)
2580 }
2581 { a4 e' f b | d1 }
2582 @end lilypond
2583
2584 譜の幅を変更することができます。@c
2585 単位は譜スペースです。@c
2586 譜内部のオブジェクトのスペースは、この設定によって影響を受けません。
2587
2588 @lilypond[verbatim,quote,relative=1]
2589 \new Staff \with {
2590   \override StaffSymbol #'width = #23
2591 }
2592 { a4 e' f b | d1 }
2593 @end lilypond
2594
2595
2596 @node スパナ
2597 @subsection スパナ
2598 @translationof Spanners
2599
2600 多くの音楽記譜オブジェクトは、複数の音符あるいは複数の小節にまたがって、@c
2601 広がりを持ちます。@c
2602 例としては、スラー、連桁、連譜の囲み、volta 繰り返しの囲み、クレッシェンド、@c
2603 トリル、それにグリッサンドがあります。@c
2604 そのようなオブジェクトは総称して @qq{スパナ} と呼ばれ、@c
2605 それらの見た目と振る舞いを制御するための特殊なプロパティを持ちます。@c
2606 これらのプロパティのいくつかは、すべてのスパナに共通しています。@c
2607 他のプロパティはスパナの部分集合に限定されています。
2608
2609 すべてのスパナは @code{spanner-interface} をサポートします。@c
2610 いくつかのスパナ -- 2 つのオブジェクトの間に直線を描くもの -- は、さらに、@c
2611 @code{line-spanner-interface} をサポートします。
2612
2613
2614 @unnumberedsubsubsec @code{spanner-interface} を使用する
2615
2616 このインターフェイスは、@c
2617 いくつかのスパナに適用される 2 つのプロパティを提供します。
2618
2619 @strong{@i{@code{minimum-length} プロパティ}}
2620
2621 スパナの最短の長さは、@code{minimum-length} プロパティによって指定されます。@c
2622 通常、このプロパティを増加させると、@c
2623 スパナの両端の間にある音符の間隔は増加します。@c
2624 しかしながら、このオーバライドは多くのスパナで効果を持ちません。@c
2625 なぜなら、それらの長さは他の要素によって決定されるからです。@c
2626 以下に効果を持つ例を 2, 3 示します。
2627
2628 @ignore
2629 Works for:
2630   Tie
2631   MultiMeasureRest
2632   Hairpin
2633   Slur
2634   PhrasingSlur
2635
2636 Works as long as callback is made:
2637   Glissando
2638   Beam
2639
2640 Works not at all for:
2641   LyricSpace
2642   LyricHyphen
2643   LyricExtender
2644   TextSpanner
2645   System
2646
2647 @end ignore
2648
2649 @c KEEP LY
2650 @lilypond[verbatim,quote,relative=2]
2651 a~a
2652 a
2653 % タイの長さを増加させます
2654 -\tweak #'minimum-length #5
2655 ~a
2656 @end lilypond
2657
2658 @c KEEP LY
2659 @lilypond[verbatim,quote,relative=2]
2660 a1
2661 \compressFullBarRests
2662 R1*23
2663 % 休符バーの長さを増加させます
2664 \once \override MultiMeasureRest #'minimum-length = #20
2665 R1*23
2666 a1
2667 @end lilypond
2668
2669 @c KEEP LY
2670 @lilypond[verbatim,quote,relative=2]
2671 a \< a a a \!
2672 % ヘアピンの長さを増加させます
2673 \override Hairpin #'minimum-length = #20
2674 a \< a a a \!
2675 @end lilypond
2676
2677 さらに、このオーバライドはスラーとフレージング スラーの長さを@c
2678 増加させるためにも使用されます:
2679
2680 @lilypond[verbatim,quote,relative=2]
2681 a( a)
2682 a
2683 -\tweak #'minimum-length #5
2684 ( a)
2685
2686 a\( a\)
2687 a
2688 -\tweak #'minimum-length #5
2689 \( a\)
2690 @end lilypond
2691
2692 いくつかのレイアウト オブジェクトでは、@c
2693 @code{minimum-length} プロパティは、@c
2694 @code{set-spacing-rods} プロシージャが明示的に呼び出された場合にのみ@c
2695 効果を持ちます。@c
2696 このプロシージャを呼び出すには、@code{springs-and-rods} プロパティに@c
2697 @code{ly:spanner::set-spacing-rods} をセットしておく必要があります。@c
2698 例えば、グリッサンドの最短長は、@c
2699 @code{springs-and-rods} プロパティが設定されていない限り、@c
2700 効果を持ちません:
2701
2702 @c KEEP LY
2703 @lilypond[verbatim,quote,relative=1]
2704 % デフォルト
2705 e \glissando c'
2706
2707 % 単独では効果を持ちません
2708 \once \override Glissando #'minimum-length = #20
2709 e, \glissando c'
2710
2711 % 以下の両方のオーバライドが存在する場合にのみ、効果を持ちます
2712 \once \override Glissando #'minimum-length = #20
2713 \once \override Glissando #'springs-and-rods = #ly:spanner::set-spacing-rods
2714 e, \glissando c'
2715 @end lilypond
2716
2717 @code{Beam} オブジェクトでも同じことが言えます:
2718
2719 @c KEEP LY
2720 @lilypond[verbatim,quote,relative=1]
2721 % 単独では効果を持ちません
2722 \once \override Beam #'minimum-length = #20
2723 e8 e e e
2724
2725 % 以下の両方のオーバライドが存在する場合にのみ、効果を持ちます
2726 \once \override Beam #'minimum-length = #20
2727 \once \override Beam #'springs-and-rods = #ly:spanner::set-spacing-rods
2728 e8 e e e
2729 @end lilypond
2730
2731
2732 @strong{@i{@code{to-barline} プロパティ}}
2733
2734 @code{spanner-interface} の 2 番目に有用なプロパティは
2735 @code{to-barline} です。@c
2736 デフォルトではこのプロパティは真であり、@c
2737 小節の最初の音符のところで終了するヘアピンや他のスパナは@c
2738 直前の小節線のところで終了させられます。@c
2739 偽に設定すると、スパナは小節線を越えて、音符のところで終了します:
2740
2741 @lilypond[verbatim,quote,relative=2]
2742 a \< a a a a \! a a a \break
2743 \override Hairpin #'to-barline = ##f
2744 a \< a a a a \! a a a
2745 @end lilypond
2746
2747 このプロパティはすべてのスパナに対して効果を持つわけではありません。@c
2748 例えば、スラーやフレージング スラー、@c
2749 あるいは小節線で終了させることに意味が無い他のスパナに対して、@c
2750 このプロパティを @code{#t} に設定しても効果がありません。
2751
2752
2753 @unnumberedsubsubsec @code{line-spanner-interface} を使用する
2754
2755 @code{line-spanner-interface} をサポートするオブジェクトには@c
2756 以下のものがあります:
2757
2758 @itemize
2759 @item @code{DynamicTextSpanner}
2760 @item @code{Glissando}
2761 @item @code{TextSpanner}
2762 @item @code{TrillSpanner}
2763 @item @code{VoiceFollower}
2764 @end itemize
2765
2766 これらのスパナのステンシルを描画する責任を持つルーチンは
2767 @code{ly:line-interface::print} です。@c
2768 このルーチンはスパナの両端の位置を綿密に決定し、@c
2769 求めに応じたスタイルでそれらの間に線を描きます@c
2770 スパナの両端の位置はオンザフライ (その場、その時々) で算出されますが、@c
2771 それらの Y 座標をオーバライドすることができます。@c
2772 指定する必要のあるプロパティは、@c
2773 プロパティ階層内で 2 階層下にネストされていますが、@c
2774 この @code{\override} コマンドは非常にシンプルです:
2775
2776 @lilypond[relative=2,quote,verbatim]
2777 e2 \glissando b
2778 \once \override Glissando #'(bound-details left Y) = #3
2779 \once \override Glissando #'(bound-details right Y) = #-2
2780 e2 \glissando b
2781 @end lilypond
2782
2783 @code{Y} プロパティの単位は @code{staff-space} であり、@c
2784 譜の中央線が 0 位置です。@c
2785 グリッサンドでは、スパナの両端は各符頭の中心であり、@c
2786 @code{Y} はそれらの点を上下させます。
2787
2788 @code{Y} が設定されていない場合、@c
2789 値はスパナの両端の垂直位置から算出されます。
2790
2791 改行の場合、終点の @code{Y} の値は @code{bound-details} の@c
2792 部分リスト @code{left-broken} や @code{right-broken} のによって指定されます。@c
2793 例を示します:
2794
2795 @lilypond[relative=2,ragged-right,verbatim,fragment]
2796 \override Glissando #'breakable = ##t
2797 \override Glissando #'(bound-details right-broken Y) = #-3
2798 c1 \glissando \break
2799 f1
2800 @end lilypond
2801
2802
2803 @code{bound-details} プロパティの部分リスト @code{left} や @code{right} の@c
2804 下位プロパティのいくつかは、@code{Y} と同じ方法で変更することができます:
2805
2806 @table @code
2807 @item Y
2808 終点の Y 座標を、@c
2809 譜の中央線からの @code{staff-space} オフセットで、設定します。@c
2810 デフォルトでは、終点オブジェクトの中心です。@c
2811 ですから、グリッサンドは符頭の中心に向かって進みます。
2812
2813 水平方向に広がるスパナ -- テキスト スパナやトリル スパナなど --
2814 では、この値は 0 に固定されています。
2815
2816 @item attach-dir
2817 スパナのラインがオブジェクトの左右どちらから始まり、終わるのかを決定します。@c
2818 @code{-1} (あるいは @code{LEFT}) であれば、@c
2819 ラインは符頭の左側から開始あるいは終了します。
2820
2821 @item X
2822 終点の絶対 X 座標です。@c
2823 通常、オンザフライ (その場、その時々) で算出され、@c
2824 これをオーバライドしてもあまり意味がありません。
2825
2826 @item stencil
2827 ライン スパナは開始点や終了点で記号を持つ場合があり、@c
2828 その記号はこのサブ プロパティに保持されています。@c
2829 このサブ プロパティは内部で使用するためのものです。@c
2830 このサブ プロパティの代わりに @code{text} を使用することを推奨します。
2831
2832 @item text
2833 ステンシルを作成するために評価されるマークアップです。@c
2834 水平スパナに @i{cresc.}, @i{tr} それに他のテキストを配置するために使用されます。
2835
2836 @lilypond[quote,ragged-right,fragment,relative=2,verbatim]
2837 \override TextSpanner #'(bound-details left text)
2838    = \markup { \small \bold Slower }
2839 c2\startTextSpan b c a\stopTextSpan
2840 @end lilypond
2841
2842 @item stencil-align-dir-y
2843 @item stencil-offset
2844 これらの 1 つを設定しなければ、@c
2845 ステンシルは、@code{X} と @code{Y} サブ プロパティで定義されたとおりに、@c
2846 ラインに中央揃えで、終点に配置されます。@c
2847 @code{stencil-align-dir-y} あるいは @code{stencil-offset} の@c
2848 どちらかを設定すると、@c
2849 記号が上下します:
2850
2851 @lilypond[relative=1,fragment,verbatim]
2852 \override TextSpanner
2853   #'(bound-details left stencil-align-dir-y) = #-2
2854 \override TextSpanner
2855   #'(bound-details right stencil-align-dir-y) = #UP
2856
2857 \override TextSpanner
2858   #'(bound-details left text) = #"ggg"
2859 \override TextSpanner
2860   #'(bound-details right text) = #"hhh"
2861 c4^\startTextSpan c c c \stopTextSpan
2862 @end lilypond
2863
2864 予期される結果とは逆に、@c
2865 負の値はテキストを @emph{上げる} ということに注意してください。@c
2866 なぜなら、@code{-1} あるいは @code{DOWN} は@c
2867 テキストの @emph{下端} をスパナ ラインに揃え、
2868 @code{1} あるいは @code{UP} は@c
2869 テキストの @emph{上端} をスパナ ラインに揃えるからです。
2870
2871 @item arrow
2872 このサブ プロパティに @code{#t} をセットするとラインの終点に矢印が描かれます。
2873
2874 @item padding
2875 このサブ プロパティはラインの終点と実際の終点の間のスペースを制御します。@c
2876 パディングがなければ、グリッサンドは両端の符頭の中心から描かれます。
2877
2878 @end table
2879
2880 音楽関数 @code{\endSpanners} は@c
2881 直後の音符から始まるスパナをすぐに終了させます。@c
2882 ちょうど 1 音符分でスパナを終了させますが、@c
2883 @code{to-barline} が真で、かつ、次の音符の前に小節線がある場合は@c
2884 その小節線のところでスパナを終了させます。
2885
2886 @lilypond[verbatim,quote,ragged-right,relative=2,fragment]
2887 \endSpanners
2888 c2 \startTextSpan c2 c2
2889 \endSpanners
2890 c2 \< c2 c2
2891 @end lilypond
2892
2893 @code{\endSpanners} を使用している場合、@c
2894 @code{\startTextSpan} を @code{\endTextSpan} で閉じる必要はなく、@c
2895 ヘアピンを @code{\!} で閉じる必要もありません。
2896
2897
2898 @seealso
2899 内部リファレンス:
2900 @rinternals{TextSpanner},
2901 @rinternals{Glissando},
2902 @rinternals{VoiceFollower},
2903 @rinternals{TrillSpanner},
2904 @rinternals{line-spanner-interface}
2905
2906
2907 @node オブジェクトの可視性
2908 @subsection オブジェクトの可視性
2909 @translationof Visibility of objects
2910
2911 @cindex objects, visibility of (オブジェクトの可視性)
2912 @cindex grobs, visibility of (グラフィカル オブジェクトの可視性)
2913 @cindex visibility of objects (オブジェクトの可視性)
2914
2915 レイアウト オブジェクトの可視性を制御する主な方法は 4 つあります:
2916 オブジェクトのステンシルを削除する方法、オブジェクトを透明にする方法、@c
2917 オブジェクトの色を白にする方法、あるいは、@c
2918 オブジェクトの @code{break-visibility} プロパティをオーバライドする方法です。
2919 最初の 3 つの方法はすべてのレイアウト オブジェクトに適用されますが、@c
2920 最後の方法はいくつかの -- @emph{改行可能な} オブジェクト --
2921 だけに適用されます。@c
2922 学習マニュアルでは、これら 4 つのテクニックについて紹介しています。@c
2923 @rlearning{オブジェクトの可視性と色} を参照してください。
2924
2925 さらに、特定のレイアウト オブジェクト特有のテクニックがいくつかあります。@c
2926 それらについては、特別な考慮でカバーされています。
2927
2928 @menu
2929 * ステンシルを削除する::
2930 * オブジェクトを透明にする::
2931 * オブジェクトを白で描く::
2932 * break-visibility を用いる::
2933 * 特別な考慮を必要とするもの::
2934 @end menu
2935
2936
2937 @node ステンシルを削除する
2938 @unnumberedsubsubsec ステンシルを削除する
2939 @translationof Removing the stencil
2940
2941 @cindex stencil, removing (ステンシルを削除する)
2942
2943 レウアウト オブジェクトはそれぞれステンシル プロパティを持ちます。@c
2944 デフォルトでは、@c
2945 このプロパティはそのオブジェクトを描画する特殊な関数にセットされています。@c
2946 このプロパティが @code{#f} にオーバライドされた場合、@c
2947 関数は呼び出されず、そのオブジェクトは描画されません。@c
2948 @code{\rever} でデフォルトの動作に戻すことができます。
2949
2950 @lilypond[quote,verbatim,relative=1]
2951 a1 a
2952 \override Score.BarLine #'stencil = ##f
2953 a a
2954 \revert Score.BarLine #'stencil
2955 a a a
2956 @end lilypond
2957
2958 @node オブジェクトを透明にする
2959 @unnumberedsubsubsec オブジェクトを透明にする
2960 @translationof Making objects transparent
2961
2962 @cindex transparent, making objects (オブジェクトを透明にする)
2963
2964 レイアウト オブジェクトはそれぞれ @code{transparent} プロパティを持っていて、@c
2965 デフォルトでは @code{#f} にセットされています。@c
2966 @code{#t} にセットされると、そのオブジェクトはスペースを占めたままですが、@c
2967 不可視になります。
2968
2969 @lilypond[quote,verbatim,relative=2]
2970 a4 a
2971 \once \override NoteHead #'transparent = ##t
2972 a a
2973 @end lilypond
2974
2975 @node オブジェクトを白で描く
2976 @unnumberedsubsubsec オブジェクトを白で描く
2977 @translationof Painting objects white
2978
2979 @cindex objects, coloring (オブジェクトに色を付ける)
2980 @cindex coloring objects (オブジェクトに色を付ける)
2981 @cindex layers (レイヤ)
2982 @cindex printing order (描画の順番)
2983 @cindex overwriting objects (オブジェクトを上書きする)
2984 @cindex objects, overwriting (オブジェクトを上書きする)
2985 @cindex grobs, overwriting (グラフィカル オブジェクトを上書きする)
2986
2987 レイアウト オブジェクトはそれぞれ @code{color} プロパティを持っていて、@c
2988 デフォルトでは @code{black} にセットされています。@c
2989 このプロパティが @code{white} にセットされてると、@c
2990 そのオブジェクトは白い背景と区別が付かなくなります。@c
2991 しかしながら、そのオブジェクトが他のオブジェクトと交差している場合、@c
2992 交差している場所の色はオブジェクトの描画順序によって決定されます。@c
2993 これにより、以下に示すように、@c
2994 白いオブジェクトの画像が幽霊のように浮かび上がることがあります:
2995
2996 @lilypond[quote,verbatim,relative=2]
2997 \override Staff.Clef #'color = #white
2998 a1
2999 @end lilypond
3000
3001 オブジェクトの描画順序を変更することにより、これを回避することができます。@c
3002 すべてのレイアウト オブジェクトは @code{layer} プロパティを持っており、@c
3003 このプロパティには整数がセットされています。@c
3004 より小さな値の @code{layer} を持つオブジェクトが最初に描画され、@c
3005 より大きな値の @code{layer} を持つオブジェクトが後になってから描画されます。@c
3006 このため、@c
3007 より大きな値を持つオブジェクトがより小さな値を持つオブジェクトを上書きします。@c
3008 デフォルトでは、@c
3009 たいていのオブジェクトの @code{layer} には @code{1} が代入されています。@c
3010 しかしながら、いくつかのオブジェクト
3011 -- @code{StaffSymbol} や @code{BarLine} など --
3012 には @code{0} が代入されています。@c
3013 同じ値の @code{layer} を持つオブジェクトを描画する順番は不確定です。
3014
3015 上記の例において、白い音部記号
3016 (この @code{layer} のデフォルト値は @code{1} です)
3017 は譜線 @c
3018 (この @code{layer} のデフォルト値は @code{0} です)
3019 の後に描画されます。@c
3020 そのため、音部記号は譜線を上書きしています。@c
3021 これを変更するには、@code{Clef} オブジェクトの @code{layer} に@c
3022 より小さな値 -- 例えば、@code{-1} -- を与えて、@c
3023 音部記号を先に描画させる必要があります:
3024
3025 @lilypond[quote,verbatim,relative=2]
3026 \override Staff.Clef #'color = #white
3027 \override Staff.Clef #'layer = #-1
3028 a1
3029 @end lilypond
3030
3031 @node break-visibility を用いる
3032 @unnumberedsubsubsec break-visibility を用いる
3033 @translationof Using break-visibility
3034
3035 @c TODO Add making other objects breakable
3036
3037 @cindex break-visibility
3038
3039 たいていのレイアウト オブジェクトは 1 回だけ描画されます。@c
3040 しかしながら、小節線、音部記号、拍子記号、それに調号などのオブジェクトは、@c
3041 改行が起こると 2 回描画する必要があります
3042 -- 行の最後で 1 回、次の行の最初でもう 1 回。@c
3043 そのようなオブジェクトは @emph{改行可能} と呼ばれ、@c
3044 それらのオブジェクトが描画される可能性がある 3 つの場所
3045 -- 行の先頭、行の途中 (それらが変更された場合)、@c
3046 それに、行の最後 (そこで変更が行われた場合) --
3047 における可視性を制御する @code{break-visibility} プロパティを持ちます。
3048
3049 例えば、デフォルトでは拍子記号は最初の行の先頭で描画されますが、@c
3050 変更されない限り他の場所には描画されません。@c
3051 変更された場合、拍子記号は変更が行われた場所に描画されます。@c
3052 この変更が行の最後で行われた場合、新しい拍子記号は次の行の先頭に描画され、@c
3053 その前の行の最後にも忠告の拍子記号が描画されます。
3054
3055 この振る舞いは @code{break-visibility} プロパティによって制御されます。@c
3056 このプロパティについての説明は
3057 @c Leave this ref on a newline - formats incorrectly otherwise -td
3058 @rlearning{オブジェクトの可視性と色}
3059 を参照してください。@c
3060 このプロパティは 3 つのブール値からなるベクトルをとり、@c
3061 順に、そのオブジェクトが行の最後で描画されるかどうか、@c
3062 行の途中で描画されるかどうか、@c
3063 そして、行の先頭で描画されるかどうかを決定します。@c
3064 より正確には、改行の前、改行がない場合、改行の後です。
3065
3066 @code{break-visibility} プロパティによって制御する代わりに、@c
3067 これら 8 通りの組み合わせを @file{scm/output-lib.scm} で定義されている@c
3068 定義済み関数によって指定することもできます。@c
3069 このファイルの中で、最後の 3 列がその列のヘッダで示される場所での@c
3070 可視性を表しています:
3071
3072 @multitable {@code{begin-of-line-invisible}} {@code{'#(#t #t #t)}} {yes} {yes} {yes}
3073 @headitem 関数                       @tab ベクトル                @tab 改行前 @tab 改行なし @tab 改行後
3074
3075 @item @code{all-visible}             @tab @code{'#(#t #t #t)}     @tab yes    @tab yes      @tab yes
3076 @item @code{begin-of-line-visible}   @tab @code{'#(#f #f #t)}     @tab no     @tab no       @tab yes
3077 @item @code{center-visible}          @tab @code{'#(#f #t #f)}     @tab no     @tab yes      @tab no
3078 @item @code{end-of-line-visible}     @tab @code{'#(#t #f #f)}     @tab yes    @tab no       @tab no
3079 @item @code{begin-of-line-invisible} @tab @code{'#(#t #t #f)}     @tab yes    @tab yes      @tab no
3080 @item @code{center-invisible}        @tab @code{'#(#t #f #t)}     @tab yes    @tab no       @tab yes
3081 @item @code{end-of-line-invisible}   @tab @code{'#(#f #t #t)}     @tab no     @tab yes      @tab yes
3082 @item @code{all-invisible}           @tab @code{'#(#f #f #f)}     @tab no     @tab no       @tab no
3083 @end multitable
3084
3085 @code{break-visibility} のデフォルト設定は@c
3086 レイアウト オブジェクトによって異なります。@c
3087 以下の表は、@code{break-visibility} によって影響をうける@c
3088 すべてのレイアウト オブジェクトと、そのプロパティのデフォルト設定を示しています:
3089
3090 @multitable @columnfractions .3 .3 .4
3091
3092 @headitem レイアウト オブジェクト   @tab 通常のコンテキスト  @tab デフォルト設定
3093
3094 @c omit Ambitus as it appears not to be affected by break-visibility -td
3095 @c @item @code{Ambitus}          @tab as specified   @tab @code{begin-of-line-visible}
3096 @item @code{BarLine}             @tab @code{Score}          @tab calculated
3097 @item @code{BarNumber}           @tab @code{Score}          @tab @code{begin-of-line-visible}
3098 @c omit the following item until it can be explained -td
3099 @c @item @code{BreakAlignGroup}  @tab @code{Score}          @tab calculated
3100 @item @code{BreathingSign}       @tab @code{Voice}          @tab @code{begin-of-line-invisible}
3101 @item @code{Clef}                @tab @code{Staff}          @tab @code{begin-of-line-visible}
3102 @item @code{Custos}              @tab @code{Staff}          @tab @code{end-of-line-visible}
3103 @item @code{DoublePercentRepeat} @tab @code{Voice}          @tab @code{begin-of-line-invisible}
3104 @c omit KeyCancellation until it can be explained -td
3105 @c @item @code{KeyCancellation}  @tab ??             @tab @code{begin-of-line-invisible}
3106 @item @code{KeySignature}        @tab @code{Staff}          @tab @code{begin-of-line-visible}
3107 @c omit LeftEdge until it can be explained -td
3108 @c @item @code{LeftEdge}         @tab @code{Score}          @tab @code{center-invisible}
3109 @item @code{OctavateEight}       @tab @code{Staff}          @tab @code{begin-of-line-visible}
3110 @item @code{RehearsalMark}       @tab @code{Score}          @tab @code{end-of-line-invisible}
3111 @item @code{TimeSignature}       @tab @code{Staff}          @tab @code{all-visible}
3112
3113 @end multitable
3114
3115 以下の例は、小節線の可視性を制御するベクトルの使用方法を示しています:
3116
3117 @c KEEP LY
3118 @lilypond[quote,verbatim,relative=1,ragged-right]
3119 f4 g a b
3120 f4 g a b
3121 % カレント行の最後で小節線を削除します
3122 \once \override Score.BarLine #'break-visibility = #'#(#f #t #t)
3123 \break
3124 f4 g a b
3125 f4 g a b
3126 @end lilypond
3127
3128 @code{break-visibility} をオーバライドするために使用される@c
3129 ベクトルの要素 3 つをすべて記述する必要がありますが、@c
3130 それらすべてが各レイアウト オブジェクトに対して効果を持つわけではなく、@c
3131 組み合わせによってはエラーになる場合もあります。@c
3132
3133 even give errors.  The following limitations apply:
3134
3135 @itemize @bullet
3136 @item 小節線を行の先頭に描画することはできません。
3137 @item 小節番号は 1 から始まるのでなければ、@c
3138 最初の行の先頭に描画することはできません。
3139 @item 音部記号 -- 以下を参照してください
3140 @item 2 重線のパーセント繰り返しはすべて描画するか、@c
3141 すべて描画しないかのどちらかです。@c
3142 描画するには @code{begin-of-line-invisible} を用い、@c
3143 描画しないのなら @code{all-invisible} を用います。
3144 @item Key signature -- 以下を参照してください
3145 @item OctavateEight -- 以下を参照してください
3146 @end itemize
3147
3148 @node 特別な考慮を必要とするもの
3149 @unnumberedsubsubsec 特別な考慮を必要とするもの
3150 @translationof Special considerations
3151
3152 @strong{@emph{明示的な変更の後の可視性}}
3153
3154 @cindex key signature, visibility following explicit change (明示的な変更の後の調号の可視性)
3155 @cindex explicitKeySignatureVisibility
3156 @cindex clef, visibility following explicit change (明示的な変更の後の音部記号の可視性)
3157 @cindex explicitClefVisibility
3158
3159 @code{break-visibility} プロパティが調号の可視性と音部記号の変更を@c
3160 制御するのは、行の先頭 -- つまり、改行の後 -- においてだけです。@c
3161 行の途中や終わりでの明示的な調の変更や音部記号の変更の後に出現する@c
3162 調合や音部記号の可視性には効果を持ちません。@c
3163 以下の例では、@code{all-invisible} がセットされていますが、@c
3164 B フラット メジャーへの明示的な変更の後に出現する調号は可視のままです。
3165
3166 @c KEEP LY
3167 @lilypond[quote,verbatim,relative=1,ragged-right]
3168 \key g \major
3169 f4 g a b
3170 % すべての調号を削除しようと試みます
3171 \override Staff.KeySignature #'break-visibility = #all-invisible
3172 \key bes \major
3173 f4 g a b
3174 \break
3175 f4 g a b
3176 f4 g a b
3177 @end lilypond
3178
3179 そのような明示的な調号や音部記号の変更の可視性は
3180 @code{explicitKeySignatureVisibility} プロパティや
3181 @code{explicitClefVisibility} プロパティによって制御されます。@c
3182 これらは @code{break-visibility} プロパティと等価であり、@c
3183 どちらも @code{break-visibility} と同様に 3 つのブール値からなるベクトルか@c
3184 上でリストアップした定義済み関数をとります。@c
3185 どちらも @code{Staff} コンテキストのプロパティであり、@c
3186 レイアウト オブジェクト自体のプロパティではありません。@c
3187 ですから、これらは @code{\set} コマンドでセットします。@c
3188 どちらもデフォルトでは @code{all-visible} がセットされています。@c
3189 これらのプロパティは明示的な変更の結果として生じる@c
3190 調号と音部記号の可視性だけを制御し、@c
3191 行の先頭での調号や音部記号には効果を持ちませんので、@c
3192 オブジェクトを削除するには適切な @code{break-visibility}
3193 をオーバライドする必要があります。
3194
3195 @lilypond[quote,verbatim,relative=1,ragged-right]
3196 \key g \major
3197 f4 g a b
3198 \set Staff.explicitKeySignatureVisibility = #all-invisible
3199 \override Staff.KeySignature #'break-visibility = #all-invisible
3200 \key bes \major
3201 f4 g a b \break
3202 f4 g a b
3203 f4 g a b
3204 @end lilypond
3205
3206 @strong{@emph{忠告の臨時記号の可視性}}
3207
3208 明示的な調の変更で描画される忠告の臨時記号を削除するには、@c
3209 @code{Staff} コンテキスト プロパティ @code{printKeyCancellation} に
3210 @code{#f} をセットします:
3211
3212 @lilypond[quote,verbatim,relative=1,ragged-right]
3213 \key g \major
3214 f4 g a b
3215 \set Staff.explicitKeySignatureVisibility = #all-invisible
3216 \set Staff.printKeyCancellation = ##f
3217 \override Staff.KeySignature #'break-visibility = #all-invisible
3218 \key bes \major
3219 f4 g a b \break
3220 f4 g a b
3221 f4 g a b
3222 @end lilypond
3223
3224 このオーバライドによって、調の変更を示す臨時記号だけが残ります。
3225
3226 @c TODO Add visibility of cautionary accidentals before notes
3227
3228 @strong{@emph{自動小節線}}
3229
3230 @cindex automaticBars
3231 @cindex bar lines, suppressing (小節線を消す)
3232
3233 特殊なケースとして、@c
3234 @code{Score} コンテキストの @code{automaticBars} プロパティを@c
3235 設定することにより、小節線の描画を Off にすることもできます。@c
3236 @code{#f} をセットされた場合、小節線は自動的には描画されなくなり、@c
3237 @code{\bar} コマンドで明示的に作成しなければならなくなります。@c
3238 定義済みコマンド @code{\cadenzaOn} とは異なり、小節数はカウントされ続けます。@c
3239 後になってこのプロパティに @code{#t} がセットされると、@c
3240 このカウントに従って小節線の生成が再開されます。@c
3241 @code{#f} がセットされている場合、@c
3242 改行が起こりえるのは明示的な @code{\bar} コマンドがある場所でだけになります。
3243
3244 @c TODO Add example
3245
3246 @strong{@emph{オクターブ移調付きの音部記号}}
3247
3248 @cindex octavated clefs, visibility of (オクターブ移調付きの音部記号の可視性)
3249 @cindex visibility of octavated clefs (オクターブ移調付きの音部記号の可視性)
3250 @cindex clefs, visibility of octavation (オクターブ移調付きの音部記号の可視性)
3251
3252 オクターブ移調付きの音部記号上の小さなオクターブ記号は
3253 @code{OctavateEight} レイアウト オブジェクトによって作り出されます。@c
3254 このオブジェクトの可視性は
3255 @code{Clef} オブジェクトの可視性とは独立して制御されます。@c
3256 そのため、各行の先頭においてそのような音部記号を完全に消そうとするなら、@c
3257 @code{Clef} オブジェクトと @code{OctavateEight} オブジェクトの両方に対して@c
3258 必要な @code{break-visibility} のオーバライドを行う必要があります。
3259
3260 明示的な音部記号の変更では、@c
3261 @code{explicitClefVisibility} プロパティが@c
3262 音部記号とそれに関連するオクターブ記号の両方を制御します。
3263
3264
3265 @seealso
3266 学習マニュアル:
3267 @rlearning{オブジェクトの可視性と色}
3268
3269
3270 @node ライン スタイル
3271 @subsection ライン スタイル
3272 @translationof Line styles
3273
3274 いくつかの演奏指示子
3275 -- 例えば、@i{rallentando}, @i{accelerando} それに @i{trills} など --
3276 はテキストとして記述され、@c
3277 線で (点線や波線の場合もあります) でいくつもの小節にわたって広がります。
3278
3279 これらはすべてグリッサンドと同じルーチンを用いてテキストと線を描きます。@c
3280 そのため、それらの振る舞いの調整も同じように行います。@c
3281 これらはスパナによって実現され、スパナを描くルーチンは
3282 @code{ly:line-interface::print} です。@c
3283 このルーチンは 2 つの @i{スパン ポイント} の位置を決定し、@c
3284 要求されたスタイルに応じてそれら 2 点の間に線を描きます。
3285
3286 利用可能なライン スタイルと、それらをどのように調整するかを示す例を挙げます。
3287
3288 @lilypond[relative=2,ragged-right,verbatim,fragment]
3289 d2 \glissando d'2
3290 \once \override Glissando #'style = #'dashed-line
3291 d,2 \glissando d'2
3292 \override Glissando #'style = #'dotted-line
3293 d,2 \glissando d'2
3294 \override Glissando #'style = #'zigzag
3295 d,2 \glissando d'2
3296 \override Glissando #'style = #'trill
3297 d,2 \glissando d'2
3298 @end lilypond
3299
3300 スパナの終点の位置は各グラフィック オブジェクトごとに@c
3301 オンザフライ (その場、その時々) で計算されますが、@c
3302 それらをオーバライドすることもできます:
3303
3304 @c TODO Complete
3305 @lilypond[relative=2,ragged-right,verbatim,quote]
3306 e2 \glissando f
3307 \once \override Glissando #'(bound-details right Y) = #-2
3308 e2 \glissando f
3309 @end lilypond
3310
3311 グリッサンドの終点の @code{Y} には @code{-2} がセットされています。@c
3312 @code{right} の代わりに @code{left} を指定することにより、@c
3313 始点も同じように調整することができます。
3314
3315 @code{Y} がセットされていない場合、@c
3316 その値はスパナが取り付けられるポイントの垂直位置から算出されます。
3317
3318 スパナに他の調整を行うことも可能です。@c
3319 詳細は @ref{スパナ} を参照してください。
3320
3321
3322 @node オブジェクトを回転させる
3323 @subsection オブジェクトを回転させる
3324 @translationof Rotating objects
3325
3326 レイアウト オブジェクトとマークアップ テキストの要素はどちらも@c
3327 任意のポイントを中心にして任意の角度で回転させることができます。@c
3328 しかしながら、回転させる方法はまったく異なります。
3329
3330 @menu
3331 * レイアウト オブジェクトを回転させる::
3332 * マークアップを回転させる::
3333 @end menu
3334
3335 @node レイアウト オブジェクトを回転させる
3336 @unnumberedsubsubsec レイアウト オブジェクトを回転させる
3337 @translationof Rotating layout objects
3338
3339 @cindex rotating objects (オブジェクトを回転させる)
3340 @cindex objects, rotating (オブジェクトを回転させる)
3341
3342 @code{grob-interface} をサポートするすべてのレイアウト オブジェクトは、@c
3343 それらのオブジェクトの @code{rotation} プロパティを設定することにより、@c
3344 回転させることができます。@c
3345 これは 3 要素のリストをとります: 反時計回りの回転の角度、@c
3346 オブジェクトの参照ポイントからの相対座標 x と y
3347 (この座標が回転の中心になります) です。@c
3348 回転の角度は @q{°}で指定し、座標は譜スペースで指定します。
3349
3350 回転の角度と回転の中心座標は、トライ&エラーで決定する必要があります。
3351
3352 @cindex hairpins, angled (回転させられたヘアピン)
3353 @cindex angled hairpins (回転させられたヘアピン)
3354
3355 レイアウト オブジェクトを回転させることが有用な状況はあまりありません。@c
3356 以下の例は、有用であるかもしれないシチュエーションの 1 つを示しています:
3357
3358 @lilypond[quote,verbatim,relative=1]
3359 g4\< e' d' f\!
3360 \override Hairpin #'rotation = #'(20 -1 0)
3361 g,,4\< e' d' f\!
3362 @end lilypond
3363
3364 @node マークアップを回転させる
3365 @unnumberedsubsubsec マークアップを回転させる
3366 @translationof Rotating markup
3367
3368 すべてのマークアップ テキストは、@code{\rotate} コマンドを前に置くことにより、@c
3369 任意の角度に回転させることができます。@c
3370 このコマンドは 2 つの引数をとります: 反時計回りの回転の角度 @q{°} と、@c
3371 回転させられるテキストです。@c
3372 テキストの領域は回転しません:
3373 テキストの領域は回転させられるテキストの四隅になります。@c
3374 以下の例では、自動衝突回避を不可にするために@c
3375 テキストの @code{outside-staff-priority} プロパティに @code{#f} を@c
3376 セットしています。@c
3377 そうしなければテキストのいくつかは高く押し上げられてしまいます。
3378
3379 @lilypond[quote,verbatim,relative=1]
3380 \override TextScript #'outside-staff-priority = ##f
3381 g4^\markup { \rotate #30 "a G" }
3382 b^\markup { \rotate #30 "a B" }
3383 des^\markup { \rotate #30 "a D-Flat" }
3384 fis^\markup { \rotate #30 "an F-Sharp" }
3385 @end lilypond
3386
3387
3388 @node 高度な調整
3389 @section 高度な調整
3390 @translationof Advanced tweaks
3391
3392 このセクションでは、@c
3393 楽譜の見た目を細かく調節するためのさまざまなアプローチについて議論します。
3394
3395 @menu
3396 * オブジェクトを揃える::
3397 * グラフィカル オブジェクトを垂直方向にグループ化する::
3398 * ステンシルを変更する::
3399 * 形状を変更する::
3400 @end menu
3401
3402
3403 @seealso
3404 学習マニュアル:
3405 @rlearning{出力を調整する},
3406 @rlearning{その他の情報源}
3407
3408 記譜法リファレンス:
3409 @ref{内部リファレンスの説明},
3410 @ref{プロパティを変更する}
3411
3412 インストール済みファイル:
3413 @file{scm/define-grobs.scm}
3414
3415 コード断片集:
3416 @rlsr{Tweaks and overrides}
3417
3418 拡張:
3419 @rextend{Interfaces for programmers}
3420
3421 内部リファレンス:
3422 @rinternals{All layout objects}
3423
3424
3425 @node オブジェクトを揃える
3426 @subsection オブジェクトを揃える
3427 @translationof Aligning objects
3428
3429 @code{self-alignment-interface} と/あるいは @code{side-position-interface} を@c
3430 サポートするグラフィカル オブジェクトは、@c
3431 さまざまな形式で配置済みのオブジェクトに揃えることができます。@c
3432 そのようなオブジェクトのリストは、@rinternals{self-alignment-interface} と
3433 @rinternals{side-position-interface} を参照してください。@c
3434
3435 すべてのグラフィカル オブジェクトは参照ポイント、水平方向の広がり、@c
3436 それに垂直方向の広がりを持ちます。@c
3437 水平方向の広がりは、@c
3438 参照ポイントから左端と右端までの距離を意味する数値のペアであり、@c
3439 左端は負値です。@c
3440 垂直方向の広がりは、@c
3441 参照ポイントから下端と上端までの距離を意味する数値のペアであり、@c
3442 下端は負値です。@c
3443
3444 あるオブジェクトの譜面上の位置は、@code{X-offset} プロパティと
3445 @code{Y-offset} プロパティの値によって与えられます。@c
3446 @code{X-offset} の値は、親オブジェクトの参照ポイントの X 座標からの@c
3447 距離を意味します。@c
3448 @code{Y-offset} の値は、譜の中央線からの距離を意味します。@c
3449 @code{X-offset} と @code{Y-offset} の値は直接設定されることもありますし、@c
3450 いくつかの形式で親オブジェクトと揃えるために@c
3451 プロシージャによって算出されることもあります。
3452
3453 @c positioning considerations: 配置のための考慮 -> 配置規則
3454 @warning{多くのオブジェクトは特殊な配置規則を持っています。@c
3455 そのため、そのオブジェクトが @code{self-alignment-interface} を@c
3456 サポートしていたとしても、@c
3457 @code{X-offset} あるいは @code{Y-offset} の設定は無視されたり、@c
3458 変更されることがあります。}
3459
3460 例えば、臨時記号は @code{Y-offset} を設定することにより@c
3461 垂直方向の位置を変更することができますが、@code{X-offset} は効果を持ちません。
3462
3463 リハーサル記号は、小節線、音部記号、拍子記号それに調号などの@c
3464 改行可能なオブジェクトに揃えることができます。@c
3465 リハーサル記号をそのようなオブジェクトに合わせて配置するために、@c
3466 @code{break-aligned-interface} の中に特別なプロパティがあります。
3467
3468 @seealso
3469 @ref{break-alignable-interface を使用する},
3470 @rextend{Callback functions}
3471
3472 @menu
3473 * X-offset と Y-offset を直接設定する::
3474 * side-position-interface を使用する::
3475 * self-alignment-interface を使用する::
3476 * break-alignable-interface を使用する::
3477 @end menu
3478
3479 @node X-offset と Y-offset を直接設定する
3480 @unnumberedsubsubsec @code{X-offset} と @code{Y-offset} を直接設定する
3481 @translationof Setting X-offset and Y-offset directly
3482
3483 多くのオブジェクトの @code{X-offset} プロパティと @code{Y-offset} プロパティに@c
3484 数値を与えることができます。@c
3485 以下の例は、3 つの音符を示していて、1 つはデフォルト配置の運指記号を持ち、@c
3486 他の 2 つの運指記号は @code{X-offset} と @code{Y-offset} が変更されています。
3487
3488 @lilypond[verbatim,quote,relative=2]
3489 a-3
3490 a
3491 -\tweak #'X-offset #0
3492 -\tweak #'Y-offset #0
3493 -3
3494 a
3495 -\tweak #'X-offset #-1
3496 -\tweak #'Y-offset #1
3497 -3
3498 @end lilypond
3499
3500 @c TODO write more
3501
3502 @node side-position-interface を使用する
3503 @unnumberedsubsubsec @code{side-position-interface} を使用する
3504 @translationof Using the @code{side-position-interface}
3505
3506 @code{side-position-interface} をサポートするオブジェクトは、@c
3507 その親オブジェクトの隣に配置することができ、@c
3508 それにより、@c
3509 それら 2 つのオブジェクトの指定された端をくっつけることができます。@c
3510 オブジェクトを親オブジェクトの上、下、右、あるいは左に配置することができます。@c
3511 親オブジェクトを指定することはできません:
3512 親オブジェクトは入力ストリームの中での要素の順序によって決定されます。@c
3513 たいていのオブジェクトの親オブジェクトは、@c
3514 そのオブジェクトに関連する符頭となります。
3515
3516 @code{side-axis} プロパティと @code{direction} プロパティの値は、@c
3517 以下のように、オブジェクトが配置される場所を決定します:
3518
3519 @c TODO add an example of each to the table
3520
3521 @multitable @columnfractions .3 .3 .3
3522 @headitem @code{side-axis}  @tab @code{direction}  @tab
3523 @headitem property          @tab property          @tab Placement
3524
3525 @item     @code{0}          @tab @code{-1}         @tab 左
3526 @item     @code{0}          @tab @code{1}          @tab 右
3527 @item     @code{1}          @tab @code{-1}         @tab 下
3528 @item     @code{1}          @tab @code{1}          @tab 上
3529
3530 @end multitable
3531
3532 @code{side-axis} が @code{0} である場合、@code{X-offset} には@c
3533 プロシージャ @code{ly:side-position-interface::x-aligned-side} を@c
3534 セットする必要があります。@c
3535 このプロシージャは、@code{direction} の値に基づいて@c
3536 親オブジェクトの左あるいは右にオブジェクトを配置するための適切な値を
3537 @code{X-offset} に返します。
3538
3539 @code{side-axis} が @code{1} である場合、@code{Y-offset} には@c
3540 プロシージャ @code{ly:side-position-interface::y-aligned-side} を@c
3541 セットする必要があります。@c
3542 このプロシージャは、@code{direction} の値に基づいて@c
3543 親オブジェクトの上あるいは下にオブジェクトを配置するための適切な値を
3544 @code{Y-offset} に返します。
3545
3546 @c TODO Add examples
3547
3548 @node self-alignment-interface を使用する
3549 @unnumberedsubsubsec @code{self-alignment-interface} を使用する
3550 @translationof Using the @code{self-alignment-interface}
3551
3552 @emph{オブジェクトを自動的に水平方向に揃える}
3553
3554 @code{self-alignment-interface} をサポートするオブジェクトの水平方向の揃えは、@c
3555 @code{self-alignment-X} プロパティの値によって制御され、@c
3556 そのオブジェクトの @code{X-offset} プロパティには@c
3557 任意の実数値を与えることができる
3558 @code{ly:self-alignment-interface::x-aligned-on-self}.
3559 @code{self-alignment-X} がセットされます。@c
3560 与える実数値は、そのオブジェクトの X 方向の広がりの半分を単位とします。@c
3561 負値はオブジェクトを右に移動させ、正値はオブジェクトを左に移動させます。@c
3562 値が @code{0} であればそのオブジェクトは親オブジェクトの参照ポイントに@c
3563 中央揃えされ、@c
3564 値が @code{-1} であればそのオブジェクトの左端が親オブジェクトの参照ポイントに@c
3565 揃えられ、@c
3566 値が @code{1} であればそのオブジェクトの右端が親オブジェクトの参照ポイントに@c
3567 揃えられます。@c
3568 記号 @code{LEFT}, @code{CENTER}, それに @code{RIGHT} は@c
3569 それぞれ @w{@code{-1}, @code{0}, それに @code{1}} に対応します。
3570
3571 通常、@code{\override} コマンドを用いて @code{self-alignment-X} の値を@c
3572 変更しますが、@c
3573 @code{\tweak} コマンドを用いることで@c
3574 単一の音符に付けられている複数の注釈を個別に揃えることができます:
3575
3576 @lilypond[quote,verbatim,relative=1]
3577 a'
3578 -\tweak #'self-alignment-X #-1
3579 ^"left-aligned"
3580 -\tweak #'self-alignment-X #0
3581 ^"center-aligned"
3582 -\tweak #'self-alignment-X #RIGHT
3583 ^"right-aligned"
3584 -\tweak #'self-alignment-X #-2.5
3585 ^"aligned further to the right"
3586 @end lilypond
3587
3588 @emph{オブジェクトを自動的に垂直方向に揃える}
3589
3590 オブジェクトの @code{Y-offset} プロパティに
3591 @code{ly:self-alignment-interface::y-aligned-on-self} がセットされていれば、@c
3592 水平方向の揃えと同じように、垂直方向に揃えることができます。@c
3593 しかしながら、垂直方向の揃えには他のメカニズムも関与します:
3594 @code{Y-offset} の値は、垂直方向の揃えに関与する変数の 1 つに過ぎません。@c
3595 このことにより、いくつかのオブジェクトの @code{Y-offset} 値の調整は@c
3596 ややこしくなります。@c
3597 単位はそのオブジェクトの垂直方向の広がりの半分です。@c
3598 通常これは非常に小さいため、非常に大きな数値が必要になる可能性があります。@c
3599 値が @code{-1} であればそのオブジェクトの下端が親オブジェクトの参照ポイントに@c
3600 揃えられ、@c
3601 値が @code{0} であればそのオブジェクトの中央が親オブジェクトの参照ポイントに@c
3602 揃えられ、@c
3603 値が @code{1} であればそのオブジェクトの上端が親オブジェクトの参照ポイントに@c
3604 揃えられます。@c
3605 記号 @code{DOWN}, @code{CENTER}, それに @code{UP} は@c
3606 それぞれ @w{@code{-1}, @code{0}, それに @code{1}} に対応します。
3607
3608 @emph{オブジェクトを自動的に両方向に揃える}
3609
3610 @code{X-offset} と @code{Y-offset} の両方の設定を行うことで、@c
3611 オブジェクトの水平方向と垂直方向の揃えを同時に行うことができます。
3612
3613 以下の例は、運指記号を符頭に近づけるための調整方法を示しています。
3614
3615 @c KEEP LY
3616 @lilypond[quote,verbatim,relative=2]
3617 a
3618 -\tweak #'self-alignment-X #0.5  % 左方向に移動させます
3619 -\tweak #'Y-offset #ly:self-alignment-interface::y-aligned-on-self
3620 -\tweak #'self-alignment-Y #-1  % 上方向に移動させます
3621 -3  % 3 の指
3622 @end lilypond
3623
3624 @ignore
3625 @unnumberedsubsubsec Using the @code{aligned-on-parent} procedures
3626
3627 @c Cannot document as they do not seem to operate consistently on all objects -td
3628 @c TODO investigate further
3629
3630 The @code{aligned-on-parent} procedures are used in the same way
3631 as the @code{aligned-on-self} procedures, they difference being
3632 that they permit an object to be aligned with the @emph{edges} of
3633 the parent rather than the parent's reference point.  The following
3634 example shows the difference:
3635
3636 @c TODO Add example
3637
3638 @lilypond[verbatim,quote]
3639 @end lilypond
3640
3641 @end ignore
3642
3643 @ignore
3644 @unnumberedsubsubsec Using the @code{centered-on-parent} procedures
3645
3646 @c Cannot document as they do not seem to operate consistently on all objects -td
3647 @c TODO investigate further
3648
3649 @end ignore
3650
3651 @c TODO The align-interface, BassFigureAlignment and VerticalAlignment
3652
3653 @node break-alignable-interface を使用する
3654 @unnumberedsubsubsec @code{break-alignable-interface} を使用する
3655 @translationof Using the @code{break-alignable-interface}
3656
3657 @cindex align to objects (オブジェクトに揃える)
3658 @cindex break-align-symbols
3659
3660 リハーサル記号と小節番号を小節線ではなく、@c
3661 記譜オブジェクトに揃えることができます。@c
3662 対象となる記譜オブジェクトには、@code{ambitus},
3663 @code{breathing-sign}, @code{clef}, @code{custos}, @code{staff-bar},
3664 @code{left-edge}, @code{key-cancellation}, @code{key-signature}, それに
3665 @code{time-signature} があります。
3666
3667 デフォルトでは、@c
3668 リハーサル記号と小節番号はオブジェクトの上で水平方向に中央揃えされます:
3669
3670 @c KEEP LY
3671 @lilypond[verbatim,quote,relative=1]
3672 % リハーサル記号は音部記号の上に中央揃えされます
3673 \override Score.RehearsalMark #'break-align-symbols = #'(clef)
3674 \key a \major
3675 \clef treble
3676 \mark "↓"
3677 e1
3678 % リハーサル記号は拍子記号の上に中央揃えされます
3679 \override Score.RehearsalMark #'break-align-symbols = #'(time-signature)
3680 \key a \major
3681 \clef treble
3682 \time 3/4
3683 \mark "↓"
3684 e2.
3685 % リハーサル記号はブレス記号の上に中央揃えされます
3686 \override Score.RehearsalMark #'break-align-symbols = #'(breathing-sign)
3687 \key a \major
3688 \clef treble
3689 \time 4/4
3690 e1
3691 \breathe
3692 \mark "↓"
3693 @end lilypond
3694
3695 揃えの対象となり得るオブジェクトのリストを指定することができます。@c
3696 揃えを行う時点で対象リストの中にあるオブジェクトのいくつかが不可視である
3697 -- @code{break-visibility} の設定や、@c
3698 調号と音部に対する明示的な可視性の設定により --
3699 場合、リハーサル記号あるいは小節番号はリストの中にある@c
3700 最初の可視のオブジェクトに揃えられます。@c
3701 リストの中にあるオブジェクトがすべて不可視である場合、小節線に揃えられます。@c
3702 小節線が不可視である場合、小節線があるはずの場所に揃えられます。
3703
3704 @c KEEP LY
3705 @lilypond[verbatim,quote,relative=1]
3706 % リハーサル記号は調号の上に中央揃えされます
3707 \override Score.RehearsalMark #'break-align-symbols = #'(key-signature clef)
3708 \key a \major
3709 \clef treble
3710 \mark "↓"
3711 e1
3712 % リハーサル記号は音部記号の上に中央揃えされます
3713 \set Staff.explicitKeySignatureVisibility = #all-invisible
3714 \override Score.RehearsalMark #'break-align-symbols = #'(key-signature clef)
3715 \key a \minor
3716 \clef bass
3717 \mark "↓"
3718 gis,,1
3719 % リハーサル記号は小節線の上に中央揃えされます
3720 \set Staff.explicitKeySignatureVisibility = #all-invisible
3721 \set Staff.explicitClefVisibility = #all-invisible
3722 \override Score.RehearsalMark #'break-align-symbols = #'(key-signature clef)
3723 \key a \major
3724 \clef treble
3725 \mark "↓"
3726 e''1
3727 @end lilypond
3728
3729 以下の例で示すように、@c
3730 記譜オブジェクトに対するリハーサル記号の揃えを変更することができます。@c
3731 複数の譜を持つ楽譜では、この設定はすべての譜に適用されます。
3732
3733 @c KEEP LY
3734 @lilypond[verbatim,quote,relative=1]
3735 % RehearsalMark は KeySignature の上に中央揃えされます
3736 \override Score.RehearsalMark #'break-align-symbols = #'(key-signature)
3737 \key a \major
3738 \clef treble
3739 \time 4/4
3740 \mark "↓"
3741 e1
3742 % RehearsalMark は KeySignature の左端に揃えられます
3743 \once \override Score.KeySignature #'break-align-anchor-alignment = #LEFT
3744 \mark "↓"
3745 \key a \major
3746 e
3747 % RehearsalMark は KeySignature の右端に揃えられます
3748 \once \override Score.KeySignature #'break-align-anchor-alignment = #RIGHT
3749 \key a \major
3750 \mark "↓"
3751 e
3752 @end lilypond
3753
3754 また、リハーサル記号を左端に揃えて、@c
3755 さらに任意の量だけ右あるいは左にずらすことができます。@c
3756 単位は譜スペースです:
3757
3758 @c KEEP LY
3759 @lilypond[verbatim,quote,relative=1]
3760 % リハーサル記号は調号の左端に揃えられて
3761 % さらに 3.5 譜スペース右にずらされます
3762 \override Score.RehearsalMark #'break-align-symbols = #'(key-signature)
3763 \once \override Score.KeySignature #'break-align-anchor = #3.5
3764 \key a \major
3765 \mark "↓"
3766 e1
3767 % リハーサル記号は調号の左端に揃えられて
3768 % さらに 2 譜スペース左にずらされます
3769 \once \override Score.KeySignature #'break-align-anchor = #-2
3770 \key a \major
3771 \mark "↓"
3772 e1
3773 @end lilypond
3774
3775
3776 @node グラフィカル オブジェクトを垂直方向にグループ化する
3777 @subsection グラフィカル オブジェクトを垂直方向にグループ化する
3778 @translationof Vertical grouping of grobs
3779
3780 @c FIXME Expand this section
3781
3782 VerticalAlignment グラフィカル オブジェクトと
3783 VerticalAxisGroup グラフィカル オブジェクトは対で機能します。@c
3784 VerticalAxisGroup は Staff, Lyrics, 等のような@c
3785 異なるグラフィカル オブジェクトをグループにまとめます。@c
3786 それから、VerticalAlignment が
3787 VerticalAxisGroup によってグループ化されたグラフィカル オブジェクトを@c
3788 垂直方向に揃えます。@c
3789 通常、楽譜には VerticalAlignment は 1 つしかありませんが、@c
3790 Staff, Lyrics 等はそれ自体でそれぞれに VerticalAxisGroup を持ちます。
3791
3792
3793 @node ステンシルを変更する
3794 @subsection ステンシルを変更する
3795 @translationof Modifying stencils
3796
3797 すべてのレイアウト オブジェクトは、@c
3798 @code{grob-interface} の一部である @code{stencil} プロパティを持ちます。@c
3799 通常、デフォルトでこのプロパティには、@c
3800 出力でそのオブジェクトを具現化する記号を描画するための@c
3801 特有の関数がセットされています。@c
3802 例えば、@code{MultiMeasureRest} オブジェクトの @code{stencil} プロパティに@c
3803 対する標準設定は、@code{ly:multi-measure-rest::print} です。
3804
3805 @code{stencil} プロパティを変更して異なる描画関数を参照させることにより、@c
3806 オブジェクトの標準記号を置き換えることができます。@c
3807 これには LilyPond 内部機能についての高い知識が求められます。@c
3808 しかしながら、多くの場合にまずまずの結果を生み出すもっと簡単な方法があります。
3809
3810 簡単な方法では、@code{stencil} プロパティにテキストを描画する関数
3811 -- @code{ly:text-interface::print} -- をセットし、@c
3812 必要な記号を生み出すマークアップ テキストを保持するよう設定された
3813  @code{text} プロパティ与えます。@c
3814 マークアップの自由度の高さにより、多くのことを達成できます。@c
3815 詳細は、@ref{マークアップ内部でのグラフィック記譜法} を参照してください。
3816
3817 以下の例では、この方法を用いて符頭記号を内部に×を持つ円に変更しています。
3818
3819 @lilypond[verbatim,quote]
3820 XinO = {
3821   \once \override NoteHead  #'stencil = #ly:text-interface::print
3822   \once \override NoteHead #'text = \markup {
3823     \combine
3824       \halign #-0.7 \draw-circle #0.85 #0.2 ##f
3825       \musicglyph #"noteheads.s2cross"
3826   }
3827 }
3828 \relative c'' {
3829   a a \XinO a a
3830 }
3831 @end lilypond
3832
3833 @code{\musicglyph} マークアップ コマンドには、@c
3834 Feta フォントに含まれる任意の図柄を提供することができます。@c
3835 @ref{The Feta font} を参照してください。
3836
3837 @c TODO Add inserting eps files or ref to later
3838
3839 @c TODO Add inserting Postscript or ref to later
3840
3841
3842 @seealso
3843 記譜法リファレンス:
3844 @ref{マークアップ内部でのグラフィック記譜法},
3845 @ref{テキストをフォーマットする},
3846 @ref{Text markup commands},
3847 @ref{The Feta font}
3848
3849
3850 @node 形状を変更する
3851 @subsection 形状を変更する
3852 @translationof Modifying shapes
3853
3854 @menu
3855 * タイとスラーの形状を変更する::
3856 @end menu
3857
3858 @node タイとスラーの形状を変更する
3859 @unnumberedsubsubsec タイとスラーの形状を変更する
3860 @translationof Modifying ties and slurs
3861
3862 @cindex slurs, modifying (スラーの形状を変更する)
3863 @cindex ties, modifying (タイの形状を変更する)
3864 @cindex Bézier curves (ベジエ曲線)
3865 @cindex Bézier control points (ベジエ曲線の制御ポイント)
3866
3867 タイ、スラー、それにフレージング スラーは 3 次のベジエ曲線として描かれます。@c
3868 自動的に算出されるタイあるいはスラーの形状が最適ではない場合、@c
3869 3 次ベジエ曲線を定義するのに必要な 4 つの制御ポイントを@c
3870 明示的に指定することによって、形状を変更することができます。
3871
3872 3 次あるいは 3 乗のベジエ曲線は、4 つの制御ポイントによって定義されます。@c
3873 1 番目と 4 番目の制御ポイントは曲線の始点と終点になります。@c
3874 間にある 2 つの制御ポイントは曲線の形状を定義します。@c
3875 Web でベジエ曲線が描かれる様子を示すアニメーションを@c
3876 見つけることができるでしょう。@c
3877 しかしながら、以下の記述も役に立つかもしれません。@c
3878 ベジエ曲線は最初の制御ポイントから 2 番目の制御ポイントに進み、@c
3879 徐々に 3 番目の制御ポイントの方へ向きを変えながら
3880 4 番目の制御ポイントの方へ向かい続け、@c
3881 3 番目の制御ポイントから 4 番目の制御ポイントに到達します。@c
3882 ベジエ曲線は 4 つの制御ポイントからなる四角形の中に納まります。
3883
3884 ここで、@c
3885 タイが最適化されず、@code{\tieDown} が役に立たないケースを例として挙げます。
3886
3887 @lilypond[verbatim,quote,relative=1]
3888 <<
3889   { e1 ~ e }
3890 \\
3891   { r4 <g c,> <g c,> <g c,> }
3892 >>
3893 @end lilypond
3894
3895 以下のようにタイの制御ポイントを手動で変更することにより、@c
3896 このタイの形状を改善することができます。
3897
3898 ベジエ制御ポイントの座標は譜スペースを単位として指定されます。@c
3899 X@tie{}座標はそのタイあるいはスラーを取り付けられる音符の参照ポイントからの@c
3900 相対座標であり、Y@tie{}座標は譜の中央線からの相対座標です。@c
3901 制御ポイント座標は 10 進数 (実数) のペアを 4 つ持つリストとして設定されます。@c
3902 最適な制御ポイントを決定するための手順は、
3903 2 つの終点の座標を見積もり、それから 2 つの中間ポイントを推測することで、@c
3904 制御ポイントの座標を決定します。@c
3905 最適値はトライ&エラーで見つけ出します。
3906
3907 左右対称の曲線にするには制御ポイントを左右対称に配置する必要があるということを@c
3908 覚えておくと役に立ちます。@c
3909 また、ベジエ曲線の制御ポイントに平行移動、回転、それに拡大縮小などの変換を@c
3910 適用することにより、@c
3911 その曲線を変換できるという特性があるとも覚えておいてください。
3912
3913 上記の実例として、以下の例のオーバライドで満足のいくタイが得られています。@c
3914 オーバライドを配置する場所
3915 -- タイ (あるいはスラー) が開始する音符の直前に配置する必要があります --
3916 に注意してください。
3917
3918 @lilypond[verbatim,quote,relative=1]
3919 <<
3920   {
3921     \once \override Tie
3922       #'control-points = #'((1 . -1) (3 . 0.6) (12.5 . 0.6) (14.5 . -1))
3923      e1 ~ e
3924   }
3925 \\
3926   { r4 <g c,> <g c,> <g c,> }
3927 >>
3928 @end lilypond
3929
3930 @knownissues
3931
3932 同じ音楽タイミングに複数のタイあるいはスラーが存在する場合、@c
3933 @code{control-points} プロパティを変更しても@c
3934 それらの形状を変更することはできません。@c
3935 @code{\tweak} コマンドを用いたとしても変更できません。@c
3936 しかしながら、@code{TieColumn} の @code{tie-configuration} プロパティを@c
3937 オーバライドすることで、タイの垂直方向の位置と領域を変更することができます。
3938
3939 @seealso
3940 内部リファレンス:
3941 @rinternals{TieColumn}
3942
3943
3944 @node 音楽関数を使用する
3945 @section 音楽関数を使用する
3946 @translationof Using music functions
3947
3948 @c TODO -- add @seealso, etc. to these subsections
3949
3950 調整を異なる音楽表記に再利用する必要がある場合、@c
3951 その調整を音楽関数にしておくと便利です。@c
3952 このセクションでは、@emph{置換} 関数についてだけ議論します。@c
3953 置換関数は変数を LilyPond 入力コードに置き換えます。@c
3954 他のもっと複雑な関数については、@rextend{Music functions} で記述されています。
3955
3956 @menu
3957 * 置換関数の構文::
3958 * 置換関数の例::
3959 @end menu
3960
3961 @node 置換関数の構文
3962 @subsection 置換関数の構文
3963 @translationof Substitution function syntax
3964
3965 変数を LilyPond コードに置換する関数を作成することは簡単にできます。@c
3966 置換関数の一般的な形式は以下のようなものです:
3967
3968 @example
3969 function =
3970 #(define-music-function
3971      (parser location @var{arg1} @var{arg2} @dots{})
3972      (@var{type1?} @var{type2?} @dots{})
3973    #@{
3974      @var{@dots{}music@dots{}}
3975    #@})
3976 @end example
3977
3978 @noindent
3979 ここで
3980
3981 @multitable @columnfractions .33 .66
3982 @item @code{@var{argN}}
3983 @tab @var{n} 番目の引数
3984
3985 @item @code{@var{typeN?}}
3986 @tab @code{@var{argN}} が @code{#t} を返す Scheme の @emph{型述語} (type predicate)。
3987
3988 @item @code{@var{@dots{}music@dots{}}}
3989 @tab 通常の LilyPond 入力。@code{$} を用いて引数を参照します
3990 (例: @samp{$arg1})。
3991 @end multitable
3992
3993 です。
3994
3995 @ignore
3996 共通の変数タイプについては @ref{共通の引数タイプ} で記述されています。@c
3997 変数タイプについてのもっと完全な記述は
3998 @rextend{Music function syntax} にあります。
3999 @end ignore
4000
4001 引数 @code{parser} と @code{location} を省略することはできず、@c
4002 @rextend{Music function syntax} で記述されている高度な状況で@c
4003 使用されることがあります。
4004 置換関数において、必ずこれらの引数を記述してください。
4005
4006 引数として、型述語のリストも必須です。@c
4007 音楽関数で用いられる一般的な型述語には下記のものがあります:
4008
4009 @example
4010 boolean?
4011 cheap-list?  @emph{(}@q{list?}@emph{ の代わりに用いることで、処理を高速にします)}
4012 ly:music?
4013 markup?
4014 number?
4015 pair?
4016 string?
4017 symbol?
4018 @end example
4019
4020 @noindent
4021 利用可能な型述語のリストは、@c
4022 @ref{Predefined type predicates} を参照してください。@c
4023 ユーザが型述語を定義することもできます。
4024
4025
4026 @seealso
4027
4028 記譜法リファレンス:
4029 @ref{Predefined type predicates}
4030
4031 拡張:
4032 @rextend{Music function syntax}
4033
4034 インストールされているファイル:
4035 @file{lily/music-scheme.cc},
4036 @file{scm/c++.scm},
4037 @file{scm/lily.scm}
4038
4039
4040 @ignore
4041 @node 共通の引数タイプ
4042 @subsection 共通の引数タイプ
4043 @translationof Common argument types
4044
4045 エラー チェックを考慮して、@c
4046 音楽関数に渡される各引数タイプを定義しておく必要があります。@c
4047 共通の引数タイプのいくつかを以下の表で示します。@c
4048
4049 以下の入力タイプを音楽関数で変数として使用することができます。@c
4050 このリストは完全なものではありません。@c
4051 取り得る変数タイプについての更なる情報は、
4052 @rextend{Music function syntax} にあります。
4053
4054 @multitable @columnfractions .33 .66
4055 @headitem 入力タイプ          @tab @var{vari-type?} での記述方法
4056 @item 整数                    @tab @code{integer?}
4057 @item 浮動小数点数 (10 進数)  @tab @code{number?}
4058 @item テキスト文字列          @tab @code{string?}
4059 @item マークアップ            @tab @code{markup?}
4060 @item 音楽表記                @tab @code{ly:music?}
4061 @item Scheme ペア             @tab @code{pair?}
4062 @end multitable
4063
4064 @seealso
4065
4066 LilyPond の拡張:
4067 @rextend {Music function syntax}
4068
4069 インストール済みファイル:
4070 @file{lily/music-scheme.cc},
4071 @file{scm/c++.scm}
4072 @end ignore
4073
4074
4075 @c ここから L3796
4076 @node 置換関数の例
4077 @subsection 置換関数の例
4078 @translationof Substitution function examples
4079
4080 このセクションでは、置換関数の例をいくつか紹介します。@c
4081 高度なことはしていませんが、シンプルな置換関数を実現する方法を示しています。
4082
4083 最初の例では、@c
4084 @code{TextScript} のパディング設定を容易にするための関数が定義されています:
4085
4086 @lilypond[quote,verbatim,ragged-right]
4087 padText =
4088 #(define-music-function
4089      (parser location padding)
4090      (number?)
4091    #{
4092      \once \override TextScript #'padding = $padding
4093    #})
4094
4095 \relative c''' {
4096   c4^"piu mosso" b a b
4097   \padText #1.8
4098   c4^"piu mosso" d e f
4099   \padText #2.6
4100   c4^"piu mosso" fis a g
4101 }
4102 @end lilypond
4103
4104 数値のほかに、音符などの音楽表記を音楽関数への引数にすることができます:
4105
4106 @c TODO: use a better example (the music argument is redundant).
4107
4108 @lilypond[quote,verbatim,ragged-right]
4109 custosNote =
4110 #(define-music-function
4111      (parser location note)
4112      (ly:music?)
4113    #{
4114      \once \override Voice.NoteHead #'stencil =
4115        #ly:text-interface::print
4116      \once \override Voice.NoteHead #'text =
4117        \markup \musicglyph #"custodes.mensural.u0"
4118      \once \override Voice.Stem #'stencil = ##f
4119      $note
4120    #})
4121
4122 \relative c' { c4 d e f \custosNote g }
4123 @end lilypond
4124
4125 複数の引数をとる置換関数を定義することもできます:
4126
4127 @lilypond[quote,verbatim,ragged-right]
4128 tempoPadded =
4129 #(define-music-function
4130      (parser location padding tempotext)
4131      (number? string?)
4132    #{
4133      \once \override Score.MetronomeMark #'padding = $padding
4134      \tempo \markup { \bold $tempotext }
4135    #})
4136
4137 \relative c'' {
4138   \tempo \markup { "Low tempo" }
4139   c4 d e f g1
4140   \tempoPadded #4.0 #"High tempo"
4141   g4 f e d c1
4142 }
4143 @end lilypond
4144
4145 @c TODO: add appropriate @@ref's here.