]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/creating-a-sequence-of-notes-on-various-pitches.ly
9d02ca574437c4467ceaf76cb60729b2c58b163a
[lilypond.git] / Documentation / snippets / creating-a-sequence-of-notes-on-various-pitches.ly
1 % DO NOT EDIT this file manually; it is automatically
2 % generated from Documentation/snippets/new
3 % Make any changes in Documentation/snippets/new/
4 % and then run scripts/auxiliar/makelsr.py
5 %
6 % This file is in the public domain.
7 %% Note: this file works from version 2.19.0
8 \version "2.19.22"
9
10 \header {
11   lsrtags = "pitches, real-music, really-cool, scheme-language"
12
13   texidoc = "
14 In music that contains many occurrences of the same sequence of notes
15 at different pitches, the following music function may prove useful.
16 It takes a note, of which only the pitch is used.   This example
17 creates the rhythm used throughout Mars, from Gustav Holst's The
18 Planets.
19
20 "
21   doctitle = "Creating a sequence of notes on various pitches"
22 } % begin verbatim
23
24
25 rhythm =
26 #(define-music-function (p) (ly:pitch?)
27    "Make the rhythm in Mars (the Planets) at the given pitch"
28   #{ \tuplet 3/2 { $p 8 8 8 } 4 4 8 8 4 #})
29
30 \new Staff {
31   \time 5/4
32   \rhythm c'
33   \rhythm c''
34   \rhythm g
35 }