1 %% Do not edit this file; it is auto-generated from LSR http://lsr.dsi.unimi.it
2 %% This file is in the public domain.
9 In music that contains many occurrences of the same sequence of notes
10 at different pitches, the following music function may prove useful.
11 It takes a note, of which only the pitch is used. The supporting
12 Scheme functions were borrowed from the \"Tips and tricks\" document in
13 the manual for version 2.10. This example creates the rhythm used
14 throughout Mars, from Gustav Holst's The Planets.
17 doctitle = "Creating a sequence of notes on various pitches"
19 #(define (make-note-req p d)
20 (make-music 'NoteEvent
24 #(define (make-note p d)
25 (make-music 'EventChord
26 'elements (list (make-note-req p d))))
28 #(define (seq-music-list elts)
29 (make-music 'SequentialMusic
32 #(define (make-triplet elt)
33 (make-music 'TimeScaledMusic
39 rhythm = #(define-music-function (parser location note) (ly:music?)
40 "Make the rhythm in Mars (the Planets) at the given note's pitch"
41 (let* ((p (ly:music-property
42 (car (ly:music-property note 'elements))
45 (make-triplet (seq-music-list (list
46 (make-note p (ly:make-duration 3 0 2 3))
47 (make-note p (ly:make-duration 3 0 2 3))
48 (make-note p (ly:make-duration 3 0 2 3))
50 (make-note p (ly:make-duration 2 0))
51 (make-note p (ly:make-duration 2 0))
52 (make-note p (ly:make-duration 3 0))
53 (make-note p (ly:make-duration 3 0))
54 (make-note p (ly:make-duration 2 0))