Hi, this is just a nonsense exercise for me to get to know LilyPond better! I can't figure out why in the following the #(rnd-col) is evaluated only once and not upon each compilation of my ly file? The first time i compile this i will get the four colors displayed:
(0.5 0.5 0) (0.5 0 1.0) (0.5 0 1.0) (0 0.5 1.0) which however doesn't change in next compilations, so that there is no color change. Can someone explain what am i missing? Thanks %% \version "2.19.83" #(define (rnd-col) (map (lambda (x) (* x 0.5)) (list (random 3) (random 3) (random 3)))) coloredAcc = #(define-music-function () () (newline) (display (rnd-col)) #{ \once \override Accidental.color = #(rnd-col) #}) \relative c'' { \coloredAcc cisis \coloredAcc cisis! \coloredAcc cisis! \coloredAcc cisis! } %% -- Amir Teymuri