Hi Marc,
On Tue, Sep 6, 2016 at 7:28 AM, Marc Hohl <address@hidden> wrote:
Hi list,
I want to change the MultiMeasureRest.stencil to a squiggle as shown in the
appendices (quite roughly pasted together in GIMP).
Searching the LSR and the web does not give any informations about this
topic (the only thing I found was using the percent stencil, which is also
hardcoded in the C++ sources).
I tried to override the stencil by
\override MultiMeasureRest.stencil = #ly:line-spanner::print
but this causes errors like
"MultiMeasureRest has empty extent and non-empty stencil."
Even if you for this to work, your mockup shows a line more complex
than a squiggle.
You'd only be able to get a simple zigzag line,
without the refinement at the ends, and without control of the
"amplitude" (as if my simple example below).
Any ideas?
The easiest way to get what you want is to create a stencil callback
which uses the default stencil for dimensions of a replacement
stencil. The code below is a simple demonstration, which draws lines
like you would get with ly:line-spanner::print.
(Note that you need at least 2.19.27 for this to work.)
\version "2.19.46"
#(define my-stencil
(lambda (grob)
(let* ((default-stil (ly:multi-measure-rest::print grob))
(X-ext (ly:stencil-extent default-stil X)))
(ly:line-interface::line grob (car X-ext) 0 (cdr X-ext) 0))))