]> git.donarmstrong.com Git - lilypond.git/blob - input/test/music-creation.ly
patch::: 1.3.136.jcn3
[lilypond.git] / input / test / music-creation.ly
1 \header {
2
3  texidoc = "You can create music expressions from Scheme.  The
4  mechanism for this is rather clumsy to use, so avoid if possible.";
5
6  }
7  
8
9 #(define (make-note-req p d)
10    (let* ( (ml (ly-make-music "Note_req")) )
11    (ly-set-mus-property ml 'duration d)
12    (ly-set-mus-property ml 'pitch p)   
13    ml 
14 ))
15
16 #(define (make-note elts)
17    (let* ( (ml (ly-make-music "Request_chord")) )
18    (ly-set-mus-property ml 'elements elts)
19    ml 
20 ))
21
22 #(define (seq-music-list elts)
23    (let* ( (ml (ly-make-music "Sequential_music")) )
24    (ly-set-mus-property ml 'elements elts)
25    ml 
26 ))
27
28
29 fooMusic  = #(seq-music-list
30   (list (make-note (list (make-note-req (make-pitch 1 0 0) (make-duration 2 0))))
31      (make-note (list (make-note-req (make-pitch 1 1 0) (make-duration 2 0)))))
32      )
33      
34 \score { \fooMusic }