[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Color of notes depending on accidentals
From: |
cuco |
Subject: |
Re: Color of notes depending on accidentals |
Date: |
Thu, 26 Feb 2009 06:27:57 -0800 (PST) |
Thanks Gilles
as I am not an expert, what is the code if I want to change the color of
note with sharps AND flats? What should I change?
Thank very much in advance!
Gilles THIBAULT wrote:
>
>
>
>
>>
>> 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
> address@hidden
> http://lists.gnu.org/mailman/listinfo/lilypond-user
>
>
--
View this message in context:
http://www.nabble.com/Color-of-notes-depending-on-accidentals-tp22199560p22225258.html
Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com.