Is there is a way to authomatically color notes that are e.g. sharp?

This function colories in red all "sharped" notes :

%%%%%%%%%%%%%%%%%%%%%%%%%%%
#(define (is-sharped? note)
(let ((p (ly:music-property note 'pitch)))
(and (ly:pitch? p)
(equal? (ly:pitch-alteration p) SHARP))))
colorSharp = #(define-music-function (parser location music )(ly:music?) (music-map
(lambda (evt)
 (if (eq? 'EventChord (ly:music-property evt 'name))
(map (lambda (note) (if (is-sharped? note) (ly:music-set-property! note 'tweaks
      (list (list 'color 1.0 0.0 0.0)))
note)) (ly:music-property evt 'elements))) evt) music
))


music = \relative { c4 cis d e f fis g aes g f! dis e c1 }

\new Staff \colorSharp \music %%%%%%%%%%%%%%%%%%%%%
Gilles



_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to