lilypond-user
[Top][All Lists]
Advanced

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

Editorial tie in scheme


From: MikeL
Subject: Editorial tie in scheme
Date: Fri, 1 Jun 2012 17:35:28 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

This is my first attempt at scheme hacking and I would appreciate a little help.

What I am trying to do is implement editorial ties ( a small vertical line
mid tie).  I can find the X mid point easily enough, but cannot work out how to
find the Y position (relative to currentpoint).

The second question is how best to integrate this into the user language?  The
score I am working on has many, many ties, about a quarter of the editorial.

{
\override Tie #'stencil = #(lambda(grob)
    (let* (
         (tie-stencil (ly:tie::print grob))
         (x-parent (ly:grob-parent grob X))
         (cpoints (ly:grob-property grob 'control-points))
          ; (Xpoint3-Xpoint0) / 2 + Xpoint0
           (mid-tie 
(+(car(list-ref cpoints 0))( / (- (car(list-ref cpoints 3)) (car( list-ref 
cpoints 0))) 2)))
           (ps (format #f "gsave
                           currentpoint translate
                           newpath
                           0.2 setlinewidth
                           ~s -2.3 moveto
                           0 0.5 rlineto
                           stroke
                           grestore" mid-tie))

            (tick-stencil(ly:make-stencil(list 'embedded-ps ps )
            (cons 0 1)(cons -1 -1)))
                        )

                (ly:stencil-add tie-stencil tick-stencil)
                )
        )


        g'1~g'
}


Thanks,
Mike





reply via email to

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