@cindex triplets
@funindex \times
-Tuplets are made out of a music expression by multiplying all
+Tuplets are made from a music expression by multiplying all the
durations with a fraction:
@example
The duration of @var{musicexpr} will be multiplied by the
fraction. The fraction's denominator will be printed over or
under the notes, optionally with a bracket. The most common
-tuplet is the triplet in which 3 notes have the length of 2, so
+tuplet is the triplet in which 3 notes have the duration of 2, so
the notes are 2/3 of their written length.
@lilypond[quote,ragged-right,fragment,verbatim,relative=2]
Tuplets may be nested:
-@lilypond[fragment,ragged-right,verbatim,relative=2]
-\relative c'' {
- \autoBeamOff
- c4 \times 4/5 { f8 e f \times 2/3 {e[ f g] } } f4 |
-}
+@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
+\autoBeamOff
+c4 \times 4/5 { f8 e f \times 2/3 {e[ f g] } } f4 |
@end lilypond
Modifying nested tuplets which begin at the same musical moment
@lilypondfile [verbatim,lilyquote,ragged-right,texidoc]
{entering-several-tuplets-using-only-one--times-command.ly}
-@ignore
-@c TODO Remove when snippet works ok
-@c Sent to Snippet 5 Feb 08
-The property @code{tupletSpannerDuration} specifies how long each
-bracket should last. With this, you can make lots of tuplets
-while typing @code{\times} only once, thus saving lots of typing.
-In the next example, there are two triplets shown, while
-@code{\times} was only used once.
-
-@lilypond[quote,fragment,relative=2,ragged-right,verbatim]
-\set tupletSpannerDuration = #(ly:make-moment 1 4)
-\times 2/3 { c8 c c c c c }
-@end lilypond
-@end ignore
-
@noindent
For more information about @code{make-moment}, see
@ref{Time administration}.
@code{\compressMusic} works similarly to \times, but does not
create a tuplet bracket. One application is in polymetric
-notation, as shown in the following example. See
-@ref{Polymetric notation}.
+notation, see @ref{Polymetric notation}.
@lilypondfile [verbatim,lilyquote,ragged-right,texidoc]
{printing-music-with-different-time-signatures.ly}
+
at first, so we can be sure the command is working. We get:
@example
- \override Slur #'thickness = #5.0
+\override Slur #'thickness = #5.0
@end example
Don't forget the @code{#'} preceding the
in italics should be
@example
- \override LyricText #'font-shape = #'italic
+\override LyricText #'font-shape = #'italic
@end example
@noindent
the interpreter cannot recognise them. So the command should be:
@example
- \override Lyrics . LyricText #'font-shape = #'italic
+\override Lyrics . LyricText #'font-shape = #'italic
@end example
@warning{In lyrics always leave whitespace between the final
by placing the overrides in a Score @code{\with} block, rather than
in-line in music, as follows:
-@verbatim
-\new Score \with {
+@example
+\new Score \with @{
% Makes sure text scripts and lyrics are within the paper margins
\override PaperColumn #'keep-inside-line = ##t
\override NonMusicalPaperColumn #'keep-inside-line = ##t
-} {
+@} @{
..
-}
-@end verbatim
+@}
+@end example
@node Advanced tweaks with Scheme
@subsection Advanced tweaks with Scheme
#(define (color-notehead grob)
"Color the notehead according to its position on the staff."
(let ((mod-position (modulo (ly:grob-property grob 'staff-position) 7)))
- (case mod-position ; Set rainbow colors
- ((1) (ly:grob-set-property! grob 'color (x11-color 'red)))
- ((2) (ly:grob-set-property! grob 'color (x11-color 'orange)))
- ((3) (ly:grob-set-property! grob 'color (x11-color 'yellow)))
- ((4) (ly:grob-set-property! grob 'color (x11-color 'green)))
- ((5) (ly:grob-set-property! grob 'color (x11-color 'blue)))
- ((6) (ly:grob-set-property! grob 'color (x11-color 'purple)))
- ((0) (ly:grob-set-property! grob 'color (x11-color 'violet)))
- )
+ (case mod-position
+ ;; Return rainbow colors
+ ((1) (x11-color 'red )) ; for C
+ ((2) (x11-color 'orange )) ; for D
+ ((3) (x11-color 'yellow )) ; for E
+ ((4) (x11-color 'green )) ; for F
+ ((5) (x11-color 'blue )) ; for G
+ ((6) (x11-color 'purple )) ; for A
+ ((0) (x11-color 'violet )) ; for B
+ )
)
)
-rainbow = {
- % Override color so it is obtained from color-notehead Scheme function
- \override NoteHead #'color = #color-notehead
-}
-
\relative c' {
- \rainbow {
- c2 c' |
- b4 g8 a b4 c |
- c,2 a' |
- g1 |
- }
+ % Arrange to obtain color from color-notehead procedure
+ \override NoteHead #'color = #color-notehead
+ c2 c' |
+ b4 g8 a b4 c |
+ c,2 a' |
+ g1 |
}
\addlyrics {
- Some -- where o -- ver the Rain -- bow, way up high,
+ Some -- where o -- ver the Rain -- bow way up high,
}
@end lilypond