Repeats

Repeats


繰り返し括弧を他の譜にも追加する

デフォルトでは、Volta_engraverScore コンテキストに属しており、繰り返しの括弧は通常最上段の譜の上にのみ表示されます。これを調整するには、Volta_engraver を、括弧を表示させたい譜の Staff コンテキストに追加します。“複数譜に繰り返し括弧を表示する” スニペットも参照してください。

<<
  \new Staff { \repeat volta 2 { c'1 } \alternative { c' } }
  \new Staff { \repeat volta 2 { c'1 } \alternative { c' } }
  \new Staff \with { \consists "Volta_engraver" } { c'2 g' e' a' }
  \new Staff { \repeat volta 2 { c'1 } \alternative { c' } }
>>

[image of music]


小節番号を中央揃えする

大きなアンサンブル スコアでは、小節番号がシステムの下に、また小節の中央に表示されるものがあります。このスニペットは Measure_counter_engraver を用いて、この慣習を模倣する方法を示しています。ここでは、Dynamics コンテキストにエングラーバを追加しています。

\layout {
  \context {
    \Dynamics
    \consists #Measure_counter_engraver
    \override MeasureCounter.direction = #DOWN
    \override MeasureCounter.font-encoding = #'latin1
    \override MeasureCounter.font-shape = #'italic
    % to control the distance of the Dynamics context from the staff:
    \override VerticalAxisGroup.nonstaff-relatedstaff-spacing.padding = #2
  }
  \context {
    \Score
    \remove "Bar_number_engraver"
  }
}

pattern = \repeat unfold 7 { c'4 d' e' f' }

\new StaffGroup <<
  \new Staff {
    \pattern
  }
  \new Staff {
    \pattern
  }
  \new Dynamics {
    \startMeasureCount
    s1*7
    \stopMeasureCount
  }
>>

[image of music]


デフォルトの小節線を変更する

デフォルトの小節線は、Score コンテキストで再定義することで変更することができます。

% http://lsr.di.unimi.it/LSR/Item?id=964
%%=> http://lists.gnu.org/archive/html/lilypond-user/2014-03/msg00126.html
%%=> http://lilypond.1069038.n5.nabble.com/Changing-the-default-end-repeat-bracket-tc169357.html

\layout {
  \context {
    \Score
    %% Changing the defaults from engraver-init.ly
    measureBarType = #"!"
    startRepeatBarType = #"[|:"
    endRepeatBarType = #":|]"
    doubleRepeatBarType = #":|][|:"
  }
}

%% example:
{
  c'1
  \repeat volta 2 { \repeat unfold 2 c' }
  \repeat volta 2 { \repeat unfold 2 c' }
  \alternative {
    { c' }
    {
      %% v2.18 workaround
      \once\override Score.VoltaBracket.shorten-pair = #'(1 . -1)
      c'
    }
  }
  \bar "|."
}

[image of music]


譜をまたがるトレモロ

\repeat tremolo は、和音のトレモロに対してはちょうど 2 つの引数を取らなければならないため、譜をまたがる和音のトレモロは 同じ括弧内に音を配置し、\change Staff コマンドで譜を変更する必要があります。

\new PianoStaff <<
  \new Staff = "up" \relative c'' {
    \key a \major
    \time 3/8
    s4.
  }
  \new Staff = "down" \relative c'' {
    \key a \major
    \time 3/8
    \voiceOne
    \repeat tremolo 6 {
      <a e'>32
      {
        \change Staff = "up"
        \voiceTwo
        <cis a' dis>32
      }
    }
  }
>>

[image of music]


トレモロを符幹に接触せずに譜刻する

トレモロの演奏時間が 4 分音符より短い場合や、ちょうど 2 分音符である場合、あるいは 2 分音符と全音符の間の長さである場合は、連桁を符幹と接触させて表示することが一般的です。スタイルによっては、いくつかの連桁が符幹に接触せずに中央に描かれる場合があります。このような符幹に接触しないトレモロの連桁の数は、Beam オブジェクトの gap-count プロパティでコントロールされます。また、連桁と符幹との間隔は gap プロパティでセットされます。

\relative c'' {
  \repeat tremolo 8 { a32 f }
  \override Beam.gap-count = #1
  \repeat tremolo 8 { a32 f }
  \override Beam.gap-count = #2
  \repeat tremolo 8 { a32 f }
  \override Beam.gap-count = #3
  \repeat tremolo 8 { a32 f }

  \override Beam.gap-count = #3
  \override Beam.gap = #1.33
  \repeat tremolo 8 { a32 f }
  \override Beam.gap = #1
  \repeat tremolo 8 { a32 f }
  \override Beam.gap = #0.67
  \repeat tremolo 8 { a32 f }
  \override Beam.gap = #0.33
  \repeat tremolo 8 { a32 f }
}

[image of music]


独立したパーセント繰り返し

パーセント繰り返しを単独で表示することができます。

makePercent =
#(define-music-function (note) (ly:music?)
   "Make a percent repeat the same length as NOTE."
   (make-music 'PercentEvent
               'length (ly:music-length note)))

\relative c'' {
  \makePercent s1
}

[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]


パーセント繰り返しのカウンタの可視性

パーセント繰り返しのカウンタは repeatCountVisibility コンテキスト プロパティをセットすることで一定間隔で表示することができます。

\relative c'' {
  \set countPercentRepeats = ##t
  \set repeatCountVisibility = #(every-nth-repeat-count-visible 5)
  \repeat percent 10 { c1 } \break
  \set repeatCountVisibility = #(every-nth-repeat-count-visible 2)
  \repeat percent 6 { c1 d1 }
}

[image of music]


パーセント繰り返しのカウンタ

パーセント記号による小節の繰り返しが 2 回以上続く場合には、この例のようにプロパティをセットすることで、カウンタを表示することができます。

\relative c'' {
  \set countPercentRepeats = ##t
  \repeat percent 4 { c1 }
}

[image of music]


セーニョとコーダを (改行を挟んで) 配置する

出口となるセーニョ記号を配置し、隣の通常譜線がある位置に “D.S. al Coda” のようなテキストを加えたい場合、以下のスニペットを用いることができます。コーダは新しい行から始まります。また、このスニペットには、コーダが同じ行に続くバージョンも用意されています。

{
  \relative c'' {
    c4 c c c c c c c c c c c
    \repeat segno 2 {
      c4 c c c c c c c
      \alternative {
        \volta 1 {
          c4 c c c c c c c c c c c
          % If you don't use \break at Coda, use \noBreak here
          % and after \bar "" below.
          \noBreak
          \section % double bar line
          \cadenzaOn % pause bar count
          \stopStaff % remove staff lines
          % Increasing the unfold counter will expand the staff-free space
          \repeat unfold 6 {
            s1
            \bar ""
          }
          % Place JumpScript where the staff would normally be.
          \once \override Score.JumpScript.outside-staff-priority = ##f
          \once \override Score.JumpScript.Y-offset = 0
          \startStaff % resume bar count
          \cadenzaOff % show staff lines again
        }
      }
    }
    \sectionLabel "Coda"
    % Show Coda on a new line
    \break
    \repeat unfold 8 { c4 c c c }
    \fine
  }
}

[image of music]


入れ替え部分がある場合の二重繰り返しのデフォルトをセットする

入れ替え部分がある場合の二重繰り返しのスタイルには 3 種類あります。これは doubleRepeatBarType でセットすることができます。

\relative c'' {
  \repeat volta 2 { c1 }
  \set Score.doubleRepeatBarType = #":..:"
  \repeat volta 2 { c1 }
  \set Score.doubleRepeatBarType = #":|.|:"
  \repeat volta 2 { c1 }
  \set Score.doubleRepeatBarType = #":|.:"
  \repeat volta 2 { c1 }
}

[image of music]


繰り返し括弧を短くする

デフォルトでは、繰り返し括弧は入れ替え部分全体に表示されますが、voltaSpannerDuration をセットすることで短くすることができます。次の例では、括弧は 1 小節、つまり 3/4 分だけ表示されます。

\relative c'' {
  \time 3/4
  c4 c c
  \set Score.voltaSpannerDuration = #(ly:make-moment 3/4)
  \repeat volta 5 { d4 d d }
  \alternative {
    {
      e4 e e
      f4 f f
    }
    { g4 g g }
  }
}

[image of music]


繰り返し括弧をコード ネームの下に表示する

Volta_engraver を対応する譜に付け加えることで、繰り返し括弧をコード ネームの下に表示できます。

\score {
  <<
    \chords {
      c1
      c1
    }
    \new Staff \with {
      \consists "Volta_engraver"
    }
    {
      \repeat volta 2 { c'1 }
      \alternative { c' }
    }
  >>
  \layout {
    \context {
      \Score
      \remove "Volta_engraver"
    }
  }
}

[image of music]


複数譜に繰り返し括弧を表示する

Volta_engraver を譜に追加することで、繰り返し括弧を楽譜の最上段の譜以外にも表示することができます。

voltaMusic = \relative c'' {
  \repeat volta 2 {
    c1
  }
  \alternative {
    d1
    e1
  }
}

<<
  \new StaffGroup <<
    \new Staff \voltaMusic
    \new Staff \voltaMusic
  >>
  \new StaffGroup <<
    \new Staff \with { \consists "Volta_engraver" }
      \voltaMusic
    \new Staff \voltaMusic
  >>
>>

[image of music]


repeatCommands を用いて入れ替え部分のテキストにマークアップを使用する

入れ替え部分のある繰り返しは \repeat volta を用いて指定するのが最善ですが、入れ替え部分のテキストを \markup によってフォーマットする必要がある場合は、repeatCommands コンテキスト プロパティを用いる必要があります。

repeatCommands はリストを取るため、マークアップを含める簡単な方法は、マークアップを変数として定義し、Scheme 構文を用いてリストに埋め込むことです (#(list (list 'volta textIdentifier)), textIdentifier は変数名)。繰り返し小節線の指定を、リストの別の要素から行うことができます。

voltaAdLib = \markup { 1. 2. 3... \text \italic { ad lib. } }

\relative c'' {
  c1
  \set Score.repeatCommands = #(list (list 'volta voltaAdLib) 'start-repeat)
  c4 b d e
  \set Score.repeatCommands = #'((volta #f) (volta "4.") end-repeat)
  f1
  \set Score.repeatCommands = #'((volta #f))
}

[image of music]


LilyPond — Snippets v2.23.82 (開発版).