]> git.donarmstrong.com Git - lilypond.git/blob - input/test/music-creation.ly
update texidocs.
[lilypond.git] / input / test / music-creation.ly
1 \version "2.1.26"
2
3 % possible rename to scheme- something.  -gp
4 \header { texidoc = "@cindex Scheme Music Creation
5 You can engrave music using just Scheme expressions. Although those 
6 expressions reflect the inner mechanism of LilyPond, they are rather 
7 clumsy to use, so avoid them, if possible. "
8 }
9
10 #(define (make-note-req p d)
11    (let* ((ml (make-music-by-name 'NoteEvent)))
12    (ly:music-set-property! ml 'duration d)
13    (ly:music-set-property! ml 'pitch p)
14    ml))
15
16 #(define (make-note elts)
17    (let* ((ml (make-music-by-name 'EventChord)))
18    (ly:music-set-property! ml 'elements elts)
19    ml))
20
21 #(define (seq-music-list elts)
22    (let* ((ml (make-music-by-name 'SequentialMusic)))
23    (ly:music-set-property! ml 'elements elts)
24    ml))
25
26
27 fooMusic = #(seq-music-list
28   (list (make-note (list (make-note-req (ly:make-pitch 1 0 0) (ly:make-duration 2 0))))
29      (make-note (list (make-note-req (ly:make-pitch 1 1 0) (ly:make-duration 2 0)))))
30      )
31      
32 \score { \fooMusic 
33 \paper { raggedright = ##t }
34 }
35