Hi, all.

I'm attempting to create some music functions that have some
postscript commands in them. Is there a way to pass an argument from
the Scheme music function into the embedded postscript? Here's a
simplified example that makes a hollow square notehead:

The function:

sample =
#(define-music-function (parser location thickness note )
  (number? ly:music?)
#{
  \once \override NoteHead  #'stencil = #ly:text-interface::print
  \once \override NoteHead #'text = \markup {
    \postscript #"
      -1.65 0 translate
      0.25 setlinewidth
      0.75 -0.4 0.8 0.8 rectstroke"
  }
 $note
#})

Usage:

\sample #0.25 bf2

What I want to do is have the value of the "thickness" variable
replace the "0.25" in the postscript. I've tried everything that I can
think of and have also looked in some postscript documentation. Is
there a way to do this? It would allow me to solve a lot of things I
want to do with Lilypond.

I'm not sure if I should post questions like this here or to the devel
forum. I did not cross-post so let me know if I should repost there.

Thanks,

-Eric


_______________________________________________
lilypond-user mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to