]> git.donarmstrong.com Git - lilypond.git/blob - input/test/music-creation.ly
* input/: Convert ly files that still had \property. Fixes make
[lilypond.git] / input / test / music-creation.ly
1 \version "1.9.6"  %% or actually: 1.7.1 ...
2 % possible rename to scheme- something.  -gp
3 \header { texidoc = "@cindex Scheme Music Creation
4 You can create music expressions from Scheme.  The
5 mechanism for this is rather clumsy to use, so avoid it if possible. "
6 }
7
8 #(define (make-note-req p d)
9    (let* ((ml (make-music-by-name 'NoteEvent)))
10    (ly:set-mus-property! ml 'duration d)
11    (ly:set-mus-property! ml 'pitch p)
12    ml))
13
14 #(define (make-note elts)
15    (let* ((ml (make-music-by-name 'EventChord)))
16    (ly:set-mus-property! ml 'elements elts)
17    ml))
18
19 #(define (seq-music-list elts)
20    (let* ((ml (make-music-by-name 'SequentialMusic)))
21    (ly:set-mus-property! ml 'elements elts)
22    ml))
23
24
25 fooMusic = #(seq-music-list
26   (list (make-note (list (make-note-req (ly:make-pitch 1 0 0) (ly:make-duration 2 0))))
27      (make-note (list (make-note-req (ly:make-pitch 1 1 0) (ly:make-duration 2 0)))))
28      )
29      
30 \score { \fooMusic 
31 \paper { raggedright = ##t }
32 }
33