FabricioG
FabricioG

Reputation: 3320

Custom note heads in LilyPond

I am attempting to replace the default note heads with custom graphics in Lilypond. I've read the documentation under A. 10.3 Graphic which explains how to use \markup to add graphics to a score, however I'm stuck at being able to use those to replace note heads. My question is how can I replace the default note heads for custom ones?

Upvotes: 1

Views: 760

Answers (1)

Paco
Paco

Reputation: 426

If I understand correctly, you want to make some noteheads substituted by arbitrary graphics. Assuming you already have the graphic in EPS format as sol.eps, this code uses it to change a 'g' to a picture of a sun ('sol' is Spanish for 'sun'):

cabezaSol = {
 \once \override NoteHead  #'stencil = #ly:text-interface::print
 \once \override NoteHead #'text =
   \markup {
     \general-align #Y #CENTER {
       \epsfile #X #2 #"./sol.eps"
     }
   }
 }
{ e'4 f' \cabezaSol g' }

enter image description here

Upvotes: 6

Related Questions