]> git.donarmstrong.com Git - lilypond.git/blob - input/test/music-creation.ly
(construct-chord): process transposition
[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 create music expressions from Scheme.  The
6 mechanism for this is rather clumsy to use, so avoid it if possible. "
7 }
8
9 #(define (make-note-req p d)
10    (let* ((ml (make-music-by-name 'NoteEvent)))
11    (ly:music-set-property! ml 'duration d)
12    (ly:music-set-property! ml 'pitch p)
13    ml))
14
15 #(define (make-note elts)
16    (let* ((ml (make-music-by-name 'EventChord)))
17    (ly:music-set-property! ml 'elements elts)
18    ml))
19
20 #(define (seq-music-list elts)
21    (let* ((ml (make-music-by-name 'SequentialMusic)))
22    (ly:music-set-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 \paper { raggedright = ##t }
33 }
34