]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/new/creating-a-sequence-of-notes-on-various-pitches.ly
Imported Upstream version 2.19.45
[lilypond.git] / Documentation / snippets / new / creating-a-sequence-of-notes-on-various-pitches.ly
1 \version "2.19.22"
2
3 \header {
4   lsrtags = "pitches, real-music, really-cool, scheme-language"
5
6   texidoc = "
7 In music that contains many occurrences of the same sequence of notes
8 at different pitches, the following music function may prove useful.
9 It takes a note, of which only the pitch is used.   This example
10 creates the rhythm used throughout Mars, from Gustav Holst's The
11 Planets.
12
13 "
14   doctitle = "Creating a sequence of notes on various pitches"
15 }
16
17 rhythm =
18 #(define-music-function (p) (ly:pitch?)
19    "Make the rhythm in Mars (the Planets) at the given pitch"
20   #{ \tuplet 3/2 { $p 8 8 8 } 4 4 8 8 4 #})
21
22 \new Staff {
23   \time 5/4
24   \rhythm c'
25   \rhythm c''
26   \rhythm g
27 }