lilypond-user
[Top][All Lists]
Advanced

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

Re: Variable substitution in postscript?


From: Eric Knapp
Subject: Re: Variable substitution in postscript?
Date: Mon, 25 May 2009 22:42:08 -0500

Thanks, Mark. This works and will really help with the custom things I
want to do.

-Eric

On Monday, May 25, 2009, Mark Polesky <address@hidden> wrote:
>
> Eric Knapp wrote:
>> What I want to do is have the value of the "thickness" variable
>> replace the "0.25" in the postscript.
>
> Eric,
> the "ly:format" function
> http://lilypond.org/doc/v2.13/Documentation/user/lilypond-internals/Scheme-functions.html#index-ly_003aformat
> is loosely based on the guile "format" function:
> http://www.gnu.org/software/guile/manual/html_node/Formatted-Output.html
> but it is not the same thing.
> __________________
>
> \version "2.13.0"
> \include "english.ly"
>
> 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 #(ly:format "
>       -1.65 0 translate
>       ~4f setlinewidth
>       0.75 -0.4 0.8 0.8 rectstroke" $thickness)
>   }
> $note
> #})
>
> {
> \sample #0.25 bf2
> }
> _________________
>
>
>> 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.
>
> This is a user question. IIUC, -user is for finding a way to make
> something work and -devel is for finding a way to change the
> program. If you're ever unsure post to -user first.
>
> HTH
> - Mark
>
>
>
>




reply via email to

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