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 manual.
13 This example creates the rhythm used throughout Mars, from The Planets,
17 #(define (make-note-req p d)
18 (make-music 'NoteEvent
22 #(define (make-note p d)
23 (make-music 'EventChord
24 'elements (list (make-note-req p d))))
26 #(define (seq-music-list elts)
27 (make-music 'SequentialMusic
30 #(define (make-triplet elt)
31 (make-music 'TimeScaledMusic
37 rhythm = #(define-music-function (parser location note) (ly:music?)
38 "Make the rhythm in Mars (the Planets) at the given note's pitch"
39 (let* ((p (ly:music-property
40 (car (ly:music-property note 'elements))
43 (make-triplet (seq-music-list (list
44 (make-note p (ly:make-duration 3 0 2 3))
45 (make-note p (ly:make-duration 3 0 2 3))
46 (make-note p (ly:make-duration 3 0 2 3))
48 (make-note p (ly:make-duration 2 0))
49 (make-note p (ly:make-duration 2 0))
50 (make-note p (ly:make-duration 3 0))
51 (make-note p (ly:make-duration 3 0))
52 (make-note p (ly:make-duration 2 0))