Next: , Previous: Tuplets, Up: Writing rhythms


1.2.1.3 Scaling durations

You can alter the duration of single notes, rests or chords by a fraction N/M by appending *N/M (or *N if M is 1) to the duration. This will not affect the appearance of the notes or rests produced, but the altered duration will be used in calculating the position within the measure and setting the duration in the MIDI output. Multiplying factors may be combined such as *L*M/N.

In the following example, the first three notes take up exactly two beats, but no triplet bracket is printed.

     
     \time 2/4
     % Alter durations to triplets
     a4*2/3 gis4*2/3 a4*2/3
     % Normal durations
     a4 a4
     % Double the duration of chord
     <a d>4*2
     % Duration of quarter, appears like sixteenth
     b16*4 c4

[image of music]

The duration of skip or spacing notes may also be modified by a multiplier. This is useful for skipping many measures, e.g., s1*23.

Longer stretches of music may be compressed by a fraction in the same way, as if every note, chord or rest had the fraction as a multiplier. This leaves the appearance of the music unchanged but the internal duration of the notes will be multiplied by the fraction num/den. The spaces around the dot are required. Here is an example showing how music can be compressed and expanded:

     
     \time 2/4
     % Normal durations
     <c a>4 c8 a
     % Scale music by *2/3
     \scaleDurations #'(2 . 3) {
       <c a f>4. c8 a f
     }
     % Scale music by *2
     \scaleDurations #'(2 . 1) {
       <c' a>4 c8 b
     }

[image of music]

One application of this command is in polymetric notation, see Polymetric notation.

See also

Notation Reference: Tuplets, Invisible rests, Polymetric notation.

Snippets: Rhythms.

This page is for LilyPond-2.11.58 (development-branch).

Report errors to http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs.

Your suggestions for the documentation are welcome.

Other languages: français, español, deutsch.