\version "2.14.2" #(define n-list '() ) %{ pitch-to-color modified: print black and generate messages %} #(define (pitch-to-color pitch) (let* (( nn (ly:pitch-semitones pitch)) ( m '(0 0 0 ) )) (set! note-i (1+ note-i)) (set! n-list (cons nn n-list )) (if (>= note-i count-notes) (begin (set! note-i 0 ) (ly:message "Notes: ~a \n" (reverse n-list )) (set! n-list '() ) )) m )) #(define (color-notehead grob) (pitch-to-color (ly:event-property (event-cause grob) 'pitch))) %{Test piece. %} \layout { \context { \Voice \override NoteHead #'color = #color-notehead }} piece = \relative c' { c4 d e f g a b c,, d f g a } #(define count-notes 12) #(define note-i 0) \score { \piece} \score { \piece}