[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Accidental not changing colour

From: Evian
Subject: Accidental not changing colour
Date: Wed, 12 Jun 2013 20:36:09 +0000 (UTC)
User-agent: Loom/3.14 (

2 years ago I was provided with the following code. The idea 
was to change de colour when having an  accidental. This in the 
new version is not working. 

Can anybody help?


\version "2.16.0"
\include ""

staffViolin = \new Staff {






\version "2.16.0"

#(define (accidentals? note symbol)
(let ((p (ly:music-property note 'pitch)))
(and (ly:pitch? p)
(equal? (ly:pitch-alteration p) symbol))))

coloraccidentals = #(define-music-function (parser location music) (ly:music?)
 (lambda (event)
   (if (eq? 'EventChord (ly:music-property event 'name))
       (map (lambda (note)
              (if (accidentals? note SHARP)
                  (ly:music-set-property! note 'tweaks (list (cons 'color 
red))) note)
              (if (accidentals? note FLAT)
                  (ly:music-set-property! note 'tweaks (list (cons 'color 
cyan))) note))
            (ly:music-property event 'elements))) event) music))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]