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