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.
8 In music that contains many occurrences of the same sequence of notes
9 at different pitches, you can use the following music function. It
10 takes a note, of which the pitch is used. The supporting Scheme
11 functions were borrowed from the \"Tips and tricks\" document in the
12 manual for version 2.10. This example creates the rhythm used
13 throughout Mars, from Gustav Holst's The Planets.
16 #(define (make-note-req p d)
17 (make-music 'NoteEvent
21 #(define (make-note p d)
22 (make-music 'EventChord
23 'elements (list (make-note-req p d))))
25 #(define (seq-music-list elts)
26 (make-music 'SequentialMusic
29 #(define (make-triplet elt)
30 (make-music 'TimeScaledMusic
36 rhythm = #(define-music-function (parser location note) (ly:music?)
37 "Make the rhythm in Mars (the Planets) at the given note's pitch"
38 (let* ((p (ly:music-property
39 (car (ly:music-property note 'elements))
42 (make-triplet (seq-music-list (list
43 (make-note p (ly:make-duration 3 0 2 3))
44 (make-note p (ly:make-duration 3 0 2 3))
45 (make-note p (ly:make-duration 3 0 2 3))
47 (make-note p (ly:make-duration 2 0))
48 (make-note p (ly:make-duration 2 0))
49 (make-note p (ly:make-duration 3 0))
50 (make-note p (ly:make-duration 3 0))
51 (make-note p (ly:make-duration 2 0))