]> git.donarmstrong.com Git - lilypond.git/blob - input/test/duration-check.ly
* ly/chord-modifiers-init.ly:
[lilypond.git] / input / test / duration-check.ly
1 \version "1.7.18"
2 % candidate for remove or regression.
3 \header {
4
5     texidoc = "Check whether all @code{duration} properties can 
6 be printed. This once helped track down an obscure memory corruption
7 bug.  "
8
9 }
10
11
12
13 #(define (duration-check music)
14   "Check all rest durations in MUSIC"
15
16   (let* ((name (ly:music-name music))
17          (elts (ly:get-mus-property music 'elements))
18          (e (ly:get-mus-property music 'element))
19          (duration (ly:get-mus-property music 'duration)))
20
21     (if (not (equal? '() duration))
22         (begin
23           (write "duration: " (current-error-port))
24           (write duration (current-error-port))
25           (newline (current-error-port)))
26         
27         (if (equal? name "Rest_req")
28             (begin
29               (write "URG" (current-error-port))
30               (write name (current-error-port))
31               (write music (current-error-port))
32               (newline (current-error-port))
33               ;;(scm-error 'system-error #f "urg" #f #f)))
34               (error "boo")
35               )))
36
37     (if (pair? elts)
38         (map duration-check elts))
39     
40     (if (ly:music? e)
41           (duration-check e)))
42
43   music)
44
45 \score {
46   \apply #duration-check
47   <
48       \notes\relative c'' {
49           a b8 c16 <<d e>>4.
50       }
51       \notes\relative c'' {
52           a b8 c16 d a2 r
53       }
54   >
55 }
56 %% new-chords-done %%