X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Documentation%2Fja%2Fnotation%2Fchanging-defaults.itely;h=8d3c5b837ceed3e5b51209d119aa199a45b56eb5;hb=d01d7bd0752a3d141de5a1fb2905d30efbcd8970;hp=ca23955a68fd9a0484c451000abb7e0efb43e251;hpb=bb8aa1aed52c49e6e3de8c6c70a876598b11b4a8;p=lilypond.git diff --git a/Documentation/ja/notation/changing-defaults.itely b/Documentation/ja/notation/changing-defaults.itely index ca23955a68..8d3c5b837c 100644 --- a/Documentation/ja/notation/changing-defaults.itely +++ b/Documentation/ja/notation/changing-defaults.itely @@ -1,14 +1,14 @@ @c -*- coding: utf-8; mode: texinfo; documentlanguage: ja -*- @ignore - Translation of GIT committish: 45329bd378eedfebca34c746fff9e53b46cf2fe5 + Translation of GIT committish: c1b0482f63f881bd3f67845e5f76a3e04675ef2a When revising a translation, copy the HEAD committish of the version that you are working on. For details, see the Contributors' Guide, node Updating translation committishes.. @end ignore -@c \version "2.15.10" +@c \version "2.17.30" @c Translators: Yoshiki Sawada @c Translation status: post-GDP @@ -35,7 +35,7 @@ LilyPond はデフォルトで最高品質の出力を提供できるよう設 このマニュアルは利用可能なすべての変数、関数、それにオプションを@c リストアップしています。@c これは HTML ドキュメントとして記述されていて、@c -@uref{http://@/lilypond@/.org/@/doc/@/stable/@/Documentation/@/user/@/lilypond@/-internals/,オンライン} +@uref{http://@/lilypond@/.org/@/doc/@/stable/@/Documentation/@/internals/,オンライン} で入手可能であり、@c LilyPond ドキュメント パッケージにも含まれています。 @@ -68,20 +68,19 @@ Scheme の要素は、@code{.ly} の中で、@c @menu * コンテキストの説明:: -* コンテキストを作成する:: +* コンテキストを作成して参照する:: * コンテキストを残しておく:: * コンテキストのプラグインを変更する:: * コンテキストのデフォルト設定を変更する:: * 新しいコンテキストを定義する:: -* コンテキストを揃える:: +* コンテキストの配置順序:: @end menu - @seealso 学習マニュアル: @rlearning{コンテキストとエングラーバ} -インストール済みファイル: +インストールされているファイル: @file{ly/@/engraver@/-init@/.ly}, @file{ly/@/performer@/-init@/.ly} @@ -287,152 +286,225 @@ context. @end ignore -@node コンテキストを作成する -@subsection コンテキストを作成する -@translationof Creating contexts - -@c TODO more complete descriptions rather than learning style - -ボイスと譜が 1 つだけの楽譜では、コンテキストは自動的に作成されます。@c -もっと複雑な楽譜では、手動でコンテキストを作成する必要があります。@c -コンテキスを作成するために 3 つのコマンドがあります。 -@itemize - -@item -もっとも簡単なコマンドは @code{\new} であり、@c -もっとも素早く入力できるコマンドでもあります。@c -このコマンドは音楽表記の前に置きます。例えば、以下のように: +@node コンテキストを作成して参照する +@subsection コンテキストを作成して参照する +@translationof Creating and referencing contexts @funindex \new +@funindex \context @cindex new contexts (新しいコンテキスト) -@cindex Context, creating (コンテキストを作成する) +@cindex referencing contexts (コンテキストを参照する) +@cindex Contexts, creating and referencing (コンテキストを作成して参照する) + +LilyPond は、適切なコンテキストが存在しないうちに音楽表記に遭遇すると、@c +自動的に下位コンテキストを作成します。@c +しかしながら、通常これは、シンプルな楽譜やドキュメントの中の楽譜断片@c +のような単純な場合にしかうまくいきません。@c +もっと複雑な楽譜の場合、すべてのコンテキストを @code{\new} コマンドや +@code{\context} コマンドを用いて明示的に指定することをお勧めします。@c +これら 2 つのコマンドの構文はほとんど同じです: @example -\new @var{type} @var{music expression} +[\new | \context] @var{Context} [ = @var{name}] [@var{music-expression}] @end example @noindent -ここで、@var{type} はコンテキスト名 (@code{Staff} や @code{Voice} など) です。@c -このコマンドは新しいコンテキストを作成し、@c -そのコンテキストに付属する @var{音楽表記} の解釈を開始します。 +ここで、@code{\new} と @code{\context} のどちらかを使用します。@c +@var{Context} は作成するコンテキストのタイプであり、@var{name} は@c +作成されるコンテキストにオプションで付けることができる名前であり、@c +@var{music-expression} はこのコンテキストのエングラーバとパフォーマに@c +よって処理される単一の音楽表記です。 -@code{\new} の実際的な使用例には、多くの譜を持つ楽譜があります。@c -それぞれの譜に配置される各パートの前に @code{\new Staff} を記述します。 +コンテキスト名を持たない @code{\new} コマンドは一般的に複数の譜を持つ +score を作成するのに用いられます: -@lilypond[quote,verbatim,relative=2,ragged-right,fragment] +@c KEEP LY +@lilypond[quote,verbatim,relative=2] << - \new Staff { c4 c } - \new Staff { d4 d } + \new Staff { + % 暗黙的に Voice コンテキストが作成されます + c4 c + } + \new Staff { + d4 d + } >> @end lilypond -@code{\new} コマンドは、コンテキストに名前を与えることもできます: +@noindent +そして、1 つの譜に複数のボイスが配置されます: -@example -\new @var{type} = @var{id} @var{music} -@end example +@lilypond[quote,verbatim,relative=2] +<< + \new Staff << + \new Voice { + \voiceOne + c8 c c4 c c + } + \new Voice { + \voiceTwo + g4 g g g + } + >> +>> +@end lilypond -しかしながら、ユーザが指定したコンテキスト名は、 -そのコンテキスト以前に同じ名前を与えられたコンテキストが無い場合にのみ、@c -使用できます。 +@noindent +@c 保留(意味のない文?) +@c @code{\new} should always be used to specify unnamed contexts. -@funindex \context +@code{\new} と @code{\context} は動作が異なります: +@itemize @item -@code{\new} と同様に、@c -@code{\context} コマンドも音楽表記をコンテキスト オブジェクトに代入します。@c -しかしながら、このコマンドはコンテキストに明示的に名前を与えます。@c -構文は以下の通りです: +@code{\new} はコンテキスト名を持っているか、いないかにかかわらず、@c +例え同じ名前を持つコンテキストが存在していたとしても、常に全く新たな@c +コンテキストを作成します: -@example -\context @var{type} = @var{id} @var{music} -@end example +@lilypond[quote,verbatim,relative=2] +<< + \new Staff << + \new Voice = "A" { + \voiceOne + c8 c c4 c c + } + \new Voice = "A" { + \voiceTwo + g4 g g g + } + >> +>> +@end lilypond -この構文は @var{id} という名前の @var{type} タイプのコンテキストが@c -すで存在していないか検索します。@c -コンテキストがまだ存在していなければ、@c -指定された名前を持つコンテキストが新たに作成されます。@c -これは、コンテキストを後で参照する場合に有用です。@c -例えば、以下のように名前を付けられたメロディ: +@item +コンテキスト名を持つ @code{\context} は、階層、名前、それにタイプが@c +同じコンテキストが存在しない場合にのみ、新たなコンテキスを作成します。@c +存在する場合、@code{\context} はすでに作成されているコンテキストへの@c +参照となり、音楽表記はそのコンテキストに渡されて処理されます。 -@example -\context Voice = "@b{tenor}" @var{music} -@end example +名前を持つコンテキストの用途の 1 つとして、楽譜レイアウトと音楽コンテンツ@c +を分離させることができます。@c +以下の 2 つの形式はどちらも有効です: -@noindent -に、以下のように歌詞を設定すると、テキストは適切に音符に揃えられます: +@c KEEP LY +@lilypond[quote,verbatim] +\score { + << + % 楽譜レイアウト + \new Staff << + \new Voice = "one" { + \voiceOne + } + \new Voice = "two" { + \voiceTwo + } + >> -@example -\new Lyrics \lyricsto "@b{tenor}" @var{lyrics} -@end example + % 音楽コンテンツ + \context Voice = "one" { + \relative c'' { + c4 c c c + } + } + \context Voice = "two" { + \relative c'' { + g8 g g4 g g + } + } + >> +} +@end lilypond -@noindent +@c KEEP LY +@lilypond[quote,verbatim] +\score { + << + % 楽譜レイアウト + \new Staff << + \context Voice = "one" { + \voiceOne + } + \context Voice = "two" { + \voiceTwo + } + >> + + % 音楽コンテンツ + \context Voice = "one" { + \relative c'' { + c4 c c c + } + } + \context Voice = "two" { + \relative c'' { + g8 g g4 g g + } + } + >> +} +@end lilypond 名前付きコンテキストの他の使用例として、2 つの音楽表記をつなげて 1 つのコンテキストにすることができます。@c 以下の例では、アーティキュレーションと音符は別々に入力されています: +@noindent +変数を用いても同じことができます。@c +@rlearning{Organizing pieces with variables} を参照してください。 -@example -music = @{ c4 c4 @} -arts = @{ s4-. s4-> @} -@end example - -これらを同じ @code{Voice} コンテキストに送ることによって@c -組み合わせることができます: +@item +コンテキスト名を持たない @code{\context} は、階層とタイプが一致する@c +コンテキストのうち最初に作成されたものに適用され +(例えそのコンテキストが名前を持っていたとしても適用されます)、@c +音楽表記はそのコンテキストに渡されて処理されます。@c +この形式が有用なことは稀です。@c +しかしながら、コンテキスト名と音楽表記を持たない @code{\context} +は、コンテキスト内で @code{\applyContext} で記述した Scheme +プロシージャを実行させるのに用いられます: @example -<< - \new Staff \context Voice = "A" \music - \context Voice = "A" \arts ->> +\new Staff \relative c' @{ + c1 + \context Timing + \applyContext #(lambda (ctx) + (newline) + (display (ly:context-current-moment ctx))) + c1 +@} @end example -@lilypond[quote,ragged-right] -music = { c4 c4 } -arts = { s4-. s4-> } -\relative c'' << - \new Staff \context Voice = "A" \music - \context Voice = "A" \arts ->> -@end lilypond - -このメカニズムを用いることで、原典版 (オリジナル版) を定義し、@c -オプションとしてそれに異なるアーティキュレーションを付けることができます。 -@cindex creating contexts (コンテキストを作成する) +@end itemize -@item -コンテキストを作成する 3 つ目のコマンドは以下の通りです: +後で参照するコンテキストには名前を付ける必要があります。@c +例えば、歌詞を音楽に関連付けるような場合です: @example -\context @var{type} @var{music} +\new Voice = "tenor" @var{music} +... +\new Lyrics \lyricsto "tenor" @var{lyrics} @end example @noindent -これは @code{= @var{id}} を持つ @code{\context} に似ていますが、@c -タイプ @var{type} のすべてのコンテキストに適用されます --- そのコンテキストに与えられた名前とは関係なく適用されます。@c +歌詞を音楽に関連付ける方法についての詳細は +@ref{Automatic syllable durations} を参照してください。 -この構文の変形版は、@c -異なる階層で解釈される可能性がある音楽表記に対して使用されます。@c -例えば、@code{\applyOutput} コマンド -(@rextend{Running a function on all layout objects} を参照してください) -です。@c -明示的に @code{\context} を指定しなければ、通常は @code{Voice} に適用されます。 +ある特定のタイプのすべてのコンテキストのプロパティを @code{\layout} +ブロックで変更することができます (構文は異なります) +-- @ref{Changing all contexts of the same type} を参照してください。@c +この構造でもレイアウトを音楽コンテンツから分離させることができます。@c +単一のコンテキストを変更するのであれば、@code{\with} ブロックを用いる@c +必要があります -- @ref{Changing just one specific context} を参照@c +してください。 -@example -\applyOutput #'@var{context} #@var{function} % Voice に適用されます -@end example - -@code{Score} レベルや @code{Staff} レベルで解釈させるには、以下のようにします: +@seealso -@example -\applyOutput #'Score #@var{function} -\applyOutput #'Staff #@var{function} -@end example +学習マニュアル: +@rlearning{Organizing pieces with variables} -@end itemize +記譜法リファレンス: +@ref{Changing just one specific context}, +@ref{Automatic syllable durations} @node コンテキストを残しておく @@ -604,7 +676,7 @@ words = \lyricmode { These words fol -- low the mel -- o -- dy } プロパティを保存するだけなく、@c @q{エングラーバ} と呼ばれる記譜要素を作成するプラグインを保持します。@c 例えば、@code{Voice} コンテキストは @code{Note_head_engraver} を保持し、@c -@code{Staff} コンテキストは @code{Key_signature_engraver} を保持します。 +@code{Staff} コンテキストは @code{Key_engraver} を保持します。 各プラグインについての説明は、 @ifhtml @@ -678,7 +750,7 @@ Internals Reference @expansion{} Translation @expansion{} Context. @code{Staff} コンテキストへ異動させることにより、@c 楽譜の各譜に独自の拍子記号を持たせることが可能になります。 -@cindex polymetric scores (複合拍子楽譜) +@cindex polymetric scores (多拍子の楽譜) @cindex Time signatures, multiple (複数の拍子記号) @lilypond[quote,relative=1,ragged-right,verbatim,fragment] @@ -705,85 +777,341 @@ Internals Reference @expansion{} Translation @expansion{} Context. @knownissues +エングラーバを指定する順序は、エングラーバが処理を行う順序です。@c 通常、エングラーバが指定される順序は問題にはなりません。@c しかしながら、いくつかの特殊なケースでは、この順序が重要になります。@c 例えば、あるエングラーバがプロパティを記述して、@c それを他のエングラーバが読む場合、あるいは、@c あるエングラーバがグラフィカル オブジェクトを作成し、@c それを他のエングラーバが処理しなければならない場合です。@c -エングラーバは指定された順序に従って呼び出され、処理を実行します。 以下の順序は重要です: -通常、@code{Bar_engraver} を最初に指定し、@c -@code{New_fingering_engraver} を @code{Script_column_engraver} の前で@c -指定する必要があります。@c -他にも指定順序が問題になるケースがあるかもしれません。 + +@itemize +@item +通常、@code{Bar_engraver} を最初にする必要があります。 + +@item +@code{New_fingering_engraver} を @code{Script_column_engraver} の前に@c +配置する必要があります。 + +@item +@code{Timing_translator} を @code{Bar_number_engraver} の前に配置する@c +必要があります。 + +@end itemize + +@seealso +インストールされているファイル: +@file{ly/engraver-init.ly} @node コンテキストのデフォルト設定を変更する @subsection コンテキストのデフォルト設定を変更する @translationof Changing context default settings -@code{Score}, @code{Staff} それに @code{Voice} コンテキストにおいて@c -デフォルトで使用されるコンテキスト設定は、以下の例で示すように、@c -@code{\layout} ブロックの中で指定することができます。@c -@code{\layout} ブロックは、それを適用する @code{\score} ブロックの中で、かつ、@c -音楽表記の外側に配置する必要があります。 +@cindex default context properties, changing (デフォルトのコンテキスト プロパティを変更する) +@cindex context properties, changing defaults (デフォルトのコンテキスト プロパティを変更する) + +@ref{Modifying properties} で説明したように、コンテキストとグラフィカル +オブジェクトのプロパティを @code{\set} コマンドや @code{\override} +コマンドで変更することができます。@c +これらのコマンドは音楽イベントを生成して、楽譜処理中にコマンドが出現する@c +ポイントで変更に効果を発揮させます。 + +対照的に、このセクションではコンテキストが作成された時点でコンテキストと@c +グラフィカル オブジェクトのプロパティの @emph{デフォルト} 値を変更する@c +方法を説明します。@c +これを行う方法は 2 つあります。@c +1 つはある特定のタイプの全コンテキストのデフォルト値を変更する方法で、@c +もう 1 つはただ 1 つのコンテキストのインスタンスのデフォルト値を変更する@c +方法です。 + +@menu +* 同じタイプの全コンテキストを変更する:: +* 指定したコンテキストだけを変更する:: +* 適用順序:: +@end menu + +@node 同じタイプの全コンテキストを変更する +@unnumberedsubsubsec 同じタイプの全コンテキストを変更する +@translationof Changing all contexts of the same type + +@cindex \context in \layout block (\layout ブロックの中の \context) +@funindex \context +@funindex \layout + +@code{Score}, @code{Staff}, @code{Voice}, その他のコンテキストにおいて@c +デフォルトで使用されるコンテキスト設定は、@code{\layout} ブロックの中の@c +@code{\context} ブロックでで指定することができます。@c +@code{\layout} ブロックは、それを適用する @code{\score} ブロックの中で、@c +かつ、音楽表記の後に配置する必要があります。 + +@example +\layout @{ + \context @{ + \Voice + [すべての Voice コンテキストのコンテキスト設定] + @} + \context @{ + \Staff + [context settings for all Staff contexts] + @} +@} +@end example + +以下のタイプの設定を指定することができます: -以下のような方法でコンテキストのデフォルト値を指定する場合、@c -@code{\set} コマンドとコンテキストを@c -省略する必要があるということに注意してください: +@itemize +@item +@code{\override} コマンド -- コンテキスト名を省略します + +@lilypond[quote,verbatim] +\score { + \relative c'' { + a4^"Thicker stems" a a a + a4 a a\ff a + } + \layout { + \context { + \Staff + \override Stem.thickness = #4.0 + } + } +} +@end lilypond + +@item +コンテキスト プロパティを直接設定します @lilypond[quote,verbatim] \score { \relative c'' { - a4^"Really small, thicker stems, no time signature" a a a - a a a a + a4^"Smaller font" a a a + a4 a a\ff a } \layout { \context { \Staff fontSize = #-4 - \override Stem #'thickness = #4.0 - \remove "Time_signature_engraver" } } } @end lilypond -上記の例の中で、@code{\Staff} コマンドは、@c -後に続く記述をその score ブロックの中にあるすべての譜に適用するということを@c -指定しています。 +@item +@code{\dynamicUp} や @code{\accidentalStyle dodecaphonic} のような音楽@c +表記等、あらかじめ定義されているコマンド -同様の方法で、@c -@code{Score} コンテキストや @code{Voice} コンテキストに@c -変更を適用することができます。 +@lilypond[quote,verbatim] +\score { + \relative c'' { + a4^"Dynamics above" a a a + a4 a a\ff a + } + \layout { + \context { + \Voice + \dynamicUp + } + \context { + \Staff + \accidentalStyle dodecaphonic + } + } +} +@end lilypond -@knownissues +@item +@code{\with} ブロックを有するユーザ定義変数 -- @code{\with} ブロックの@c +詳細は @ref{Changing just one specific context} を参照してください。 -変数に加えられたコンテキストの変更を収集すること、それに、@c -その変数を参照することでそれらの変更を @code{\context} 定義に@c -適用することはできません。 +@lilypond[quote,verbatim] +StaffDefaults = \with { + fontSize = #-4 +} -@code{\RemoveEmptyStaffContext} はカレントの -@code{\Staff} 設定を上書きします。@c -@code{\RemoveEmptyStaffContext} を使用する staff -のデフォルト設定を変更したいのならば、@c -@code{\RemoveEmptyStaffContext} を呼び出した後に@c -変更を加える必要があります。@c -つまり、以下のようにします: +\score { + \new Staff { + \relative c'' { + a4^"Smaller font" a a a + a4 a a a + } + } + \layout { + \context { + \Staff + \StaffDefaults + } + } +} +@end lilypond -@example -\layout @{ - \context @{ - \RemoveEmptyStaffContext +@end itemize - \override Stem #'thickness = #4.0 - @} +プロパティ設定コマンドは、@code{\context} ブロックで囲まずに、@c +@code{\layout} ブロックの中に配置することができます。@c +そのような設定は、指定されたタイプの任意のコンテキストの開始時に@c +プロパティ設定コマンドをインクルードするのと等価です。@c +コンテキストを指定しない場合、@emph{すべての} 下位コンテキストに影響を@c +与えます -- @ref{Bottom-level contexts - voices} を参照してください。@c +@code{\layout} ブロックの中でのプロパティ設定コマンドの構文は、@c +音楽ストリームの中で同じコマンドを記述するのと同じです。 + +@lilypond[quote,verbatim] +\score { + \new Staff { + \relative c'' { + a4^"Smaller font" a a a + a4 a a a + } + } + \layout { + \accidentalStyle dodecaphonic + \set fontSize = #-4 + \override Voice.Stem.thickness = #4.0 + } +} +@end lilypond + + +@node 指定したコンテキストだけを変更する +@unnumberedsubsubsec 指定したコンテキストだけを変更する +@translationof Changing just one specific context + +@cindex \with +@funindex \with + +@code{\with} ブロックで指定したコンテキスト インスタンスのコンテキスト +プロパティだけを変更することができます。@c +他の全ての同じタイプのコンテキスト インスタンスは、LilyPond に組み込まれて@c +スコープ内の @code{\layout} ブロックによって変更されたデフォルト設定の@c +ままです。@c +@code{\with} ブロックは @code{\new} @var{context-type} コマンドの直後に@c +配置する必要があります: + +@example +\new Staff +\with @{ + [このコンテキスト インスタンスだけに適用されるコンテキスト設定] +@} @{ +... @} @end example -@c TODO: add \with in here. +以下のタイプの設定を指定することができます: + +@itemize +@item +@code{\override} コマンド -- コンテキスト名を省略します + +@lilypond[quote,verbatim] +\score { + \new Staff { + \new Voice + \with { + \override Stem.thickness = #4.0 + } + { + \relative c'' { + a4^"Thick stems" a a a + a4 a a a + } + } + } +} +@end lilypond + +@item +コンテキスト プロパティを直接設定します + +@lilypond[quote,verbatim] +\score { + << + \new Staff { + \relative c'' { + a4^"Default font" a a a + a4 a a a + } + } + \new Staff + \with { + fontSize = #-4 + } { + \relative c'' { + a4^"Smaller font" a a a + a4 a a a + } + } + >> +} +@end lilypond + +@item +@code{\dynamicUp} 等のあらかじめ定義されているコマンド + +@lilypond[quote,verbatim] +\score { + << + \new Staff { + \new Voice { + \relative c'' { + a4^"Dynamics below" a a a + a4 a a\ff a + } + } + } + \new Staff + \with { \accidentalStyle dodecaphonic } + { + \new Voice + \with { \dynamicUp } + { + \relative c'' { + a4^"Dynamics above" a a a + a4 a a\ff a + } + } + } + >> +} +@end lilypond + +@end itemize + +@node 適用順序 +@unnumberedsubsubsec 適用順序 +@translationof Order of precedence + +ある特定のタイミングで適用されるプロパティの値は以下のように決定されます: + +@itemize +@item +入力ストリームの中の @code{\override} コマンドや @code{\set} コマンドが +ある場合、その値が用いられます。 + +@item +さもなければ、コンテキスト初期宣言の @code{\with} から取得したデフォルト値@c +が用いられます。 + +@item +さもなければ、@code{\layout} ブロックの中にある直近で適切な @code{\context} +ブロックから取得したデフォルト値が用いられます。 + +@item +さもなければ、LilyPond の組み込みデフォルト値が用いられます。 +@end itemize + +@seealso +学習マニュアル: +@rlearning{Modifying context properties} + +記譜法リファレンス: +@ref{Contexts explained}, +@ref{Bottom-level contexts - voices}, +@ref{The set command}, +@ref{The override command}, +@ref{The \layout block} @node 新しいコンテキストを定義する @@ -824,11 +1152,10 @@ Internals Reference @expansion{} Translation @expansion{} Context. \consists "Note_heads_engraver" \consists "Rhythmic_column_engraver" \consists "Text_engraver" - \consists Pitch_squash_engraver + \consists "Pitch_squash_engraver" squashedPosition = #0 - \override NoteHead #'style = #'slash - \override Stem #'transparent = ##t - \override Flag #'transparent = ##t + \override NoteHead.style = #'slash + \hide Stem \alias Voice } \context { \Staff @@ -874,14 +1201,14 @@ Internals Reference @expansion{} Translation @expansion{} Context. それらの機能を提供するエングラーバを付け加える必要があります: @example -\consists Note_heads_engraver -\consists Text_engraver +\consists "Note_heads_engraver" +\consists "Text_engraver" @end example しかしながら、音符の代わりにスラッシュを譜の中央線上に配置します: @example -\consists Pitch_squash_engraver +\consists "Pitch_squash_engraver" squashedPosition = #0 @end example @@ -893,10 +1220,8 @@ squashedPosition = #0 音符はスラッシュで、符幹を持ちません: @example -\override NoteHead #'style = #'slash -\override Stem #'transparent = ##t -\override Flag #'transparent = ##t -\override Flag #'transparent = ##t +\override NoteHead.style = #'slash +\hide Stem @end example これらのプラグインすべてが共同する必要があり、@c @@ -916,12 +1241,10 @@ squashedPosition = #0 \type "Engraver_group" \consists "Note_heads_engraver" \consists "Text_engraver" - \consists Pitch_squash_engraver + \consists "Pitch_squash_engraver" squashedPosition = #0 - \override NoteHead #'style = #'slash - \override Stem #'transparent = ##t - \override Flag #'transparent = ##t - \override Flag #'transparent = ##t + \override NoteHead.style = #'slash + \hide Stem \alias Voice @} @end example @@ -973,81 +1296,109 @@ squashedPosition = #0 @end example -@node コンテキストを揃える -@subsection コンテキストを揃える -@translationof Aligning contexts +@node コンテキストの配置順序 +@subsection コンテキストの配置順序 +@translationof Context layout order -新しいコンテキストを既存のコンテキストの上または下に揃えることができます。@c -これはボーカル譜 (@rlearning{合唱}) を組む場合やオッシアで役に立ちます。 +@cindex contexts, layout order (コンテキストの配置順序) +@funindex \accepts +@funindex \denies -@c TODO Better example needed. Ref LM, and expand on it. +通常、コンテキストは入力ファイルの中で記述した順に楽譜の段の上から下に@c +配置されます。@c +コンテキストがネストされている場合、外側のコンテキストは入力ファイルの@c +中で指定されたコンテキストを内側に保持して、内側のコンテキストは外側の@c +コンテキストの @qq{accepts} リストに含まれます。@c +ネストされたコンテキストのうち外側のコンテキストの @qq{accepts} リスト@c +に含まれないものは、ネストされずに外側のコンテキストの下に再配置されます。 + +コンテキストの @qq{accepts} リストを @code{\accepts} コマンドと +@code{\denies} コマンドで変更することができます。@c +@code{\accepts} はコンテキストを @qq{accepts} リストに追加して、@c +@code{\denies} は @qq{accepts} リストからコンテキストを削除します。@c +例えば、通常、コード ネームは @code{Staff} コンテキストの中にネスト@c +されないため、@code{ChordNames} コンテキストはデフォルトでは @code{Staff} +コンテキストの @qq{accepts} リストには含まれませんが、リストに含める必要が@c +あれば含めることができます: -@cindex ossia (オッシア) -@funindex alignAboveContext -@funindex alignBelowContext +@lilypond[verbatim,quote] +\score { + \new Staff { + c' d' e' f' + \chords { d1:m7 b1:min7.5- } + } +} +@end lilypond -@lilypond[quote,ragged-right] -ossia = { f4 f f f } -\score{ - \relative c' \new Staff = "main" { - c4 c c c - << - \new Staff \with { alignAboveContext = #"main" } \ossia - { d8 f d f d f d f } - >> +@lilypond[verbatim,quote] +\score { + \new Staff { + c' d' e' f' + \chords { d1:m7 b1:min7.5- } + } + \layout { + \context { + \Staff + \accepts "ChordNames" + } } } @end lilypond -@cindex nested contexts (ネストされたコンテキスト) -@cindex contexts, nested (ネストされたコンテキスト) +@code{\denies} は主に、他のコンテキストをベースに新しいコンテキストを@c +作成した時に、中にネストするコンテキストを変更するために用いられます。 -@funindex \accepts -@funindex \denies +例えば、@code{VaticanaStaff} コンテキストは @code{Staff} コンテキストを@c +ベースにしていますが、@qq{accepts} リストでは @code{Voice} コンテキスト@c +の代わりに @code{VaticanaVoice} コンテキストを保持しています。 -@code{PianoStaff} のようなコンテキストは、@c -ネスト (入れ子) 構造をとって、@c -他のコンテキストを内部に保持することができます。@c -ネスト構造をとることができるコンテキストは、@c -コンテキストの @qq{accepts} リストによって定義されています。@c -このリストには存在しないコンテキストは、楽譜が譜刻されるとき、@c -(@code{PianoStaff} などの) 親コンテキストの下に配置されます。@c -例えば、@code{PianoStaff} コンテキストは、デフォルトで、@c -@code{Staff} と @code{FiguredBass} コンテキストを内部に受け入れるよう@c -定義されていますが、(例えば) @code{Lyrics} コンテキストは受け入れません。@c -そのため、以下の例では、歌詞は 2 つの譜の間ではなく、@c -ピアノ譜の下に配置されています: +コンテキストに保持されるべきコマンドが出現して、それを保持するための@c +適切なコンテキストが存在しない場合、コンテキストが暗黙的に作成される@c +ということに注意してください。@c +これは予期しない譜や楽譜を生み出す可能性があります。 -@lilypond[verbatim,quote,relative=1] -\new PianoStaff -<< - \new Staff { e4 d c2 } - \addlyrics { Three blind mice } - \new Staff { - \clef "bass" - { c,1 } - } ->> -@end lilypond +@cindex alignAboveContext +@cindex alignBelowContext +@funindex alignAboveContext +@funindex alignBelowContext -コンテキストの @qq{accepts} リストを変更することで、 -ネストされるコンテキストを追加するができます。@c -ですから、歌詞を 2 つの譜の間に表示させたいのなら、以下のようにします: +短い期間、あるコンテキストを存在させる必要がある場合があります。@c +オッシアの譜コンテキストが良い例です。@c +通常、これは主音楽の対応するセクションと並列に、適切な場所でコンテキスト@c +定義を行うことで実現します。@c +デフォルトでは、一時コンテキストは既存のすべてのコンテキストの下に配置@c +されます。@c +@qq{main} というコンテキストの上に配置し直すには以下のようにします: -@lilypond[verbatim,quote,relative=1] -\new PianoStaff \with { \accepts Lyrics } -<< - \new Staff { e4 d c2 } - \addlyrics { Three blind mice } - \new Staff { - \clef "bass" - { c,1 } - } ->> -@end lilypond +@example +@code{\new Staff \with @{ alignAboveContext = #"main" @} } +@end example -@code{\accepts} の反対は @code{\denies} です。@c -これはコンテキストを @qq{accepts} リストから削除します。 +@code{ChoirStaff} のような複数の譜のレイアウトで一時的な歌詞を配置する場合 +-- 例えば、繰り返しセクションに 2 番目の歌詞を追加する場合 -- +にも同様な状況が発生します。@c +デフォルトでは、一時的な歌詞は下段の譜の下に配置されます。@c +一時的な歌詞コンテキストを @code{alignBelowContext} で定義することにより、@c +1 番目の歌詞を保持する (名前付きの) 歌詞コンテキストの下に配置することが@c +できます。 + +一時コンテキストを再配置する例は他にもあります +-- @rlearning{Nesting music expressions}、+@ref{Modifying single staves}、@c +それに @ref{Techniques specific to lyrics} を参照してください。 + +@seealso +学習マニュアル: +@rlearning{Nesting music expressions} + +記譜法リファレンス: +@ref{Modifying single staves}, +@ref{Techniques specific to lyrics} + +アプリケーション使用方法: +@rprogram{An extra staff appears} + +インストールされているファイル: +@file{ly/engraver-init.ly} @node 内部リファレンスの説明 @@ -1058,7 +1409,7 @@ ossia = { f4 f f f } @menu * 内部リファレンスを使いこなす:: * レイアウト インターフェイス:: -* グラフィカル オブジェクトを決定する:: +* グラフィカル オブジェクト プロパティを決定する:: * 命名規約:: @end menu @@ -1170,7 +1521,6 @@ Music expressions named @rinternals{FingeringEvent} (@rinternals{fingering-event}: 音楽イベント タイプ @code{fingering-event} は @rinternals{FingeringEvent} という名前の音楽表記の中にあります) - @end itemize このパスは、プログラム内部での情報フローとは逆向きです: @@ -1321,8 +1671,8 @@ This object supports the following interfaces: この定義から直接生成されたに過ぎません。 -@node グラフィカル オブジェクトを決定する -@subsection グラフィカル オブジェクトを決定する +@node グラフィカル オブジェクト プロパティを決定する +@subsection グラフィカル オブジェクト プロパティを決定する @translationof Determining the grob property @c TODO remove this (it's in the LM) @@ -1376,14 +1726,14 @@ Add this much extra space between objects that are next to each other. 以下のコマンドは、音符と運指記号の間に 3 譜スペースを挿入します: @example -\once \override Voice.Fingering #'padding = #3 +\once \override Voice.Fingering.padding = #3 @end example このコマンドを @code{Fingering} オブジェクトが作成される前に挿入する -- つまり @code{c2} の前に挿入する -- と、以下のような結果が得られます: @lilypond[quote,relative=2,fragment,verbatim] -\once \override Voice.Fingering #'padding = #3 +\once \override Voice.Fingering.padding = #3 c-2 \stemUp f @@ -1397,6 +1747,7 @@ f @quotation Fingering_engraver is part of contexts: @dots{} @rinternals{Voice} + (Fingering_engraver は次のコンテキストの一部です: @dots{} @rinternals{Voice}) @end quotation @@ -1417,7 +1768,6 @@ Fingering_engraver is part of contexts: @dots{} @rinternals{Voice} -- 例: as-scheme-functions @item グラフィカル オブジェクト インターフェイス: Scheme スタイルです -- 例: scheme-style -@c 未訳 @item バックエンド プロパティ: Scheme スタイルです (が、X と Y があります!) @item コンテキスト (それに、音楽表記とグラフィカル オブジェクト): 大文字で始まる単語、あるいはそれらをつなげます @@ -1497,7 +1847,7 @@ discuss the functionality of this command. The command @verbatim -\override Staff.Stem #'thickness = #4.0 +\override Staff.Stem.thickness = #4.0 @end verbatim @noindent @@ -1508,7 +1858,7 @@ appearance. Here we see the command in action: @lilypond[quote,verbatim,relative=2,fragment] c4 -\override Staff.Stem #'thickness = #4.0 +\override Staff.Stem.thickness = #4.0 c4 c4 c4 @@ -1524,7 +1874,7 @@ causing the default context @code{Voice} to be used. Adding @lilypond[quote,fragment,verbatim,relative=2] c4 -\once \override Stem #'thickness = #4.0 +\once \override Stem.thickness = #4.0 c4 c4 @end lilypond @@ -1535,9 +1885,9 @@ or beams, the @code{\override} command must be executed at the moment when the object is created. In this example, @lilypond[quote,fragment,verbatim,relative=2] -\override Slur #'thickness = #3.0 +\override Slur.thickness = #3.0 c8[( c -\override Beam #'thickness = #0.6 +\override Beam.beam-thickness = #0.6 c8 c]) @end lilypond @@ -1551,8 +1901,8 @@ affects settings that were made in the same context. In other words, the @code{\revert} in the next example does not do anything. @example -\override Voice.Stem #'thickness = #4.0 -\revert Staff.Stem #'thickness +\override Voice.Stem.thickness = #4.0 +\revert Staff.Stem.thickness @end example Some tweakable options are called @q{subproperties} and reside inside @@ -1567,7 +1917,7 @@ properties. To tweak those, use commands of the form such as @example -\override Stem #'(details beamed-lengths) = #'(4 4 3) +\override Stem.details.beamed-lengths = #'(4 4 3) @end example @end ignore @@ -1731,21 +2081,18 @@ Translation @expansion{} Tunable context properties. @end ifnothtml @seealso - 内部リファレンス: - @rinternals{Tunable context properties} -@cindex grob properties (グラフィカル オブジェクト プロパティ) -@cindex properties, grob (グラフィカル オブジェクト プロパティ) -@funindex \override - - @node override コマンド @subsection @code{\override} コマンド @translationof The override command +@cindex grob properties (グラフィカル オブジェクト プロパティ) +@cindex properties, grob (グラフィカル オブジェクト プロパティ) +@funindex \override + 特殊なタイプのコンテキスト プロパティがあります: グラフィカル オブジェクト記述です。@c グラフィカル オブジェクト記述には @code{StudlyCaps} という名前 @@ -1756,49 +2103,30 @@ Translation @expansion{} Tunable context properties. @file{scm/define-grobs.scm} を参照してください。@c 各グラフィカル オブジェクト記述は @code{\override} を用いて変更します。 -@code{\override} は、実際のところ、簡略化した記述です。 - -@example -\override @var{context}.@var{GrobName} #'@var{property} = #@var{value} -@end example - -@noindent -これは、以下と等価です: +@code{\override} コマンドの構文は以下の通りです: -@c leave this long line -gp @example -\set @var{context}.@var{GrobName} = - #(cons (cons '@var{property} @var{value}) - ) +\override [@var{context}.]@var{GrobName}.@var{property} = #@var{value} @end example -@code{context}.@code{GrobName} (alist) の値は、@c -個々のグラフィカル オブジェクトのプロパティを初期化するために使用されます。@c -グラフィカル オブジェクトは、Scheme スタイルの名前 -(小文字の単語を @code{-} でつないだもの) のプロパティを持ちます。@c -グラフィカル オブジェクト プロパティの値は、@c -フォーマット処理の間ずっと変更されています: -基本的に、フォーマット処理は、@c -コールバック関数を用いてプロパティを計算することに他なりません。@c - 例えば、@code{Stem} オブジェクトの @code{thickness} プロパティを@c オーバライドすることによって、符幹の太さを太くすることができます: @lilypond[quote,verbatim,relative=2] c4 c -\override Voice.Stem #'thickness = #3.0 +\override Voice.Stem.thickness = #3.0 c4 c @end lilypond -If no context is specified in an @code{\override}, the bottom -context is used: +@code{\override} でコンテキストが指定されていない場合、その下にある@c +コンテキストに適用されます: @lilypond[quote,verbatim,relative=2] -{ \override Staff.Stem #'thickness = #3.0 +{ \override Staff.Stem.thickness = #3.0 << { e4 e - \override Stem #'thickness = #0.5 + \override Stem.thickness = #0.5 e4 e } \\ { c4 c c c @@ -1807,17 +2135,40 @@ context is used: } @end lilypond +調整可能なオプションには @q{サブプロパティ} があり、これはプロパティの@c +内部に存在します。@c +これを調整するには、以下のような形式のコマンドを用います: + +@example +\override Stem.details.beamed-lengths = #'(4 4 3) +@end example + +また、スパナの端を変更するには、以下のようにします: + +@example +\override TextSpanner.bound-details.left.text = #"left text" +\override TextSpanner.bound-details.right.text = #"right text" +@end example + @funindex \revert @cindex reverting overrides (オーバライドを元に戻す) @cindex overrides, reverting (オーバライドを元に戻す) -@code{\override} の効果は、@code{\revert} によって元に戻すことができます: +@code{\override} の効果は、@code{\revert} によって元に戻すことができます。 + +@code{\revert} の構文は以下の通りです: + +@example +\revert [@var{context}.]@var{GrobName}.@var{property} +@end example + +例を示します: @lilypond[quote,verbatim,relative=2] c4 -\override Voice.Stem #'thickness = #3.0 +\override Voice.Stem.thickness = #3.0 c4 c -\revert Voice.Stem #'thickness +\revert Voice.Stem.thickness c4 @end lilypond @@ -1830,11 +2181,11 @@ c4 << { e4 - \override Staff.Stem #'thickness = #3.0 + \override Staff.Stem.thickness = #3.0 e4 e e } \\ { c4 c c - \revert Staff.Stem #'thickness + \revert Staff.Stem.thickness c4 } >> @@ -1851,11 +2202,11 @@ c4 { << { - \override Stem #'thickness = #3.0 + \override Stem.thickness = #3.0 e4 e e e } \\ { c4 - \once \override Stem #'thickness = #3.0 + \once \override Stem.thickness = #3.0 c4 c c } >> @@ -1867,7 +2218,7 @@ c4 Commands which change output generally look like @example -\override Voice.Stem #'thickness = #3.0 +\override Voice.Stem.thickness = #3.0 @end example @noindent @@ -1880,13 +2231,6 @@ To construct this tweak we must determine these bits of information: @item a sensible value: here @code{3.0}. @end itemize -Some tweakable options are called @q{subproperties} and reside inside -properties. To tweak those, use commands in the form - -@example -\override Stem #'(details beamed-lengths) = #'(4 4 3) -@end example - @cindex internal documentation @cindex finding graphical objects @cindex graphical object descriptions @@ -1904,7 +2248,6 @@ and the program reference. @end ignore @seealso - 内部リファレンス: @rinternals{Backend} @@ -1925,11 +2268,12 @@ and the program reference. @code{\tweak} コマンドは以下のような構文を持ちます: @example -\tweak #'@code{grob-property} #@code{value} +\tweak [@var{layout-object}.]@var{grob-property} @var{value} @end example +@code{layout-object} の指定はオプションです。@c @code{\tweak} コマンドは、音楽の流れの中で -@code{value} のすぐ後に現れるオブジェクトに変更を適用します。 +@code{value} のすぐ後に現れる音楽オブジェクトに変更を適用します。 @ignore In some cases, it is possible to take a short-cut for tuning @@ -1939,19 +2283,19 @@ For example: @lilypond[relative=2,verbatim,quote] < c - \tweak #'color #red + \tweak color #red d g - \tweak #'duration-log #1 + \tweak duration-log #1 a > 4 --\tweak #'padding #8 +-\tweak padding #8 -^ @end lilypond -But the main use of the @code{\tweak} command is to modify just +The main use of the @code{\tweak} command is to modify just one of a number of notation elements which start at the same musical moment, like the notes of a chord, or tuplet brackets which start at the same time. @@ -1973,14 +2317,14 @@ note, and able to modify it. So, this works: @lilypond[relative=2,verbatim,quote] -<\tweak #'color #red c>4 +<\tweak color #red c>4 @end lilypond @noindent but this does not: @lilypond[relative=2,verbatim,quote] -\tweak #'color #red c4 +\tweak color #red c4 @end lilypond @end ignore @@ -2011,10 +2355,10 @@ but this does not: @lilypond[relative=2,verbatim,quote] < c - \tweak #'color #red + \tweak color #red d g - \tweak #'duration-log #1 + \tweak duration-log #1 a > 4 @end lilypond @@ -2022,7 +2366,7 @@ but this does not: @code{\tweak} を用いて、スラーを変更することができます: @lilypond[verbatim,quote,relative=1] -c-\tweak #'thickness #5 ( d e f) +c-\tweak thickness #5 ( d e f) @end lilypond @@ -2030,37 +2374,48 @@ c-\tweak #'thickness #5 ( d e f) 入力ファイルが音楽の流れに変換されたときに、@c @code{\tweak} コマンドのすぐ後に@c 変更が適用されるオブジェクトが配置されている必要があります。 -LilyPond は、構文解釈処理時に、@c -追加のオブジェクトを音楽の流れの中に挿入する場合があります。@c -例えば、明示的には和音の一部になっていない音符を、@c -LilyPond が音符の中に配置する場合があります。@c -そのため、@code{\tweak} で変更される音符は、@c -和音構造の中に配置されている必要があります: +和音全体に対する調整は何の効果もありません。@c +なぜなら、和音の音楽イベントはコンテナと機能するだけで、すべてのレイアウト +オブジェクトは @code{EventChord} の内部にあるイベントによって作成される@c +からです: @lilypond[relative=2,verbatim,quote] -\tweak #'color #red c4 -<\tweak #'color #red c>4 +\tweak color #red c4 +\tweak color #red 4 +<\tweak color #red c e>4 @end lilypond -@code{\tweak} コマンドは、@c -入力ファイルの中で明示的に記述されていないオブジェクトを@c -変更するために用いることはできません。@c -特に、符幹、連桁、あるいは臨時記号を直接変更することはできません。@c -なぜなら、それらは入力の中にある音楽要素の後ではなく、@c -符頭の後に生成されるからです。@c -さらに、音部記号や拍子記号を変更することもできません。@c -なぜなら、コンテキストを指定するために必要とされる追加要素の自動挿入により、@c -それらは前に配置された @code{\tweak} コマンドとは分離されるからです。@c +単純な @code{\tweak} コマンドでは入力から直接作成されないオブジェクトを@c +変更することはできません。@c +特に、符幹、自動連桁、それに臨時記号には効果を持ちません。@c +なぜなら、それらは入力ストリームの中の音楽要素によって生成される@c +のではなく、後になって @code{NoteHead} レイアウト オブジェクトによって@c +生成されるからです。 + +そのような直接作成されないレイアウト オブジェクトは、グラフィカル +オブジェクト名を明示的に指定した @code{\tweak} コマンドを用いることで@c +調整することができます: + +@lilypond[relative=2,verbatim,quote] +\tweak Stem.color #red +\tweak Beam.color #green c8 e +4 +@end lilypond + +@code{\tweak} コマンドで音部記号や拍子記号を変更することはできません。@c +なぜなら、コンテキストを指定するために必要とされる追加要素の自動挿入に@c +より、それらは前に配置された @code{\tweak} コマンドとは分離されるから@c +です。 記譜要素の前に複数の @code{\tweak} コマンドを配置することができます -- それらはすべて効果を持ちます: @lilypond[verbatim,quote,relative=1] c --\tweak #'style #'dashed-line --\tweak #'dash-fraction #0.2 --\tweak #'thickness #3 --\tweak #'color #red +-\tweak style #'dashed-line +-\tweak dash-fraction #0.2 +-\tweak thickness #3 +-\tweak color #red \glissando f' @end lilypond @@ -2073,7 +2428,6 @@ f' あるいは、@c @code{\tweak} の適用で入力を調整する方法を決定するときに役に立つかもしれません。 - @seealso 学習マニュアル: @rlearning{調整手段} @@ -2081,27 +2435,16 @@ f' 拡張: @rextend{Displaying music expressions} - @knownissues - -@cindex tweaks in a variable (変数の中での調整) -@code{\tweak} コマンドを変数の中で用いることはできません。 - -@cindex tweaks in lyrics (歌詞の中での調整) -@code{\tweak} コマンドを @code{\lyricmode} の中で用いることはできません。 - -@cindex tweaking control points (制御ポイントを調整する) -@cindex control points, tweaking (制御ポイントを調整する) - -@code{\tweak} コマンドは、和音の中で生成される複数のタイのうち、@c -最初のタイだけに適用されます。 - +@code{\tweak} コマンドで和音の中にある複数のタイのうち 1 つだけの位置を@c +変更することはできません。@c +入力ファイルの中で最初に遭遇したタイの位置を変更してしまいます。 @node set 対 override @subsection @code{\set} 対 @code{\override} @translationof set versus override -TODO -- This section is probably unnecessary now. +@c TODO -- This section is probably unnecessary now. @ignore We have seen two methods of changing properties: @code{\set} and @@ -2171,7 +2514,7 @@ property (modified with @code{\set}) was created. % 譜間スペースを減らします \new PianoStaff \with { % this is the nested declaration - \override StaffGrouper #'staff-staff-spacing #'basic-distance = #7 + \override StaffGrouper.staff-staff-spacing.basic-distance = #7 } << \new Staff { \clef treble c''1 } \new Staff { \clef bass c1 } @@ -2188,7 +2531,7 @@ property (modified with @code{\set}) was created. @lilypond[quote,verbatim] \new PianoStaff \with { - \override StaffGrouper #'staff-staff-spacing = + \override StaffGrouper.staff-staff-spacing = #'((basic-distance . 0) (minimum-distance . 0) (padding . 0) @@ -2208,10 +2551,10 @@ property (modified with @code{\set}) was created. このため、以下の 2 つの宣言は等価です: @example -\override StaffGrouper #'staff-staff-spacing = +\override StaffGrouper.staff-staff-spacing = #'((basic-distance . 7)) -\override StaffGrouper #'staff-staff-spacing = +\override StaffGrouper.staff-staff-spacing = #'((basic-distance . 7) (minimum-distance . 0) (padding . 0) @@ -2245,7 +2588,6 @@ property (modified with @code{\set}) was created. @menu * 入力モード:: * 向きと配置:: -* コンテキスト レイアウトの順序:: * 距離と距離の単位:: * 譜記号プロパティ:: * スパナ:: @@ -2262,14 +2604,14 @@ property (modified with @code{\set}) was created. 入力ファイルの中に保持されている記譜を解釈する方法は、@c カレントの入力モードによって決定されます。 -@strong{コード モード} +@strong{和音モード} このモードは @code{\chordmode} コマンドで有効になり、@c 入力はコード記譜法の構文で解釈されるようになります。@c @ref{Chord notation} を参照してください。@c コードは、譜面上に音符として描画されます。 -コード モードは @code{\chords} コマンドでも有効になります。@c +和音モードは @code{\chords} コマンドでも有効になります。@c このコマンドは新たに @code{ChordNames} コンテキストも作成します。@c 入力はコード記譜法の構文で解釈され、@c さらに @code{ChordNames} コンテキストの中にコード ネームとして描画されます。@c @@ -2375,7 +2717,14 @@ property (modified with @code{\set}) was created. これらの選択のほとんどは LilyPond によって自動的に決定されますが、@c 強制的に向きや配置を指定することが望ましい場合もあります。 -@strong{アーティキュレーションの方向指示子} +@menu +* アーティキュレーションの方向指示子:: +* 方向プロパティ:: +@end menu + +@node アーティキュレーションの方向指示子 +@unnumberedsubsubsec アーティキュレーションの方向指示子 +@translationof Articulation direction indicators デフォルトでは、アーティキュレーションのいくつかの向きは常に上または下に@c なっています (例えば、強弱記号やフェルマータ)。@c @@ -2410,7 +2759,9 @@ c2( c) c2^( c) @end lilypond -@strong{方向プロパティ} +@node 方向プロパティ +@unnumberedsubsubsec 方向プロパティ +@translationof The direction property 多くのレイアウト オブジェクトの位置や向きは、@c @code{direction} プロパティによって制御されます。 @@ -2433,7 +2784,7 @@ c2^( c) @noindent ここで、@code{xxxNeutral} は @qq{デフォルトの向きを使用する} ことを意味します。@c -@rlearning{譜表内部オブジェクト} を参照してください。 +@rlearning{譜内部オブジェクト} を参照してください。 いくつかのケースでは -- 一般的な例としてはアルペジオしかありません -- @@ -2464,33 +2815,16 @@ c2( c) c2( c) @end lilypond - -@node コンテキスト レイアウトの順序 -@subsection コンテキスト レイアウトの順序 -@translationof Context layout order - -@cindex contexts, layout order (コンテキスト レイアウトの順序) - -通常、コンテキストは、入力ファイルの中で出現した順番に、@c -システムの上から下へと配置されます。@c -コンテキストがネストされている場合、@c -入力ファイルの中で内側にネストされたコンテキストが@c -外側のコンテキストの @q{accepts} リストの中に含まれているのなら、@c -外側のコンテキストの内部に配置されます。@c -外側のコンテキストの @qq{accepts} リストに含まれていない場合、@c -外側のコンテキストの内部ではなく、下に再配置されます。 - -入力ファイルの中で、@c -出現したコマンドを保持する適当なコンテキストが存在しない場合、@c -コンテキストが暗黙的に作成されます。@c -これは、予期しない譜やスコアを生み出す可能性があります。 - -コンテキストが配置される順序や @qq{accepts} リストは変更することができます。@c -@ref{コンテキストを揃える} を参照してください。 +多声の音楽では、一般的にオブジェクトの向きを変えるよりも明示的に +@code{voice} を指定した方が良いです。@c +更なる情報は、@ref{Multiple voices} を参照してください。 @seealso -アプリケーション使用方法: -@rprogram{余計な譜が表示される} +学習マニュアル: +@rlearning{Within-staff objects} + +記譜法リファレンス: +@ref{Multiple voices} @node 距離と距離の単位 @@ -2515,7 +2849,7 @@ LilyPond における距離には 2 つのタイプがあります: 絶対距離 値の後ろに @code{\staff-space} を付けることにより、 比率で指定することもできます (次の段落を参照してください)。@c ページ レイアウトについての詳細は、@c -@ref{ページ レイアウト} に記述されています。 +@ref{Page layout} に記述されています。 相対距離は常に譜スペースを単位として指定されます -- 稀に、半譜スペースが使用されます。@c @@ -2546,13 +2880,12 @@ Scheme 関数 @code{magstep} を使用することができます。@c この関数の説明と使用例については、@c @rlearning{オブジェクトの長さと太さ} を参照してください。 - @seealso 学習マニュアル: @rlearning{オブジェクトの長さと太さ} 記譜法リファレンス: -@ref{ページ レイアウト}, +@ref{Page layout}, @ref{譜サイズを設定する} @@ -2579,7 +2912,7 @@ Scheme 関数 @code{magstep} を使用することができます。@c @lilypond[verbatim,quote,relative=1] \new Staff \with { - \override StaffSymbol #'line-positions = #'(7 3 0 -4 -6 -7) + \override StaffSymbol.line-positions = #'(7 3 0 -4 -6 -7) } { a4 e' f b | d1 } @end lilypond @@ -2590,7 +2923,7 @@ Scheme 関数 @code{magstep} を使用することができます。@c @lilypond[verbatim,quote,relative=1] \new Staff \with { - \override StaffSymbol #'width = #23 + \override StaffSymbol.width = #23 } { a4 e' f b | d1 } @end lilypond @@ -2613,13 +2946,19 @@ Scheme 関数 @code{magstep} を使用することができます。@c いくつかのスパナ -- 2 つのオブジェクトの間に直線を描くもの -- は、さらに、@c @code{line-spanner-interface} をサポートします。 +@menu +* spanner-interface を使用する:: +* line-spanner-interface を使用する:: +@end menu +@node spanner-interface を使用する @unnumberedsubsubsec @code{spanner-interface} を使用する +@translationof Using the spanner-interface このインターフェイスは、@c いくつかのスパナに適用される 2 つのプロパティを提供します。 -@strong{@i{@code{minimum-length} プロパティ}} +@subsubsubheading The @code{minimum-length} プロパティ スパナの最短の長さは、@code{minimum-length} プロパティによって指定されます。@c 通常、このプロパティを増加させると、@c @@ -2654,7 +2993,7 @@ Works not at all for: a~a a % タイの長さを増加させます --\tweak #'minimum-length #5 +-\tweak minimum-length #5 ~a @end lilypond @@ -2664,7 +3003,7 @@ a1 \compressFullBarRests R1*23 % 休符バーの長さを増加させます -\once \override MultiMeasureRest #'minimum-length = #20 +\once \override MultiMeasureRest.minimum-length = #20 R1*23 a1 @end lilypond @@ -2673,7 +3012,7 @@ a1 @lilypond[verbatim,quote,relative=2] a \< a a a \! % ヘアピンの長さを増加させます -\override Hairpin #'minimum-length = #20 +\override Hairpin.minimum-length = #20 a \< a a a \! @end lilypond @@ -2683,12 +3022,12 @@ a \< a a a \! @lilypond[verbatim,quote,relative=2] a( a) a --\tweak #'minimum-length #5 +-\tweak minimum-length #5 ( a) a\( a\) a --\tweak #'minimum-length #5 +-\tweak minimum-length #5 \( a\) @end lilypond @@ -2708,12 +3047,12 @@ a e \glissando c' % 単独では効果を持ちません -\once \override Glissando #'minimum-length = #20 +\once \override Glissando.minimum-length = #20 e, \glissando c' % 以下の両方のオーバライドが存在する場合にのみ、効果を持ちます -\once \override Glissando #'minimum-length = #20 -\once \override Glissando #'springs-and-rods = #ly:spanner::set-spacing-rods +\once \override Glissando.minimum-length = #20 +\once \override Glissando.springs-and-rods = #ly:spanner::set-spacing-rods e, \glissando c' @end lilypond @@ -2722,17 +3061,16 @@ e, \glissando c' @c KEEP LY @lilypond[verbatim,quote,relative=1] % 単独では効果を持ちません -\once \override Beam #'minimum-length = #20 +\once \override Beam.minimum-length = #20 e8 e e e % 以下の両方のオーバライドが存在する場合にのみ、効果を持ちます -\once \override Beam #'minimum-length = #20 -\once \override Beam #'springs-and-rods = #ly:spanner::set-spacing-rods +\once \override Beam.minimum-length = #20 +\once \override Beam.springs-and-rods = #ly:spanner::set-spacing-rods e8 e e e @end lilypond - -@strong{@i{@code{to-barline} プロパティ}} +@subsubsubheading The @code{to-barline} プロパティ @code{spanner-interface} の 2 番目に有用なプロパティは @code{to-barline} です。@c @@ -2743,7 +3081,7 @@ e8 e e e @lilypond[verbatim,quote,relative=2] a \< a a a a \! a a a \break -\override Hairpin #'to-barline = ##f +\override Hairpin.to-barline = ##f a \< a a a a \! a a a @end lilypond @@ -2752,8 +3090,9 @@ a \< a a a a \! a a a あるいは小節線で終了させることに意味が無い他のスパナに対して、@c このプロパティを @code{#t} に設定しても効果がありません。 - +@node line-spanner-interface を使用する @unnumberedsubsubsec @code{line-spanner-interface} を使用する +@translationof Using the line-spanner-interface @code{line-spanner-interface} をサポートするオブジェクトには@c 以下のものがあります: @@ -2778,8 +3117,8 @@ a \< a a a a \! a a a @lilypond[relative=2,quote,verbatim] e2 \glissando b -\once \override Glissando #'(bound-details left Y) = #3 -\once \override Glissando #'(bound-details right Y) = #-2 +\once \override Glissando.bound-details.left.Y = #3 +\once \override Glissando.bound-details.right.Y = #-2 e2 \glissando b @end lilypond @@ -2796,8 +3135,8 @@ e2 \glissando b 例を示します: @lilypond[relative=2,ragged-right,verbatim,fragment] -\override Glissando #'breakable = ##t -\override Glissando #'(bound-details right-broken Y) = #-3 +\override Glissando.breakable = ##t +\override Glissando.bound-details.right-broken.Y = #-3 c1 \glissando \break f1 @end lilypond @@ -2837,7 +3176,7 @@ f1 水平スパナに @i{cresc.}, @i{tr} それに他のテキストを配置するために使用されます。 @lilypond[quote,ragged-right,fragment,relative=2,verbatim] -\override TextSpanner #'(bound-details left text) +\override TextSpanner.bound-details.left.text = \markup { \small \bold Slower } c2\startTextSpan b c a\stopTextSpan @end lilypond @@ -2852,15 +3191,11 @@ c2\startTextSpan b c a\stopTextSpan 記号が上下します: @lilypond[relative=1,fragment,verbatim] -\override TextSpanner - #'(bound-details left stencil-align-dir-y) = #-2 -\override TextSpanner - #'(bound-details right stencil-align-dir-y) = #UP - -\override TextSpanner - #'(bound-details left text) = #"ggg" -\override TextSpanner - #'(bound-details right text) = #"hhh" +\override TextSpanner.bound-details.left.stencil-align-dir-y = #-2 +\override TextSpanner.bound-details.right.stencil-align-dir-y = #UP + +\override TextSpanner.bound-details.left.text = #"ggg" +\override TextSpanner.bound-details.right.text = #"hhh" c4^\startTextSpan c c c \stopTextSpan @end lilypond @@ -2897,7 +3232,6 @@ c2 \< c2 c2 @code{\startTextSpan} を @code{\endTextSpan} で閉じる必要はなく、@c ヘアピンを @code{\!} で閉じる必要もありません。 - @seealso 内部リファレンス: @rinternals{TextSpanner}, @@ -2952,9 +3286,9 @@ c2 \< c2 c2 @lilypond[quote,verbatim,relative=1] a1 a -\override Score.BarLine #'stencil = ##f +\omit Score.BarLine a a -\revert Score.BarLine #'stencil +\undo \omit Score.BarLine a a a @end lilypond @@ -2971,7 +3305,7 @@ a a a @lilypond[quote,verbatim,relative=2] a4 a -\once \override NoteHead #'transparent = ##t +\once \hide NoteHead a a @end lilypond @@ -2997,7 +3331,7 @@ a a 白いオブジェクトの画像が幽霊のように浮かび上がることがあります: @lilypond[quote,verbatim,relative=2] -\override Staff.Clef #'color = #white +\override Staff.Clef.color = #white a1 @end lilypond @@ -3026,8 +3360,8 @@ a1 音部記号を先に描画させる必要があります: @lilypond[quote,verbatim,relative=2] -\override Staff.Clef #'color = #white -\override Staff.Clef #'layer = #-1 +\override Staff.Clef.color = #white +\override Staff.Clef.layer = #-1 a1 @end lilypond @@ -3072,8 +3406,8 @@ a1 このファイルの中で、最後の 3 列がその列のヘッダで示される場所での@c 可視性を表しています: -@multitable {@code{begin-of-line-invisible}} {@code{'#(#t #t #t)}} {yes} {yes} {yes} -@headitem 関数 @tab ベクトル @tab 改行前 @tab 改行なし @tab 改行後 +@multitable {@code{begin-of-line-invisible}} {@code{'#(#t #t #t)}} {改行前} {改行なし} {改行後} +@headitem 関数形式 @tab ベクトル形式 @tab 改行前 @tab 改行なし @tab 改行後 @item @code{all-visible} @tab @code{'#(#t #t #t)} @tab yes @tab yes @tab yes @item @code{begin-of-line-visible} @tab @code{'#(#f #f #t)} @tab no @tab no @tab yes @@ -3104,12 +3438,11 @@ a1 @item @code{Clef} @tab @code{Staff} @tab @code{begin-of-line-visible} @item @code{Custos} @tab @code{Staff} @tab @code{end-of-line-visible} @item @code{DoublePercentRepeat} @tab @code{Voice} @tab @code{begin-of-line-invisible} -@c omit KeyCancellation until it can be explained -td -@c @item @code{KeyCancellation} @tab ?? @tab @code{begin-of-line-invisible} +@item @code{KeyCancellation} @tab @code{Staff} @tab @code{begin-of-line-invisible} @item @code{KeySignature} @tab @code{Staff} @tab @code{begin-of-line-visible} @c omit LeftEdge until it can be explained -td @c @item @code{LeftEdge} @tab @code{Score} @tab @code{center-invisible} -@item @code{OctavateEight} @tab @code{Staff} @tab @code{begin-of-line-visible} +@item @code{ClefModifier} @tab @code{Staff} @tab @code{begin-of-line-visible} @item @code{RehearsalMark} @tab @code{Score} @tab @code{end-of-line-invisible} @item @code{TimeSignature} @tab @code{Staff} @tab @code{all-visible} @@ -3122,7 +3455,7 @@ a1 f4 g a b f4 g a b % カレント行の最後で小節線を削除します -\once \override Score.BarLine #'break-visibility = #'#(#f #t #t) +\once \override Score.BarLine.break-visibility = #'#(#f #t #t) \break f4 g a b f4 g a b @@ -3132,8 +3465,7 @@ f4 g a b ベクトルの要素 3 つをすべて記述する必要がありますが、@c それらすべてが各レイアウト オブジェクトに対して効果を持つわけではなく、@c 組み合わせによってはエラーになる場合もあります。@c - -even give errors. The following limitations apply: +以下の制限があります: @itemize @bullet @item 小節線を行の先頭に描画することはできません。 @@ -3145,14 +3477,14 @@ even give errors. The following limitations apply: 描画するには @code{begin-of-line-invisible} を用い、@c 描画しないのなら @code{all-invisible} を用います。 @item Key signature -- 以下を参照してください -@item OctavateEight -- 以下を参照してください +@item ClefModifier -- 以下を参照してください @end itemize @node 特別な考慮を必要とするもの @unnumberedsubsubsec 特別な考慮を必要とするもの @translationof Special considerations -@strong{@emph{明示的な変更の後の可視性}} +@subsubsubheading 明示的な変更の後の可視性 @cindex key signature, visibility following explicit change (明示的な変更の後の調号の可視性) @cindex explicitKeySignatureVisibility @@ -3162,7 +3494,7 @@ even give errors. The following limitations apply: @code{break-visibility} プロパティが調号の可視性と音部記号の変更を@c 制御するのは、行の先頭 -- つまり、改行の後 -- においてだけです。@c 行の途中や終わりでの明示的な調の変更や音部記号の変更の後に出現する@c -調合や音部記号の可視性には効果を持ちません。@c +調号や音部記号の可視性には効果を持ちません。@c 以下の例では、@code{all-invisible} がセットされていますが、@c B フラット メジャーへの明示的な変更の後に出現する調号は可視のままです。 @@ -3171,7 +3503,7 @@ B フラット メジャーへの明示的な変更の後に出現する調号 \key g \major f4 g a b % すべての調号を削除しようと試みます -\override Staff.KeySignature #'break-visibility = #all-invisible +\override Staff.KeySignature.break-visibility = #all-invisible \key bes \major f4 g a b \break @@ -3199,16 +3531,16 @@ f4 g a b \key g \major f4 g a b \set Staff.explicitKeySignatureVisibility = #all-invisible -\override Staff.KeySignature #'break-visibility = #all-invisible +\override Staff.KeySignature.break-visibility = #all-invisible \key bes \major f4 g a b \break f4 g a b f4 g a b @end lilypond -@strong{@emph{忠告の臨時記号の可視性}} +@subsubsubheading 前の調をキャンセルする臨時記号の可視性 -明示的な調の変更で描画される忠告の臨時記号を削除するには、@c +明示的な調の変更で描画される前の調をキャンセルする臨時記号を削除するには、@c @code{Staff} コンテキスト プロパティ @code{printKeyCancellation} に @code{#f} をセットします: @@ -3217,7 +3549,7 @@ f4 g a b f4 g a b \set Staff.explicitKeySignatureVisibility = #all-invisible \set Staff.printKeyCancellation = ##f -\override Staff.KeySignature #'break-visibility = #all-invisible +\override Staff.KeySignature.break-visibility = #all-invisible \key bes \major f4 g a b \break f4 g a b @@ -3226,9 +3558,41 @@ f4 g a b このオーバライドによって、調の変更を示す臨時記号だけが残ります。 +調を C@tie{}メジャーや A@tie{}マイナーに変更する時、前の調をキャンセル@c +する臨時記号は前の調のキャンセルしている @emph{だけ} であることに@c +注意してください。@c +そのようなケースでは、@code{printKeyCancellation} を @code{#f} に@c +設定しても効果はありません: + +@lilypond[quote,verbatim,relative=1,ragged-right] +\key g \major +f4 g a b +\set Staff.explicitKeySignatureVisibility = #all-invisible +\set Staff.printKeyCancellation = ##f +\key c \major +f4 g a b \break +f4 g a b +f4 g a b +@end lilypond + +調を C@tie{}メジャーや A@tie{}マイナーに変更する場合に、@c +前の調をキャンセルする臨時記号を消すには、@code{KeyCancellation} +グラフィカル オブジェクトの可視性をオーバライドします: + +@lilypond[quote,verbatim,relative=1,ragged-right] +\key g \major +f4 g a b +\set Staff.explicitKeySignatureVisibility = #all-invisible +\override Staff.KeyCancellation.break-visibility = #all-invisible +\key c \major +f4 g a b \break +f4 g a b +f4 g a b +@end lilypond + @c TODO Add visibility of cautionary accidentals before notes -@strong{@emph{自動小節線}} +@subsubsubheading 自動小節線 @cindex automaticBars @cindex bar lines, suppressing (小節線を消す) @@ -3246,25 +3610,24 @@ f4 g a b @c TODO Add example -@strong{@emph{オクターブ移調付きの音部記号}} +@subsubsubheading オクターブ移調付きの音部記号 -@cindex octavated clefs, visibility of (オクターブ移調付きの音部記号の可視性) -@cindex visibility of octavated clefs (オクターブ移調付きの音部記号の可視性) -@cindex clefs, visibility of octavation (オクターブ移調付きの音部記号の可視性) +@cindex transposed clefs, visibility of (オクターブ移調付きの音部記号の可視性) +@cindex visibility of transposed clefs (オクターブ移調付きの音部記号の可視性) +@cindex clefs, visibility of transposition (オクターブ移調付きの音部記号の可視性) オクターブ移調付きの音部記号上の小さなオクターブ記号は -@code{OctavateEight} レイアウト オブジェクトによって作り出されます。@c +@code{ClefModifier} レイアウト オブジェクトによって作り出されます。@c このオブジェクトの可視性は @code{Clef} オブジェクトの可視性とは独立して制御されます。@c そのため、各行の先頭においてそのような音部記号を完全に消そうとするなら、@c -@code{Clef} オブジェクトと @code{OctavateEight} オブジェクトの両方に対して@c +@code{Clef} オブジェクトと @code{ClefModifier} オブジェクトの両方に対して@c 必要な @code{break-visibility} のオーバライドを行う必要があります。 明示的な音部記号の変更では、@c @code{explicitClefVisibility} プロパティが@c 音部記号とそれに関連するオクターブ記号の両方を制御します。 - @seealso 学習マニュアル: @rlearning{オブジェクトの可視性と色} @@ -3290,13 +3653,13 @@ f4 g a b @lilypond[relative=2,ragged-right,verbatim,fragment] d2 \glissando d'2 -\once \override Glissando #'style = #'dashed-line +\once \override Glissando.style = #'dashed-line d,2 \glissando d'2 -\override Glissando #'style = #'dotted-line +\override Glissando.style = #'dotted-line d,2 \glissando d'2 -\override Glissando #'style = #'zigzag +\override Glissando.style = #'zigzag d,2 \glissando d'2 -\override Glissando #'style = #'trill +\override Glissando.style = #'trill d,2 \glissando d'2 @end lilypond @@ -3307,7 +3670,7 @@ d,2 \glissando d'2 @c TODO Complete @lilypond[relative=2,ragged-right,verbatim,quote] e2 \glissando f -\once \override Glissando #'(bound-details right Y) = #-2 +\once \override Glissando.bound-details.right.Y = #-2 e2 \glissando f @end lilypond @@ -3360,7 +3723,7 @@ e2 \glissando f @lilypond[quote,verbatim,relative=1] g4\< e' d' f\! -\override Hairpin #'rotation = #'(20 -1 0) +\override Hairpin.rotation = #'(20 -1 0) g,,4\< e' d' f\! @end lilypond @@ -3380,7 +3743,7 @@ g,,4\< e' d' f\! そうしなければテキストのいくつかは高く押し上げられてしまいます。 @lilypond[quote,verbatim,relative=1] -\override TextScript #'outside-staff-priority = ##f +\override TextScript.outside-staff-priority = ##f g4^\markup { \rotate #30 "a G" } b^\markup { \rotate #30 "a B" } des^\markup { \rotate #30 "a D-Flat" } @@ -3400,9 +3763,9 @@ fis^\markup { \rotate #30 "an F-Sharp" } * グラフィカル オブジェクトを垂直方向にグループ化する:: * ステンシルを変更する:: * 形状を変更する:: +* unpure-pure コンテナ:: @end menu - @seealso 学習マニュアル: @rlearning{出力を調整する}, @@ -3412,15 +3775,15 @@ fis^\markup { \rotate #30 "an F-Sharp" } @ref{内部リファレンスの説明}, @ref{プロパティを変更する} -インストール済みファイル: +拡張: +@rextend{Interfaces for programmers} + +インストールされているファイル: @file{scm/define-grobs.scm} コード断片集: @rlsr{Tweaks and overrides} -拡張: -@rextend{Interfaces for programmers} - 内部リファレンス: @rinternals{All layout objects} @@ -3469,7 +3832,10 @@ fis^\markup { \rotate #30 "an F-Sharp" } @code{break-aligned-interface} の中に特別なプロパティがあります。 @seealso +記譜法リファレンス: @ref{break-alignable-interface を使用する}, + +拡張: @rextend{Callback functions} @menu @@ -3491,12 +3857,12 @@ fis^\markup { \rotate #30 "an F-Sharp" } @lilypond[verbatim,quote,relative=2] a-3 a --\tweak #'X-offset #0 --\tweak #'Y-offset #0 +-\tweak X-offset #0 +-\tweak Y-offset #0 -3 a --\tweak #'X-offset #-1 --\tweak #'Y-offset #1 +-\tweak X-offset #-1 +-\tweak Y-offset #1 -3 @end lilypond @@ -3552,7 +3918,7 @@ a @unnumberedsubsubsec @code{self-alignment-interface} を使用する @translationof Using the @code{self-alignment-interface} -@emph{オブジェクトを自動的に水平方向に揃える} +@subsubsubheading オブジェクトを自動的に水平方向に揃える @code{self-alignment-interface} をサポートするオブジェクトの水平方向の揃えは、@c @code{self-alignment-X} プロパティの値によって制御され、@c @@ -3578,17 +3944,17 @@ a @lilypond[quote,verbatim,relative=1] a' --\tweak #'self-alignment-X #-1 +-\tweak self-alignment-X #-1 ^"left-aligned" --\tweak #'self-alignment-X #0 +-\tweak self-alignment-X #0 ^"center-aligned" --\tweak #'self-alignment-X #RIGHT +-\tweak self-alignment-X #RIGHT ^"right-aligned" --\tweak #'self-alignment-X #-2.5 +-\tweak self-alignment-X #-2.5 ^"aligned further to the right" @end lilypond -@emph{オブジェクトを自動的に垂直方向に揃える} +@subsubsubheading オブジェクトを自動的に垂直方向に揃える オブジェクトの @code{Y-offset} プロパティに @code{ly:self-alignment-interface::y-aligned-on-self} がセットされていれば、@c @@ -3608,7 +3974,7 @@ a' 記号 @code{DOWN}, @code{CENTER}, それに @code{UP} は@c それぞれ @w{@code{-1}, @code{0}, それに @code{1}} に対応します。 -@emph{オブジェクトを自動的に両方向に揃える} +@subsubsubheading オブジェクトを自動的に両方向に揃える @code{X-offset} と @code{Y-offset} の両方の設定を行うことで、@c オブジェクトの水平方向と垂直方向の揃えを同時に行うことができます。 @@ -3618,9 +3984,9 @@ a' @c KEEP LY @lilypond[quote,verbatim,relative=2] a --\tweak #'self-alignment-X #0.5 % 左方向に移動させます --\tweak #'Y-offset #ly:self-alignment-interface::y-aligned-on-self --\tweak #'self-alignment-Y #-1 % 上方向に移動させます +-\tweak self-alignment-X #0.5 % 左方向に移動させます +-\tweak Y-offset #ly:self-alignment-interface::y-aligned-on-self +-\tweak self-alignment-Y #-1 % 上方向に移動させます -3 % 3 の指 @end lilypond @@ -3673,20 +4039,20 @@ example shows the difference: @c KEEP LY @lilypond[verbatim,quote,relative=1] % リハーサル記号は音部記号の上に中央揃えされます -\override Score.RehearsalMark #'break-align-symbols = #'(clef) +\override Score.RehearsalMark.break-align-symbols = #'(clef) \key a \major \clef treble \mark "↓" e1 % リハーサル記号は拍子記号の上に中央揃えされます -\override Score.RehearsalMark #'break-align-symbols = #'(time-signature) +\override Score.RehearsalMark.break-align-symbols = #'(time-signature) \key a \major \clef treble \time 3/4 \mark "↓" e2. % リハーサル記号はブレス記号の上に中央揃えされます -\override Score.RehearsalMark #'break-align-symbols = #'(breathing-sign) +\override Score.RehearsalMark.break-align-symbols = #'(breathing-sign) \key a \major \clef treble \time 4/4 @@ -3707,14 +4073,14 @@ e1 @c KEEP LY @lilypond[verbatim,quote,relative=1] % リハーサル記号は調号の上に中央揃えされます -\override Score.RehearsalMark #'break-align-symbols = #'(key-signature clef) +\override Score.RehearsalMark.break-align-symbols = #'(key-signature clef) \key a \major \clef treble \mark "↓" e1 % リハーサル記号は音部記号の上に中央揃えされます \set Staff.explicitKeySignatureVisibility = #all-invisible -\override Score.RehearsalMark #'break-align-symbols = #'(key-signature clef) +\override Score.RehearsalMark.break-align-symbols = #'(key-signature clef) \key a \minor \clef bass \mark "↓" @@ -3722,7 +4088,7 @@ gis,,1 % リハーサル記号は小節線の上に中央揃えされます \set Staff.explicitKeySignatureVisibility = #all-invisible \set Staff.explicitClefVisibility = #all-invisible -\override Score.RehearsalMark #'break-align-symbols = #'(key-signature clef) +\override Score.RehearsalMark.break-align-symbols = #'(key-signature clef) \key a \major \clef treble \mark "↓" @@ -3736,19 +4102,19 @@ e''1 @c KEEP LY @lilypond[verbatim,quote,relative=1] % RehearsalMark は KeySignature の上に中央揃えされます -\override Score.RehearsalMark #'break-align-symbols = #'(key-signature) +\override Score.RehearsalMark.break-align-symbols = #'(key-signature) \key a \major \clef treble \time 4/4 \mark "↓" e1 % RehearsalMark は KeySignature の左端に揃えられます -\once \override Score.KeySignature #'break-align-anchor-alignment = #LEFT +\once \override Score.KeySignature.break-align-anchor-alignment = #LEFT \mark "↓" \key a \major e % RehearsalMark は KeySignature の右端に揃えられます -\once \override Score.KeySignature #'break-align-anchor-alignment = #RIGHT +\once \override Score.KeySignature.break-align-anchor-alignment = #RIGHT \key a \major \mark "↓" e @@ -3762,14 +4128,14 @@ e @lilypond[verbatim,quote,relative=1] % リハーサル記号は調号の左端に揃えられて % さらに 3.5 譜スペース右にずらされます -\override Score.RehearsalMark #'break-align-symbols = #'(key-signature) -\once \override Score.KeySignature #'break-align-anchor = #3.5 +\override Score.RehearsalMark.break-align-symbols = #'(key-signature) +\once \override Score.KeySignature.break-align-anchor = #3.5 \key a \major \mark "↓" e1 % リハーサル記号は調号の左端に揃えられて % さらに 2 譜スペース左にずらされます -\once \override Score.KeySignature #'break-align-anchor = #-2 +\once \override Score.KeySignature.break-align-anchor = #-2 \key a \major \mark "↓" e1 @@ -3821,8 +4187,8 @@ Staff, Lyrics 等はそれ自体でそれぞれに VerticalAxisGroup を持ち @lilypond[verbatim,quote] XinO = { - \once \override NoteHead #'stencil = #ly:text-interface::print - \once \override NoteHead #'text = \markup { + \once \override NoteHead.stencil = #ly:text-interface::print + \once \override NoteHead.text = \markup { \combine \halign #-0.7 \draw-circle #0.85 #0.2 ##f \musicglyph #"noteheads.s2cross" @@ -3841,7 +4207,6 @@ Feta フォントに含まれる任意の図柄を提供することができま @c TODO Add inserting Postscript or ref to later - @seealso 記譜法リファレンス: @ref{マークアップ内部でのグラフィック記譜法}, @@ -3867,10 +4232,24 @@ Feta フォントに含まれる任意の図柄を提供することができま @cindex Bézier curves (ベジエ曲線) @cindex Bézier control points (ベジエ曲線の制御ポイント) -タイ、スラー、それにフレージング スラーは 3 次のベジエ曲線として描かれます。@c -自動的に算出されるタイあるいはスラーの形状が最適ではない場合、@c -3 次ベジエ曲線を定義するのに必要な 4 つの制御ポイントを@c -明示的に指定することによって、形状を変更することができます。 +@code{Tie}, @code{Slur}, @code{PhrasingSlur}, @code{LaissezVibrerTie}, +それに @code{RepeatTie} はすべて 3 次のベジエ曲線として描かれます。@c +自動的に算出されるタイやスラーの形状が最適ではない場合、以下の 2 つの@c +方法を用いて手動で形状を変更することができます:@c + +@enumerate a +@item +自動的に算出されるベジエ曲線の制御ポイントの移動させる + +@item +求める曲線を定義するのに必要な 4 つの制御ポイントの位置を明示的に指定する +@end enumerate + +2 つの方法について以下で説明します。@c +曲線の調節がわずかであれば、最初の方法が適しています。@c +2 番目の方法は単一の音符に関連付けられる曲線を作り出す場合に適しています。 + +@subsubsubheading 3 次ベジエ曲線 3 次あるいは 3 乗のベジエ曲線は、4 つの制御ポイントによって定義されます。@c 1 番目と 4 番目の制御ポイントは曲線の始点と終点になります。@c @@ -3882,10 +4261,16 @@ Web でベジエ曲線が描かれる様子を示すアニメーションを@c 徐々に 3 番目の制御ポイントの方へ向きを変えながら 4 番目の制御ポイントの方へ向かい続け、@c 3 番目の制御ポイントから 4 番目の制御ポイントに到達します。@c -ベジエ曲線は 4 つの制御ポイントからなる四角形の中に納まります。 +ベジエ曲線は 4 つの制御ポイントからなる四角形の中に納まります。@c +制御ポイントの平行移動、回転、伸縮はすべて同じ操作です。 + +@subsubsubheading 制御ポイントを移動させる + +@cindex shaping slurs and ties (スラーとタイの形状) +@funindex \shape -ここで、@c -タイが最適化されず、@code{\tieDown} が役に立たないケースを例として挙げます。 +以下の例では、タイの自動配置が最適ではなく、@code{\tieDown} も役に@c +立ちません。 @lilypond[verbatim,quote,relative=1] << @@ -3895,43 +4280,148 @@ Web でベジエ曲線が描かれる様子を示すアニメーションを@c >> @end lilypond -以下のようにタイの制御ポイントを手動で変更することにより、@c -このタイの形状を改善することができます。 - -ベジエ制御ポイントの座標は譜スペースを単位として指定されます。@c -X@tie{}座標はそのタイあるいはスラーを取り付けられる音符の参照ポイントからの@c -相対座標であり、Y@tie{}座標は譜の中央線からの相対座標です。@c -制御ポイント座標は 10 進数 (実数) のペアを 4 つ持つリストとして設定されます。@c -最適な制御ポイントを決定するための手順は、 -2 つの終点の座標を見積もり、それから 2 つの中間ポイントを推測することで、@c -制御ポイントの座標を決定します。@c -最適値はトライ&エラーで見つけ出します。 - -左右対称の曲線にするには制御ポイントを左右対称に配置する必要があるということを@c -覚えておくと役に立ちます。@c -また、ベジエ曲線の制御ポイントに平行移動、回転、それに拡大縮小などの変換を@c -適用することにより、@c -その曲線を変換できるという特性があるとも覚えておいてください。 - -上記の実例として、以下の例のオーバライドで満足のいくタイが得られています。@c -オーバライドを配置する場所 --- タイ (あるいはスラー) が開始する音符の直前に配置する必要があります -- -に注意してください。 +@code{\shape} でタイの制御ポイントを調節することで衝突を避けることが@c +できます。 + +@code{\shape} の構文は以下の通りです: + +@example +[-]@code{\shape} @var{displacements} @var{item} +@end example + +これは @var{item} の制御ポイントを @var{displacements} だけ移動させます。@c +引数 @var{displacements} は数のペアのリスト、あるいはそのようなリストの@c +リストです。@c +ペアの要素は制御ポイントの座標の移動量を表しています。@c +@var{item} が文字列の場合、指定されたグラフィカル オブジェクト タイプ@c +に @code{\once \override} で適用されます。@c +@var{item} が音楽表記の場合、その音楽表記に調節が適用されます。 + +言い換えると、@code{\shape} 関数は、引数 @var{item} が @qq{Slur} +のようなグラフィカル オブジェクト名であるか @qq{(} のような音楽表記@c +であるかによって、@code{\once \override} コマンドあるいは @code{\tweak} +コマンドのどちらにでもなり得ます。@c +引数 @var{displacements} は 4 つの (dx . dy) ペアのリストで 4 つの@c +制御ポイントの移動を指定します -- 値の単位は譜スペースです。 +(曲線が複数のセグメントを持つ場合、引数 @var{displacements} は 4 つの@c +ペアを持つリストのリストになります。) + +@code{\tweak} 形式で用いる場合にのみ、先頭にハイフン @code{-} を付ける@c +必要があrます。 + +それでは、上記の例に @code{\once \override} 形式の @code{\shape} を@c +使ってタイを 0.5 譜スペースだけ上に移動させてみましょう: @lilypond[verbatim,quote,relative=1] << { - \once \override Tie - #'control-points = #'((1 . -1) (3 . 0.6) (12.5 . 0.6) (14.5 . -1)) - e1 ~ e + \shape #'((0 . 0.5) (0 . 0.5) (0 . 0.5) (0 . 0.5)) Tie + e1~ e } \\ { r4 } >> @end lilypond -@knownissues +タイの位置は改善されましたが、中央部分をもっと持ち上げるべきです。@c +以下の例で @code{\tweak} 形式でそれを行っています: + +@lilypond[verbatim,quote,relative=1] +<< + { + e1-\shape #'((0 . 0.5) (0 . 1) (0 . 1) (0 . 0.5)) ~ e + } +\\ + { r4 } +>> +@end lilypond +同じ方法で制御ポイントを水平方向に移動させることもできて、同じ音楽@c +タイミングで発生する 2 つの曲線をうまく配置することができます: + +@lilypond[verbatim,quote,ragged-right,relative=2] +c8(\( a) a'4 e c\) +\shape #'((0.7 . -0.4) (0.5 . -0.4) (0.3 . -0.3) (0 . -0.2)) Slur +\shape #'((0 . 0) (0 . 0.5) (0 . 0.5) (0 . 0)) PhrasingSlur +c8(\( a) a'4 e c\) +@end lilypond + +@code{\shape} 関数は改行を跨ぐ曲線の制御ポイントを移動させることも@c +できます。@c +分割される曲線それぞれにリストを与えて制御ポイントを移動させます。@c +片方の曲線は変更する必要がない場合、空のリストを渡します。@c +以下の例では、1 つのスラーが改行で 2 つに分割されています: + +@lilypond[verbatim,quote,ragged-right,relative=1] +c4( f g c +\break +d,4 c' f, c) +@end lilypond + +分割されたスラーの形状を変更することで、改行を跨いで続くスラーである@c +ことがわかりやすくなります: + +@c KEEP LY +@lilypond[verbatim,quote,ragged-right,relative=1] +% 片方のスラーを変更する必要がない場合、 +% () を ((0 . 0) (0 . 0) (0 . 0) (0 . 0)) の短縮形として使うことができます +\shape #'( + (( 0 . 0) (0 . 0) (0 . 0) (0 . 1)) + ((0.5 . 1.5) (1 . 0) (0 . 0) (0 . -1.5)) + ) Slur +c4( f g c +\break +d,4 c' f, c) +@end lilypond + +S 字曲線が求められた場合は、常に制御ポイントを手動で調節する必要があります +--- LilyPond が自動的にそのような形状を選択することはありません。 + +@lilypond[verbatim,quote,relative=2] +c8( e b-> f d' a e-> g) +\shape #'((0 . -1) (5.5 . -0.5) (-5.5 . -10.5) (0 . -5.5)) PhrasingSlur +c8\( e b-> f d' a e-> g\) +@end lilypond + +@subsubsubheading 制御ポイントの位置を明示的に指定する + +ベジエ曲線の制御ポイントの座標を指定します -- 単位は譜スペースです。@c +X@tie{}座標はタイあるいはスラーを取り付ける音符の参照ポイントからの@c +相対位置で、X@tie{}座標は譜の中央線からの相対位置です。@c +制御ポイントの座標をリストで指定します -- リストは数のペアを 4 つ持ちます。@c +両端の座標を推測して、それから 2 つ中間点の座標を推測します。@c +最適値はトライ&エラーで見つけます。@c +音楽やレイアウトに変更が加えられた場合、手動で値を調節する必要がある@c +ということに注意してください。 + +制御ポイントを移動させるよりも、位置を明示的に指定する方が望ましい@c +シチュエーションの 1 つは、単一の音符に関連付けられる曲線の場合です。@c +ここで、そのような例を示します。@c +繰り返しの差し替え部分まで延びるスラーを表示する方法を示しています。 + +@c KEEP LY +@lilypond[verbatim,quote,relative=2] +c1 +\repeat volta 3 { c4 d( e f } +\alternative { + { g2) d } + { + g2 + % スラーを作成して、新しい位置に移動させます + % <> はスラーを終わらせるための空の和音です + -\tweak control-points #'((-2 . 3.8) (-1 . 3.9) (0 . 4) (1 . 3.4)) ( <> ) + f, + } + { + e'2 + % スラーを作成して、新しい位置に移動させます + -\tweak control-points #'((-2 . 3) (-1 . 3.1) (0 . 3.2) (1 . 2.4)) ( <> ) + f, + } +} +@end lilypond + +@knownissues 同じ音楽タイミングに複数のタイあるいはスラーが存在する場合、@c @code{control-points} プロパティを変更しても@c それらの形状を変更することはできません。@c @@ -3944,6 +4434,107 @@ X@tie{}座標はそのタイあるいはスラーを取り付けられる音符 @rinternals{TieColumn} +@node unpure-pure コンテナ +@subsection unpure-pure コンテナ +@translationof Unpure-pure containers + +@cindex Scheme, pure containers (Scheme pure コンテナ) +@cindex Scheme, unpure containers (Scheme unpure コンテナ) +@cindex pure containers, Scheme (Scheme pure コンテナ) +@cindex unpure containers, Scheme (Scheme unpure コンテナ) +@cindex horizontal spacing, overriding (水平方向のスペースを上書きする) + +unpure-pure コンテナは @emph{Y-axis} スペース - 特に @code{Y-offset} と +@code{Y-extent} - の算出を文字 (つまり、数字やペア) ではなく、Scheme 関数で@c +上書きする際に有用です。 + +ある特定のグラフィカル オブジェクトでは、@code{Y-extent} は @code{stencil} +プロパティをベースにしていて、それらの @code{stencil} プロパティを上書きする場合は +unpure-pure コンテナで @code{Y-extent} も上書きする必要があります。@c +関数が @code{Y-offset} と/または @code{Y-extent} を上書きした場合、@c +その関数はコンパイルの最中に改行の算出を早すぎるタイミングで引き起こすと見なされます。@c +そのため、その関数はまったく評価されず (通常、@samp{0} または @samp{'(0 . 0)} の@c +値を返します)、結果として衝突を引き起こすことがあります。@c +@q{pure} 関数はプロパティ、オブジェクト、あるいはグラフィカル オブジェクトの消失に@c +影響を与えないため、その関数の Y-axis に関する評価は常に正しく行われます。 + +現在のところ @q{pure} と見なされる関数が約 30 あり、Unpure-pure コンテナを用いて +@q{pure} ではない関数を @q{pure} な関数としてセットすることができます。@c +@q{pure} 関数は改行の @emph{前に} 評価されるため、水平方向のスペースを +@q{正しいタイミングで} 調節することができます。@c +@q{unpure} 関数は改行の @emph{後に} 評価されます。 + +@warning{@q{pure} な関数を常に把握していることは困難なので、作成する @q{pure} +関数ではグラフィカル オブジェクト @code{Beam} や @code{VerticalAlignment} を@c +使わないことをおすすめします。} + +unpure-pure コンテナは以下のように構築します: + +@code{(ly:make-unpure-pure-container f0 f1)} + +ここで @code{f0} は @var{n} (@var{n >= 1}) 個の引数を取る関数であり、最初の引数@c +は常にグラフィカル オブジェクトである必要があります。@c +これが実際に結果を返す関数です。@c +@code{f1} は @q{pure} であると見なされる関数であり、@var{n + 2} 個の引数を@c +取ります。@c +@code{f1} も最初の引数は常にグラフィカル オブジェクトである必要があり、2 番目と +3 番目の引数は @q{start} と @q{end} です。 + +@q{start} と @q{end} は事実上、@code{Spanners} (つまり、@code{Hairpin} や +@code{Beam}) だけで問題となるダミー値であり、 +@var{start} and @var{end} are, for all intents and purposes, dummy +values that only matter for @code{Spanners} (i.e @code{Hairpin} or +@code{Beam}), that can return different height estimations based on a +starting and ending column. + +@code{f1} の残りの引数は @code{f0} の引数と同じです (@var{n = 1} である場合は@c +残りの引数はありません)。 + +関数 @code{f1} の結果は概算であり、@code{f0} が実際の値を得るのに用いられます。@c +@code{f0} の結果はもっと後のスペースの処理で微調整に用いられます。 + +@lilypond[verbatim,quote,ragged-right] +#(define (square-line-circle-space grob) +(let* ((pitch (ly:event-property (ly:grob-property grob 'cause) 'pitch)) + (notename (ly:pitch-notename pitch))) + (if (= 0 (modulo notename 2)) + (make-circle-stencil 0.5 0.0 #t) + (make-filled-box-stencil '(0 . 1.0) + '(-0.5 . 0.5))))) + +squareLineCircleSpace = { + \override NoteHead.stencil = #square-line-circle-space +} + +smartSquareLineCircleSpace = { + \squareLineCircleSpace + \override NoteHead.Y-extent = + #(ly:make-unpure-pure-container + ly:grob::stencil-height + (lambda (grob start end) (ly:grob::stencil-height grob))) +} + +\new Voice \with { \remove "Stem_engraver" } +\relative c'' { + \squareLineCircleSpace + cis4 ces disis d + \smartSquareLineCircleSpace + cis4 ces disis d +} +@end lilypond + +最初の小節では unpure-pure コンテナを用いていないため、スペース算出エンジンは符頭の@c +幅を知ることができず、符頭と臨時記号が衝突しています。@c +次の小節では unpure-pure コンテナを用いているため、スペース算出エンジンは符頭の幅を@c +知ることができ、それに応じて小節の幅を増やすことで衝突を回避しています。 + +通常、簡単な計算では、unpure-pure コンテナの @q{unpure} パートと @q{pure} パート@c +の両方に、引数の数とスコープを変えただけのほとんど同じ関数を用いることができます。 + +@warning{@q{pure} と見なした関数が @q{pure} でなかった場合、予期しない結果となる@c +ことがあります。} + + @node 音楽関数を使用する @section 音楽関数を使用する @translationof Using music functions @@ -3989,20 +4580,16 @@ function = @tab @code{@var{argN}} が @code{#t} を返す Scheme の @emph{型述語} (type predicate)。 @item @code{@var{@dots{}music@dots{}}} -@tab 通常の LilyPond 入力。@code{$} を用いて引数を参照します -(例: @samp{$arg1})。 +@tab 通常の LilyPond 入力。引数を参照するには @code{$} (LilyPond 構造が@c +許可されている場合のみ) や @code{#} (引数を Scheme 値、音楽関数の引数、@c +あるいは音楽リスト内部の音楽として使う場合) を用います +(例: @samp{#arg1})。 @end multitable です。 -@ignore -共通の変数タイプについては @ref{共通の引数タイプ} で記述されています。@c -変数タイプについてのもっと完全な記述は -@rextend{Music function syntax} にあります。 -@end ignore - 引数 @code{parser} と @code{location} を省略することはできず、@c -@rextend{Music function syntax} で記述されている高度な状況で@c +@rextend{Music functions} で記述されている高度な状況で@c 使用されることがあります。 置換関数において、必ずこれらの引数を記述してください。 @@ -4025,14 +4612,12 @@ symbol? @ref{Predefined type predicates} を参照してください。@c ユーザが型述語を定義することもできます。 - @seealso - 記譜法リファレンス: @ref{Predefined type predicates} 拡張: -@rextend{Music function syntax} +@rextend{Music functions} インストールされているファイル: @file{lily/music-scheme.cc}, @@ -4040,42 +4625,6 @@ symbol? @file{scm/lily.scm} -@ignore -@node 共通の引数タイプ -@subsection 共通の引数タイプ -@translationof Common argument types - -エラー チェックを考慮して、@c -音楽関数に渡される各引数タイプを定義しておく必要があります。@c -共通の引数タイプのいくつかを以下の表で示します。@c - -以下の入力タイプを音楽関数で変数として使用することができます。@c -このリストは完全なものではありません。@c -取り得る変数タイプについての更なる情報は、 -@rextend{Music function syntax} にあります。 - -@multitable @columnfractions .33 .66 -@headitem 入力タイプ @tab @var{vari-type?} での記述方法 -@item 整数 @tab @code{integer?} -@item 浮動小数点数 (10 進数) @tab @code{number?} -@item テキスト文字列 @tab @code{string?} -@item マークアップ @tab @code{markup?} -@item 音楽表記 @tab @code{ly:music?} -@item Scheme ペア @tab @code{pair?} -@end multitable - -@seealso - -LilyPond の拡張: -@rextend {Music function syntax} - -インストール済みファイル: -@file{lily/music-scheme.cc}, -@file{scm/c++.scm} -@end ignore - - -@c ここから L3796 @node 置換関数の例 @subsection 置換関数の例 @translationof Substitution function examples @@ -4092,7 +4641,7 @@ padText = (parser location padding) (number?) #{ - \once \override TextScript #'padding = $padding + \once \override TextScript.padding = $padding #}) \relative c''' { @@ -4106,20 +4655,17 @@ padText = 数値のほかに、音符などの音楽表記を音楽関数への引数にすることができます: -@c TODO: use a better example (the music argument is redundant). - @lilypond[quote,verbatim,ragged-right] custosNote = #(define-music-function (parser location note) (ly:music?) #{ - \once \override Voice.NoteHead #'stencil = - #ly:text-interface::print - \once \override Voice.NoteHead #'text = - \markup \musicglyph #"custodes.mensural.u0" - \once \override Voice.Stem #'stencil = ##f - $note + \tweak NoteHead.stencil #ly:text-interface::print + \tweak NoteHead.text + \markup \musicglyph #"custodes.mensural.u0" + \tweak Stem.stencil ##f + #note #}) \relative c' { c4 d e f \custosNote g } @@ -4131,16 +4677,16 @@ custosNote = tempoPadded = #(define-music-function (parser location padding tempotext) - (number? string?) + (number? markup?) #{ - \once \override Score.MetronomeMark #'padding = $padding - \tempo \markup { \bold $tempotext } + \once \override Score.MetronomeMark.padding = $padding + \tempo \markup { \bold #tempotext } #}) \relative c'' { \tempo \markup { "Low tempo" } c4 d e f g1 - \tempoPadded #4.0 #"High tempo" + \tempoPadded #4.0 "High tempo" g4 f e d c1 } @end lilypond