5.3.3 \override コマンド

特殊なタイプのコンテキスト プロパティがあります: グラフィカル オブジェクト記述です。グラフィカル オブジェクト記述には StudlyCaps という名前 (大文字で始まります) が付けられています。これらは、関連リストとして、ある特定の種類のグラフィカル オブジェクト用の ‘デフォルト設定’ を保持します。各グラフィカル オブジェクト記述の設定を調べるには、‘scm/define-grobs.scm’ を参照してください。各グラフィカル オブジェクト記述は \override を用いて変更します。

\override コマンドの構文は以下の通りです:

\override [context.]GrobName.property = #value

例えば、Stem オブジェクトの thickness プロパティをオーバライドすることによって、符幹の太さを太くすることができます:

c''4 c''
\override Voice.Stem.thickness = #3.0
c''4 c''

[image of music]

\override でコンテキストが指定されていない場合、その下にあるコンテキストに適用されます:

\override Staff.Stem.thickness = #3.0
<<
  \relative {
    e''4 e
    \override Stem.thickness = #0.5
    e4 e
  } \\
  \relative {
    c''4 c c c
  }
>>

[image of music]

調整可能なオプションには ‘サブプロパティ’ があり、これはプロパティの内部に存在します。これを調整するには、以下のような形式のコマンドを用います:

\override Stem.details.beamed-lengths = #'(4 4 3)

また、スパナの端を変更するには、以下のようにします:

\override TextSpanner.bound-details.left.text = "left text"
\override TextSpanner.bound-details.right.text = "right text"

\override の効果は、\revert によって元に戻すことができます。

\revert の構文は以下の通りです:

\revert [context.]GrobName.property

例を示します:

\relative {
  c''4
  \override Voice.Stem.thickness = #3.0
  c4 c
  \revert Voice.Stem.thickness
  c4
}

[image of music]

\override\revert の効果は、その時点から影響を受けるコンテキストの中にあるすべてのグラフィカル オブジェクトに適用されます:

<<
  \relative {
    e''4
    \override Staff.Stem.thickness = #3.0
    e4 e e
  } \\
  \relative {
    c''4 c c
    \revert Staff.Stem.thickness
    c4
  }
>>

[image of music]

\once\override\revert と共に用いることで、カレントの時間ステップだけに効果を与えることができます:

<<
  \relative c {
    \override Stem.thickness = #3.0
    e''4 e e e
  } \\
  \relative {
    c''4
    \once \override Stem.thickness = #3.0
    c4 c c
  }
>>

[image of music]

参照

内部リファレンス: Backend


LilyPond — 記譜法リファレンス v2.23.82 (開発版).