Editorial annotations

Editorial annotations


楽譜に運指記号を追加する

単純な構文で運指記号を追加することができます。

\relative c'' {
 c4-1 d-2 f-4 e-3
}

[image of music]


オブジェクトにリンクを追加する

grob-stencil にリンクを追加する場合、ここに定義されている add-link を使用することができます。\override\tweak と動作します。ただし、リンクが設定された Grob は point-and-click が無効になります。

制限: PDF でのみ動作します。

リンクされたオブジェクトに色が付いているのは、別のコマンドによるものです。

#(define (add-link url-strg)
 (lambda (grob)
 (let* ((stil (ly:grob-property grob 'stencil)))
 (if (ly:stencil? stil)
 (begin
 (let* (
 (x-ext (ly:stencil-extent stil X))
 (y-ext (ly:stencil-extent stil Y))
 (url-expr `(url-link url-strg ,x-ext ,y-ext))
 (new-stil (ly:stencil-add
 (ly:make-stencil url-expr x-ext y-ext) stil)))
 (ly:grob-set-property! grob 'stencil new-stil)))
 #f))))
%%%% test
urlI =
"https://lilypond.org/doc/v2.14/Documentation/notation/writing-pitches"
urlII =
"https://lilypond.org/doc/v2.14/Documentation/notation/rhythms"
urlIII =
"https://lilypond.org/doc/v2.14/Documentation/notation/note-heads"
urlIV =
"https://lilypond.org/doc/v2.14/Documentation/notation/beams"
urlV =
"https://lilypond.org/doc/v2.14/Documentation/notation/note-head-styles"
\relative c' {
 \key cis \minor
 \once \override Staff.Clef.color = #green
 \once \override Staff.Clef.after-line-breaking =
 #(add-link urlI)
 \once \override Staff.TimeSignature.color = #green
 \once \override Staff.TimeSignature.after-line-breaking =
 #(add-link urlII)
 \once \override NoteHead.color = #green
 \once \override NoteHead.after-line-breaking =
 #(add-link urlIII)
 cis'1
 \once \override Beam.color = #green
 \once \override Beam.after-line-breaking =
 #(add-link urlIV)
 cis8 dis e fis gis2
 <gis,
 % With 2.17.9 you could use the command below to address the Accidental.
 % \tweak Accidental.before-line-breaking #(add-link url)
 \tweak color #green
 \tweak after-line-breaking #(add-link urlV)
 \tweak style #'harmonic
 bis
 dis
 fis
 >1
 <cis, cis' e>
}

[image of music]


タブ譜にマークアップを追加する

デフォルトでは、タブ譜にマークアップは表示されません。表示させるには、\revert TabStaff.TextScript.stencil を使用します。

%% http://lsr.di.unimi.it/LSR/Item?id=919
% by P.P.Schneider on June 2014
high = { r4 r8 <g c'> q r8 r4 }
low = { c4 r4 c8 r8 g,8 b, }
pulse = { s8^"1" s^"&" s^"2" s^"&" s^"3" s^"&" s^"4" s^"&" }
\score {
 \new TabStaff {
 \repeat unfold 2 << \high \\ \low \\ \pulse >>
 }
 \layout {
 \context {
 \TabStaff
 \clef moderntab
 \revert TextScript.stencil
 \override TextScript.font-series = #'bold
 \override TextScript.font-size = #-2
 \override TextScript.color = #red
 }
 \context {
 \Score
 proportionalNotationDuration = #(ly:make-moment 1/8)
 }
 }
}

[image of music]


運指記号を譜の内側に表示する

デフォルトでは、縦方向の運指記号は譜の外側に配置されます。この挙動を取り消すことができます。注意: この場合、和音でない場合にも <> を用いる必要があります。

\relative c' {
 <c-1 e-2 g-3 b-5>2
 \override Fingering.staff-padding = #'()
 <c-1 e-2 g-3 b-5>4 g'-0
 a8[-1 b]-2 g-0 r
 \override Fingering.add-stem-support = ##f
 a[-1 b]-2 g-0 r
 \override Fingering.add-stem-support = ##t
 a[-1 b]-2 g-0 r
 \override Fingering.add-stem-support = #only-if-beamed
 a[-1 b]-2 g-0 r
}

[image of music]


小節番号を変更する

小節番号を付番する異なる方法が 2 つあり、繰り返しのある音楽に対して有用です。

\relative c'{
 \set Score.alternativeNumberingStyle = #'numbers
 \repeat volta 3 { c4 d e f | }
 \alternative {
 { c4 d e f | c2 d \break }
 { f4 g a b | f4 g a b | f2 a | \break }
 { c4 d e f | c2 d }
 }
 c1 \break
 \set Score.alternativeNumberingStyle = #'numbers-with-letters
 \repeat volta 3 { c,4 d e f | }
 \alternative {
 { c4 d e f | c2 d \break }
 { f4 g a b | f4 g a b | f2 a | \break }
 { c4 d e f | c2 d }
 }
 c1
}

[image of music]


分析用のブラケットを譜の上に表示する

分析用のブラケットは、デフォルトでは譜の下に表示されます。次の例は譜の上に表示する方法を示しています。

\layout {
 \context {
 \Voice
 \consists "Horizontal_bracket_engraver"
 }
}
\relative c'' {
 \once \override HorizontalBracket.direction = #UP
 c2\startGroup
 d2\stopGroup
}

[image of music]


ラベル付きの分析用ブラケット

Grob HorizontalBracketTexttext プロパティを設定することで、分析用のブラケットにテキストを追加することができます。同時に開始するブラケットに異なるテキストを追加する場合には、\tweak コマンドを使用してください。改行後のテキストは括弧付きで表示されます。

\layout {
 \context {
 \Voice
 \consists "Horizontal_bracket_engraver"
 \override HorizontalBracket.direction = #UP
 }
}
{
 \once\override HorizontalBracketText.text = "a"
 c''\startGroup d''\stopGroup
 \once\override HorizontalBracketText.text = "a'"
 e''\startGroup d''\stopGroup |
 c''-\tweak HorizontalBracketText.text
 \markup \bold \huge "b" \startGroup
 -\tweak HorizontalBracketText.text "a" \startGroup
 d''\stopGroup
 e''-\tweak HorizontalBracketText.text "a'" \startGroup
 d''\stopGroup\stopGroup |
 c''-\tweak HorizontalBracketText.text foo \startGroup
 d'' e'' f'' | \break
 g'' a'' b'' c'''\stopGroup
}

[image of music]


音階に応じて異なる符頭のスタイルを適用する

shapeNoteStyles プロパティは、音階 (調号と、tonic プロパティによる) に応じて符頭の形を変化させるために用いることができます。このプロパティは形のセットを与える必要がありますが、(triangle, cross, xcircle などの図形表現を用いて) 自由に定義できるほか、階名を使用して、アメリカの古い伝統の形を基に定義することができます (いくつかのラテン語の階名も使用することができます)。

古いアメリカの歌集を模倣するには、\aikenHeads\sacredHarpHeads といった定義済みのコマンドを符頭のスタイルとして用いることができます。

この例では、シェイプ ノートの符頭を得るいくつかの方法を示しています。また、和声機能と符頭の対応を維持しながらメロディを移調する機能も示しています。

fragment = {
 \key c \major
 c2 d
 e2 f
 g2 a
 b2 c
}
\new Staff {
 \transpose c d
 \relative c' {
 \set shapeNoteStyles = ##(do re mi fa
 #f la ti)
 \fragment
 }
 \break
 \relative c' {
 \set shapeNoteStyles = ##(cross triangle fa #f
 mensural xcircle diamond)
 \fragment
 }
}

[image of music]


\whiteout コマンドで譜線を隠す

\whiteout コマンドは、マークアップの背景を白色の長方形で囲みます。譜線はほとんどの Grob より下のレイヤにあるため、この白色の長方形は他の Grob と重ならなくなります。

\layout {
 ragged-right = ##f
}
\relative c' {
 \override TextScript.extra-offset = #'(2 . 4)
 c2-\markup { \whiteout \pad-markup #0.5 "middle C" } c
}

[image of music]


和音内の各音符のサイズを変更する

和音内の各音符の符頭は、和音内で \tweak を使用し、font-size を変更することでサイズを変えられます。

和音の中 (< > の内部) では、変更したい音符の前に \tweak コマンドを配置し、font-size とサイズ値の #-2 (非常に小さい) を指定します。

\relative c' {
 <\tweak font-size #+2 c e g c
 \tweak font-size #-2 e>1
 ^\markup { A tiny e }_\markup { A big c }
}

[image of music]


スラーを実線から点線や破線に変更する

スラーの見た目を実線から点線や破線に変更することができます。

\relative c' {
 c4( d e c)
 \slurDotted
 c4( d e c)
 \slurSolid
 c4( d e c)
 \slurDashed
 c4( d e c)
 \slurSolid
 c4( d e c)
}

[image of music]


ピッチに応じて符頭の色を変更する

符頭の色を、ピッチや名前に応じて変更することができます: この例で使われている関数では、異名同音を区別しています。

%Association list of pitches to colors.
#(define color-mapping
 (list
 (cons (ly:make-pitch 0 0 NATURAL) (x11-color 'red))
 (cons (ly:make-pitch 0 0 SHARP) (x11-color 'green))
 (cons (ly:make-pitch 0 1 FLAT) (x11-color 'green))
 (cons (ly:make-pitch 0 2 NATURAL) (x11-color 'red))
 (cons (ly:make-pitch 0 2 SHARP) (x11-color 'green))
 (cons (ly:make-pitch 0 3 FLAT) (x11-color 'red))
 (cons (ly:make-pitch 0 3 NATURAL) (x11-color 'green))
 (cons (ly:make-pitch 0 4 SHARP) (x11-color 'red))
 (cons (ly:make-pitch 0 5 NATURAL) (x11-color 'green))
 (cons (ly:make-pitch 0 5 FLAT) (x11-color 'red))
 (cons (ly:make-pitch 0 6 SHARP) (x11-color 'red))
 (cons (ly:make-pitch 0 1 NATURAL) (x11-color 'blue))
 (cons (ly:make-pitch 0 3 SHARP) (x11-color 'blue))
 (cons (ly:make-pitch 0 4 FLAT) (x11-color 'blue))
 (cons (ly:make-pitch 0 5 SHARP) (x11-color 'blue))
 (cons (ly:make-pitch 0 6 FLAT) (x11-color 'blue))))
%Compare pitch and alteration (not octave).
#(define (pitch-equals? p1 p2)
 (and
 (= (ly:pitch-alteration p1) (ly:pitch-alteration p2))
 (= (ly:pitch-notename p1) (ly:pitch-notename p2))))
#(define (pitch-to-color pitch)
 (let ((color (assoc pitch color-mapping pitch-equals?)))
 (if color
 (cdr color))))
#(define (color-notehead grob)
 (pitch-to-color
 (ly:event-property (event-cause grob) 'pitch)))
\score {
 \new Staff \relative c' {
 \override NoteHead.color = #color-notehead
 c8 b d dis ees f g aes
 }
}

[image of music]


和音内の運指記号の位置をコントロールする

運指番号の位置を精密にコントロールすることができます。位置の設定が適用されるためには、単一の音符であっても和音構造 <> を用いる必要があります。

\relative c' {
 \set fingeringOrientations = #'(left)
 <c-1 e-3 a-5>4
 \set fingeringOrientations = #'(down)
 <c-1 e-3 a-5>4
 \set fingeringOrientations = #'(down right up)
 <c-1 e-3 a-5>4
 \set fingeringOrientations = #'(up)
 <c-1 e-3 a-5>4
 \set fingeringOrientations = #'(left)
 <c-1>2
 \set fingeringOrientations = #'(down)
 <e-3>2
 \set stringNumberOrientations = #'(up left down)
 <f3円 a2円 c1円>1
 \set strokeFingerOrientations = #'(down right up)
 <c\rightHandFinger #1 e\rightHandFinger #2 c'\rightHandFinger #4 >
}

[image of music]


遅れターンを作成する

下の音符が臨時記号を持つような遅れターンを作るには、いくつかのオーバライドが必要です。outside-staff-priority プロパティを #f にセットしなければ、avoid-slur プロパティよりも優先されてしまい、スラーの内側に記号が入りません。分数 2/31/3 は、水平位置を調整しています。

\relative c'' {
 c2*2/3 ( s2*1/3\turn d4) r
 <<
 { c4.( d8) }
 { s4 s\turn }
 >>
 \transpose c d \relative c'' <<
 { c4.( d8) }
 {
 s4
 \once \set suggestAccidentals = ##t
 \once \override AccidentalSuggestion.outside-staff-priority = ##f
 \once \override AccidentalSuggestion.avoid-slur = #'inside
 \once \override AccidentalSuggestion.font-size = -3
 \once \override AccidentalSuggestion.script-priority = -1
 \single \hideNotes
 b8-\turn \noBeam
 s8
 }
 >>
}

[image of music]


空の譜を作成する

空の譜を作成するには、空の小節を作って Score コンテキストから Bar_number_engraver を削除します。また Staff コンテキストから Time_signature_engraver, Clef_engraver, Bar_engraver を削除します。

#(set-global-staff-size 20)
\score {
 {
 \repeat unfold 12 { s1 \break }
 }
 \layout {
 indent = 0\in
 \context {
 \Staff
 \remove "Time_signature_engraver"
 \remove "Clef_engraver"
 \remove "Bar_engraver"
 }
 \context {
 \Score
 \remove "Bar_number_engraver"
 }
 }
}
% uncomment these lines for "letter" size
%{
\paper {
 #(set-paper-size "letter")
 ragged-last-bottom = ##f
 line-width = 7.5\in
 left-margin = 0.5\in
 bottom-margin = 0.25\in
 top-margin = 0.25\in
}
%}
% uncomment these lines for "A4" size
%{
\paper {
 #(set-paper-size "a4")
 ragged-last-bottom = ##f
 line-width = 180
 left-margin = 15
 bottom-margin = 10
 top-margin = 10
}
%}

[image of music]


2 桁の運指記号を作成する

5 よりも大きな運指記号を作成することができます。

\relative c' {
 c1-10
 c1-50
 c1-36
 c1-29
}

[image of music]


譜の中央にある音符の符幹のデフォルトの向き

譜の中央にある音符の符幹の向きは、Stemneutral-direction プロパティにセットされています。

\relative c'' {
 a4 b c b
 \override Stem.neutral-direction = #up
 a4 b c b
 \override Stem.neutral-direction = #down
 a4 b c b
}

[image of music]


Different font size settings for instrumentName and shortInstrumentName

Choose different font sizes for instrumentName and shortInstrumentName as a context override.

InstrumentNameFontSize =
#(define-music-function (font-size-pair)(pair?)
"Sets the @code{font-size} of @code{InstrumentName}.
The font-size for the initial @code{instrumentName} is taken from the first
value in @var{font-size-pair}. @code{shortInstrumentName} will get the second
value of @var{font-size-pair}.
"
;; This code could be changed/extended to set different values for each
;; occurance of `shortInstrumentName'
#{
 \override InstrumentName.after-line-breaking =
 #(lambda (grob)
 (let* ((orig (ly:grob-original grob))
 (siblings (if (ly:grob? orig)
 (ly:spanner-broken-into orig)
 '())))
 (if (pair? siblings)
 (begin
 (ly:grob-set-property!
 (car siblings)
 'font-size
 (car font-size-pair))
 (for-each
 (lambda (g)
 (ly:grob-set-property! g 'font-size (cdr font-size-pair)))
 (cdr siblings))))))
#})
\layout {
 \context {
 \Staff
 \InstrumentNameFontSize #'(6 . -3)
 }
}
\new StaffGroup <<
 \new Staff
 \with {
 instrumentName = "Flute"
 shortInstrumentName = "Fl."
 }
 { c''1 \break c'' \break c'' }
 \new Staff
 \with {
 instrumentName = "Violin"
 shortInstrumentName = "Vl."
 }
 { c''1 \break c'' \break c'' }
>>

[image of music]


Grob の周りにボックスを表示する

任意の Grob の周りにボックスを表示するために、print-function をオーバライドすることができます。

\relative c'' {
 \override TextScript.stencil =
 #(make-stencil-boxer 0.1 0.3 ly:text-interface::print)
 c'4^"foo"
 \override Stem.stencil =
 #(make-stencil-boxer 0.05 0.25 ly:stem::print)
 \override Score.RehearsalMark.stencil =
 #(make-stencil-boxer 0.15 0.3 ly:text-interface::print)
 b8
 \revert Stem.stencil
 \revert Flag.stencil
 c4. c4
 \mark "F"
 c1
}

[image of music]


符頭の周りを円で囲む

符頭を円で囲む方法です。

circle =
\once \override NoteHead.stencil = #(lambda (grob)
 (let* ((note (ly:note-head::print grob))
 (combo-stencil (ly:stencil-add
 note
 (circle-stencil note 0.1 0.8))))
 (ly:make-stencil (ly:stencil-expr combo-stencil)
 (ly:stencil-extent note X)
 (ly:stencil-extent note Y))))
{ \circle c'' }

[image of music]


様々なオブジェクトの周りを円で囲む

\circle マークアップ コマンドは、様々なオブジェクトの周りに円を描画します (例えば運指記号)。他のオブジェクトに対しては、調整が必要な場合があります: この例は、リハーサル記号と小節番号に対して円を描画する 2 つの方法を示しています。

\relative c' {
 c1
 \set Score.markFormatter =
 #(lambda (mark context)
 (make-circle-markup (format-mark-numbers mark context)))
 \mark \default
 c2 d^\markup {
 \override #'(thickness . 3) {
 \circle \finger 2
 }
 }
 \override Score.BarNumber.break-visibility = #all-visible
 \override Score.BarNumber.stencil =
 #(make-stencil-circler 0.1 0.25 ly:text-interface::print)
}

[image of music]


\markup ブロックにネイティブ PostScript を埋め込む

\markup ブロックに直接 PostScript コードを挿入することができます。

% PostScript is a registered trademark of Adobe Systems Inc.
\relative c'' {
 a4-\markup { \postscript "3 4 moveto 5 3 rlineto stroke" }
 -\markup { \postscript "[ 0 1 ] 0 setdash 3 5 moveto 5 -3 rlineto stroke " }
 b4-\markup { \postscript "3 4 moveto 0 0 1 2 8 4 20 3.5 rcurveto stroke" }
 s2
 a'1
}

[image of music]


グリッド線: 見た目を変更する

グリッド線の見た目は、プロパティをオーバライドすることで変更することができます。

\score {
 \new ChoirStaff <<
 \new Staff {
 \relative c'' {
 \stemUp
 c'4. d8 e8 f g4
 }
 }
 \new Staff {
 \relative c {
 % this moves them up one staff space from the default position
 \override Score.GridLine.extra-offset = #'(0.0 . 1.0)
 \stemDown
 \clef bass
 \once \override Score.GridLine.thickness = #5.0
 c4
 \once \override Score.GridLine.thickness = #1.0
 g'4
 \once \override Score.GridLine.thickness = #3.0
 f4
 \once \override Score.GridLine.thickness = #5.0
 e4
 }
 }
 >>
 \layout {
 \context {
 \Staff
 % set up grids
 \consists "Grid_point_engraver"
 % set the grid interval to one quarter note
 gridInterval = #(ly:make-moment 1/4)
 }
 \context {
 \Score
 \consists "Grid_line_span_engraver"
 % this moves them to the right half a staff space
 \override NoteColumn.X-offset = #-0.5
 }
 }
}

[image of music]


グリッド線: リズムの強調と音符の同期

一定の拍毎に、譜どうしの音符の同期を示す縦線を描画することができます。しかし、モノフォニックな音楽では、このスニペットのように 2 つ目の譜を不可視にして、縦線をより短くすると良い場合があります。

\score {
 \new ChoirStaff {
 \relative c'' <<
 \new Staff {
 \time 12/8
 \stemUp
 c4. d8 e8 f g4 f8 e8. d16 c8
 }
 \new Staff {
 % hides staff and notes so that only the grid lines are visible
 \hideNotes
 \hide Staff.BarLine
 \override Staff.StaffSymbol.line-count = #0
 \hide Staff.TimeSignature
 \hide Staff.Clef
 % dummy notes to force regular note spacing
 \once \override Score.GridLine.thickness = #4.0
 c8 c c
 \once \override Score.GridLine.thickness = #3.0
 c8 c c
 \once \override Score.GridLine.thickness = #4.0
 c8 c c
 \once \override Score.GridLine.thickness = #3.0
 c8 c c
 }
 >>
 }
 \layout {
 \context {
 \Score
 \consists "Grid_line_span_engraver"
 % center grid lines horizontally below note heads
 \override NoteColumn.X-offset = #-0.5
 }
 \context {
 \Staff
 \consists "Grid_point_engraver"
 gridInterval = #(ly:make-moment 1/8)
 % set line length and positioning:
 % two staff spaces above center line on hidden staff
 % to four spaces below center line on visible staff
 \override GridPoint.Y-extent = #'(2 . -4)
 }
 ragged-right = ##t
 }
}

[image of music]


和音に対してハンマリング オンやプリング オフを使用する

和音に対してハンマリング オンやプリング オフを用いる際、弧は 1 つしか描かれません。“二重の弧” は、doubleSlurs プロパティを #t にセットすることで描くことができます。

\new TabStaff {
 \relative c' {
 % chord hammer-on and pull-off
 \set doubleSlurs = ##t
 <g' b>8( <a c> <g b>)
 }
}

[image of music]


ボイスに対してハンマリング オンやプリング オフを使用する

ハンマリング オンやプリング オフの弧は、ボイス 1, 3 に対しては上向き、ボイス 2, 4 に対しては下向きになります。

\new TabStaff {
 \relative c' {
 << { \voiceOne g2( a) }
 \\ { \voiceTwo a,( b) }
 >> \oneVoice
 }
}

[image of music]


ハンマリング オンとプリング オフ

ハンマリング オンやプリング オフはスラーで得ることができます。

\new TabStaff {
 \relative c' {
 d4( e2円)
 a( g)
 }
}

[image of music]


同じ小節線の上と下に 2 つのリハーサル記号を表示する (方法 1)

この方法は、’リハーサル記号’ を 2 つ、同じ位置に表示します。片方のリハーサル記号を譜の下に移動し、その上に空白を加えてもう片方のリハーサル記号が譜の上になるようにしています。

extra-offset や baseline-skip の値を調整することで、リハーサル記号と譜とのスペースを増減させることができます。

ほとんど全てのグリフや文字列をリハーサル記号にすることができるため、何らかのグリフや文字列を小節線の上や下に中央揃えするために用いることもできます。

スニペット 1 にあるように、適切な ’break-visibility’ を加えることで、2 つのリハーサル記号を行の終わりに表示することもできます。

注意: 方法 1 は方法 2 より複雑ではないですが、もう片方の記号に影響を与えずに片方の位置を微調整することはできません。また、extra-offset を調整しても記号の本来のバウンディング ボックスは維持されるため、垂直方向のスペーシングに関しても問題があります。

\relative c'{
 c d e f |
 \once \override Score.RehearsalMark.extra-offset = #'(0 . -8.5)
 \once \override Score.RehearsalMark.baseline-skip = #9
 \mark \markup \center-column { \circle 1 \box A }
 g f e d |
 \once \override Score.RehearsalMark.extra-offset = #'(0 . -8.5)
 \once \override Score.RehearsalMark.baseline-skip = #9
 \mark \markup \center-column { \flat { \bold \small \italic Fine. } }
 g f e d |
 \once \override Score.RehearsalMark.extra-offset = #'(0 . -8.5)
 \once \override Score.RehearsalMark.baseline-skip = #9
 \override Score.RehearsalMark.break-visibility = #begin-of-line-invisible
 \mark \markup \center-column { \fermata \box z }
}

[image of music]


同じ小節線の上と下に 2 つのリハーサル記号を表示する (方法 2)

この方法は、’リハーサル記号’ を 2 つ、同じ位置に表示します。片方は譜の上、片方は譜の下に配置されています。そのために、2 つのボイスを作成し、リハーサル記号のエングラーバをそれぞれのボイスに追加しています (そうしなければ表示されません)。 そして、それぞれのボイス内でリハーサル記号の向きを UP と DOWN に設定しています。

この方法は (方法 1 と異なり) より複雑ですが、もう片方に影響を与えずに片方のリハーサル記号を調整することができるためより柔軟です。

\score {
 \relative c'
 <<
 \new Staff {
 <<
 \new Voice \with {
 \consists Mark_engraver
 \consists "Staff_collecting_engraver"
 }
 { c4 d e f
 \mark \markup { \box A }
 c4 d e f
 }
 \new Voice \with {
 \consists Mark_engraver
 \consists "Staff_collecting_engraver"
 \override RehearsalMark.direction = #DOWN
 }
 { s4 s s s
 \mark \markup { \circle 1 }
 s4 s s s
 }
 >>
 }
 >>
 \layout {
 \context {
 \Score
 \remove "Mark_engraver"
 \remove "Staff_collecting_engraver"
 }
 }
}

[image of music]


いくつかの譜線を他より太くする

教育上の目的で、譜線を太くすることができます (目的の例としては、中央の線の強調や、ト音記号の線を強調することなど)。これは強調したい線のすぐ近くに新たな譜線を追加することで実現できます。譜線の追加には StaffSymbol オブジェクトの line-positions プロパティを使用します。

{
 \override Staff.StaffSymbol.line-positions =
 #'(-4 -2 -0.2 0 0.2 2 4)
 d'4 e' f' g'
}

[image of music]


符幹にクロス記号を表示して話の部分を示す

この例は、符幹にクロス記号を表示します。話 (訳注: Sprechgesang と呼ばれます) のセクションの始まりを \speakOn コマンドで、終わりを \speakOff コマンドで示します。

speakOn = {
 \override Stem.stencil =
 #(lambda (grob)
 (let* ((x-parent (ly:grob-parent grob X))
 (is-rest? (ly:grob? (ly:grob-object x-parent 'rest))))
 (if is-rest?
 empty-stencil
 (ly:stencil-combine-at-edge
 (ly:stem::print grob)
 Y
 (- (ly:grob-property grob 'direction))
 (grob-interpret-markup grob
 (markup #:center-align #:fontsize -4
 #:musicglyph "noteheads.s2cross"))
 -2.3))))
}
speakOff = {
 \revert Stem.stencil
 \revert Flag.stencil
}
\score {
 \new Staff {
 \relative c'' {
 a4 b a c
 \speakOn
 g4 f r g
 b4 r d e
 \speakOff
 c4 a g f
 }
 }
}

[image of music]


小節カウンタ

このスニペットは、透明なパーセント繰り返しを用いて、小節カウンタを表示する方法を示しています。

<<
 \context Voice = "foo" {
 \clef bass
 c4 r g r
 c4 r g r
 c4 r g r
 c4 r g r
 }
 \context Voice = "foo" {
 \set countPercentRepeats = ##t
 \hide PercentRepeat
 \override PercentRepeatCounter.staff-padding = #1
 \repeat percent 4 { s1 }
 }
>>

[image of music]


小節のグループに番号付けする

このスニペットは Measure_counter_engraver で、連続した小節をいくつかにグループ分けし、それぞれに番号を表示する方法を示しています。どのような範囲を取っても良く、繰り返しが含まれていてもかまいません。

エングラーバは適切なコンテキストに追加する必要があります。今回は Staff コンテキストを使用しています。他の選択肢としては Dynamics コンテキストがあります。

カウンタは \startMeasureCount で始まり、\stopMeasureCount で終わります。番号はデフォルトで 1 から開始しますが、count-from プロパティをオーバライドすることで変更することができます。

小節の途中で改行される場合、小節番号は 2 回表示されます。改行後の数字は括弧付きで表示されます。

\layout {
 \context {
 \Staff
 \consists #Measure_counter_engraver
 }
}
\new Staff {
 \startMeasureCount
 \repeat unfold 7 {
 c'4 d' e' f'
 }
 \stopMeasureCount
 \bar "||"
 g'4 f' e' d'
 \override Staff.MeasureCounter.count-from = #2
 \startMeasureCount
 \repeat unfold 5 {
 g'4 f' e' d'
 }
 g'4 f'
 \bar ""
 \break
 e'4 d'
 \repeat unfold 7 {
 g'4 f' e' d'
 }
 \stopMeasureCount
}

[image of music]


運指記号の位置を正確にコントロールする

和音内の運指の配置に関するオプションは、デフォルトで良く動作しますが、ある記号の位置を正確にコントロールしたい場合には、以下の調整を用いることができます。これは 2 度音程の和音がある場合の配置に対しては特に有用です。

\relative c' {
 \set fingeringOrientations = #'(left)
 <c-1 d-2 a'-5>4
 <c-1 d-\tweak extra-offset #'(0 . 0.2)-2 a'-5>4
 \set fingeringOrientations = #'(down)
 <c-1 d-2 a'-5>4
 <c-\tweak extra-offset #'(0 . -1.1)-1
 d-\tweak extra-offset #'(-1.2 . -1.8)-2 a'-5>4
 \set fingeringOrientations = #'(down right up)
 <c-1 d-\tweak extra-offset #'(-0.3 . 0)-2 a'-5>4
 <c-1 d-\tweak extra-offset #'(-1 . 1.2)-2 a'-5>4
 \set fingeringOrientations = #'(up)
 <c-1 d-\tweak extra-offset #'(0 . 1.1)-2
 a'-\tweak extra-offset #'(0 . 1)-5>4
 <c-1 d-\tweak extra-offset #'(-1.2 . 1.5)-2
 a'-\tweak extra-offset #'(0 . 1.4)-5>4
}

[image of music]


テキスト マークアップをスラーの内側に配置する

テキスト マークアップをスラーの内側に配置するには、outside-staff-priority プロパティを #f に設定する必要があります。

\relative c'' {
 \override TextScript.avoid-slur = #'inside
 \override TextScript.outside-staff-priority = ##f
 c2(^\markup { \halign #-10 \natural } d4.) c8
}

[image of music]


テキストを右から左へ表示する

以下に示すように、マークアップ オブジェクト内でテキストを右から左へ表示することができます。

{
 b1^\markup {
 \line { i n g i r u m i m u s n o c t e }
 }
 f'_\markup {
 \override #'(text-direction . -1)
 \line { i n g i r u m i m u s n o c t e }
 }
}

[image of music]


弦番号の延長線

弦番号の延長線を追加し、続く音符が全て同じ弦で演奏されることを示します。

stringNumberSpanner =
 #(define-music-function (StringNumber) (string?)
 #{
 \override TextSpanner.style = #'solid
 \override TextSpanner.font-size = #-5
 \override TextSpanner.bound-details.left.stencil-align-dir-y = #CENTER
 \override TextSpanner.bound-details.left.text =
 \markup { \circle \number $StringNumber }
 #})
\relative c {
 \clef "treble_8"
 \stringNumberSpanner "5"
 \textSpannerDown
 a8\startTextSpan
 b c d e f\stopTextSpan
 \stringNumberSpanner "4"
 g\startTextSpan a
 bes4 a g2\stopTextSpan
}

[image of music]


特殊な符頭を作成するために PostScript を使用する

特殊な符頭をグラフィック マークアップで作成するのが困難な場合、PostScript コードを用いて形をつくることが出来ます。この例は、平行四辺形の符頭を作成する方法を示しています。

parallelogram =
 #(ly:make-stencil (list 'embedded-ps
 "gsave
 currentpoint translate
 newpath
 0 0.25 moveto
 1.3125 0.75 lineto
 1.3125 -0.25 lineto
 0 -0.75 lineto
 closepath
 fill
 grestore" )
 (cons 0 1.3125)
 (cons -.75 .75))
myNoteHeads = \override NoteHead.stencil = \parallelogram
normalNoteHeads = \revert NoteHead.stencil
\relative c'' {
 \myNoteHeads
 g4 d'
 \normalNoteHeads
 <f, \tweak stencil \parallelogram b e>4 d
}

[image of music]


whiteout プロパティを使用する

下にあるオブジェクトの一部分をマスクするために、任意のグラフィカル オブジェクトを白い背景の上に表示することができます。これは、衝突を解決するためにオブジェクトを移動するのが困難であるような複雑な状況において、見た目を改善するのに有効です。layer プロパティを明示的に設定して、どのオブジェクトが白でマスクされるかを指定しなければなりません。

この例では、タイと拍子記号が重なる部分について、タイの方をマスクしています。そのためには TimeSignaturewhiteout プロパティを設定し、TimeSignatureTie の上のレイヤに移動する必要があります。Tie のデフォルトのレイヤは 1 であるため、TimeSignature のレイヤ値をそれより大きくします。また、StaffSymbol がマスクされないように、更に上位のレイヤに配置する必要があります。

{
 \override Score.StaffSymbol.layer = #4
 \override Staff.TimeSignature.layer = #3
 b'2 b'~
 \once \override Staff.TimeSignature.whiteout = ##t
 \time 3/4
 b' r4
}

[image of music]


<< ドキュメント インデックスに戻る

LilyPond — Snippets v2.22.2 (安定版).

AltStyle によって変換されたページ (->オリジナル) /