3 #(define last-grob-action '())
11 #(define file-line-blacklist
14 #(define file-line-whitelist
17 #(define graph (make-graph "graph.dot"))
19 % an event is relevant if
20 % (it is on some whitelist or all whitelists are empty)
22 % (it isn't on any blacklist)
24 #(define (relevant? grob file line prop)
25 (let ((file-line `(,file . ,line)))
28 (= 0 (length file-line-whitelist) (length sym-whitelist))
29 (memq prop sym-whitelist)
30 (member file-line file-line-whitelist))
32 (not (memq prop sym-blacklist))
33 (not (member file-line file-line-blacklist))))))
35 #(define (grob-mod grob file line func prop val)
36 (let* ((prev (assv grob last-grob-action))
37 (val-str0 (format "~a" val))
38 (val-str (string-take val-str0 (min 50 (string-length val-str0))))
39 (label (format "~a\\n~a:~a\\n~a <- ~a" grob file line prop val-str))
40 (node-id (make-node graph label file)))
41 (if (relevant? grob file line prop)
44 (add-edge graph (cdr prev) node-id))
45 (set! last-grob-action (assv-set! last-grob-action grob node-id))))))
47 #(define (grob-create grob file line func)
48 (let* ((label (format "~a\\n~a:~a" grob file line))
49 (node-id (make-node graph label file)))
50 (set! last-grob-action (assv-set! last-grob-action grob node-num))))
52 #(ly:set-grob-modification-callback grob-mod)
53 #(ly:set-grob-creation-callback grob-create)