]> git.donarmstrong.com Git - lilypond.git/blob - input/test/duration-check.ly
902a1310e6e7b0f261194990d2f565d86020525d
[lilypond.git] / input / test / duration-check.ly
1 #(define (duration-check music)
2   "Check all rest durations in MUSIC"
3
4   (let* ((name (ly-music-name music))
5          (elts (ly-get-mus-property music 'elements))
6          (e (ly-get-mus-property music 'element))
7          (duration (ly-get-mus-property music 'duration)))
8
9     (if (not (equal? '() duration))
10         (begin
11           (write "duration: " (current-error-port))
12           (write duration (current-error-port))
13           (newline (current-error-port)))
14         
15         (if (equal? name "Rest_req")
16             (begin
17               (write "URG" (current-error-port))
18               (write name (current-error-port))
19               (write music (current-error-port))
20               (newline (current-error-port))
21               ;;(scm-error 'system-error #f "urg" #f #f)))
22               (error "boo")
23               )))
24
25     (if (pair? elts)
26         (map duration-check elts))
27     
28     (if (music? e)
29           (duration-check e)))
30
31   music)
32
33 \score {
34   \apply #duration-check
35   <
36       \notes\relative c'' {
37           a b8 c16 <d e4.>
38       }
39       \notes\relative c'' {
40           a b8 c16 d a2 r
41       }
42   >
43 }