lilypond-user
[Top][All Lists]
Advanced

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

Re: Colored note heads with black outline


From: Onno Zweers
Subject: Re: Colored note heads with black outline
Date: Tue, 08 Oct 2013 14:40:34 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0

Hi Pierre,

Thanks, that is exactly the effect I had in mind! Looks great!

One question though. I intend to apply this effect to many different lilypond scores. Currently I include a stylesheet.ly from all my Lilypond files to produce the colors. It would be great if I could just add some code to my stylesheet to get this outline effect, instead of overriding individual note heads. Would that be possible?

Kind regards
Onno

op 05-10-13 11:48, Pierre Perol-Schneider schreef:
Hi Onno,
There is no specific function for what you're looking for.
Here's a little trick which is far from perfect but make the job :

\version " 2.16.2" % works also for v2.17

nhSO = {

\once \override NoteHead #'stencil = #ly:text-interface::print

\once \override NoteHead #'text = \markup {

\combine

\translate-scaled #'(0.2 . 0)

\magnify # 0.8

\musicglyph #"noteheads.s0"

\combine

\musicglyph #"noteheads.s0"

\translate-scaled #'(0.08 . 0)

\scale #'(1.03 . 1)

\magnify # 0.9 \with-color #yellow

\musicglyph #"noteheads.s0"

}

}

nhSI = {

\once \override NoteHead #'layer = #2 % this line is not necessary for v2.17

\once \override NoteHead #'stencil = #ly:text-interface::print

\once \override NoteHead #'text = \markup {

\combine

\translate-scaled #'(0.11 . -0.01)

\scale #'(1 . 0.82)

\rotate #'7

\magnify # 0.85

\musicglyph #"noteheads.s1"

\combine

\musicglyph #"noteheads.s1"

\translate-scaled #'(0.07 . 0)

\scale #'(1.02 . 0.98)

\rotate #'2

\magnify # 0.9 \with-color #yellow

\musicglyph #"noteheads.s1"

}

}

nhSII = {

\once \override NoteHead #'stencil = #ly:text-interface::print

\once \override NoteHead #'text = \markup {

\combine

\musicglyph #"noteheads.s2"

\translate-scaled #'(0.07 . 0.01)

\scale #'(1.01 . 0.98)

\rotate #'2

\magnify # 0.9 \with-color #yellow

\musicglyph #"noteheads.s2"

}

}


\relative a'

{

\nhSO a1 \nhSI a2 \nhSII a4 \nhSII a8 \nhSII a16 \nhSII a32 \nhSII a64

}


Cheers,

Pierre



reply via email to

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