Next: , Previous: Augmentation dots, Up: Rhythms


6.2.3 Tuplets

Tuplets are made out of a music expression by multiplying all durations with a fraction

\times fraction musicexpr

The duration of musicexpr will be multiplied by the fraction. The fraction's denominator will be printed over the notes, optionally with a bracket. The most common tuplet is the triplet in which 3 notes have the length of 2, so the notes are 2/3 of their written length

     
     g'4 \times 2/3 {c'4 c' c'} d'4 d'4

[image of music]

Tuplets may be nested, for example,

\override TupletNumber #'text = #tuplet-number::calc-fraction-text
\times 4/6 {
  a4 a
  \times 3/5 { a a a a a }
}

[image of music]

Predefined commands

\tupletUp, \tupletDown, \tupletNeutral.

Commonly tweaked properties

The property tupletSpannerDuration specifies how long each bracket should last. With this, you can make lots of tuplets while typing \times only once, thus saving lots of typing. In the next example, there are two triplets shown, while \times was only used once

     
     \set tupletSpannerDuration = #(ly:make-moment 1 4)
     \times 2/3 { c8 c c c c c }

[image of music]

For more information about make-moment, see Time administration.

The format of the number is determined by the property text in TupletNumber. The default prints only the denominator, but if it is set to the function tuplet-number::calc-fraction-text, num:den will be printed instead.

To avoid printing tuplet numbers, use

     
     \times 2/3 { c8 c c } \times 2/3 { c8 c c }
     \override TupletNumber #'transparent = ##t
     \times 2/3 { c8 c c } \times 2/3 { c8 c c }

[image of music]

Use the \tweak function to override nested tuplets beginning at the same music moment. In this example, \tweak specifies fraction text for the outer TupletNumber and denominator text for the TupletNumber of the first of the three inner tuplets.

     
     \new Staff {
       \tweak #'text #tuplet-number::calc-fraction-text
       \times 4/3 {
          \tweak #'text #tuplet-number::calc-denominator-text
          \times 2/3 { c'8[ c'8 c'8] }
          \times 2/3 { c'8[ c'8 c'8] }
          \times 2/3 { c'8[ c'8 c'8] }
       }
     }

[image of music]

Here \tweak and \override work together to specify TupletBracket direction. The first \tweak positions the TupletBracket of the outer tuplet above the staff. The second \tweak positions the TupletBracket of the first of the three inner tuplets below the staff. Note that this pair of \tweak functions affects only the outer tuplet and the first of the three inner tuplets because only those two tuplets begin at the same music moment. We use \override in the usual way to position the TupletBrackets of the second and third of the inner tuplets below the staff.

     
     \new Staff {
       \tweak #'text #tuplet-number::calc-fraction-text
       \tweak #'direction #up
       \times 4/3 {
          \tweak #'direction #down
          \times 2/3 { c'8[ c'8 c'8] }
          \override TupletBracket #'direction = #down
          \times 2/3 { c'8[ c'8 c'8] }
          \times 2/3 { c'8[ c'8 c'8] }
       }
     }

[image of music]

Tuplet brackets can be made to run to prefatory matter or the next note

[image of music]

See also

Program reference: TupletBracket, TupletNumber, and TimeScaledMusic.


Next: , Previous: Augmentation dots, Up: Rhythms

Diese Seite ist für LilyPond-2.11.28 (Entwicklungszweig).

Fehler bitte an http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs melden.

Your suggestions for the documentation are welcome.