lilypond-user
[Top][All Lists]
Advanced

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

Re: Accidental Notes in different colour


From: Jay Vara
Subject: Re: Accidental Notes in different colour
Date: Thu, 30 Oct 2014 12:11:20 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

>I am not top-posting

Paul,

Thanks. I was able to use the snippets you pointed out to get it almost 
working.

Check out this snippet:
> 
> Using ly:grob-object to access grobs with \tweak
> http://lsr.di.unimi.it/LSR/Item?id=621
> 


This is the program I wrote. It does colour the note heads for 
accidental notes, but for some reason fails to colour the stem or the 
accidental sign.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\version "2.18.2"

#(define (color-acci notehead)
   (let* ((accidental(ly:grob-object notehead 'accidental-grob))
         (notecolumn  (ly:grob-parent notehead X))
         (stem (ly:grob-object notecolumn 'stem)))
     (format #t "head = ~a  acci = ~a stem = ~a ?? ~%" notehead 
accidental stem)
     
     (if (ly:grob? accidental) 
         (ly:grob-set-property! stem 'color red))
     
     (if (ly:grob? accidental) 
         (ly:grob-set-property! accidental 'color red))
     
     (if (ly:grob? accidental)  red black)))


\score {
  \new Staff \relative c' {
    \override NoteHead.color = #color-acci
    c4 b d dis ees f g aes
  }
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%





reply via email to

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