lilypond-user
[Top][All Lists]
Advanced

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

Re: Changing MulitMeasureRest.stencil to a squiggle


From: David Nalesnik
Subject: Re: Changing MulitMeasureRest.stencil to a squiggle
Date: Tue, 6 Sep 2016 15:50:35 -0500

Hi Harm,

On Tue, Sep 6, 2016 at 2:01 PM, Thomas Morley <address@hidden> wrote:
> 2016-09-06 19:41 GMT+02:00 David Nalesnik <address@hidden>:
>> On Tue, Sep 6, 2016 at 11:07 AM, Marc Hohl <address@hidden> wrote:
>>> Am 06.09.2016 um 16:09 schrieb David Nalesnik:
>>
>>>> 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).
>>>
>>>
>>> I found out that the aplitude may be controlled by
>>>
>>> \override Staff.MultiMeasureRest.zigzag-length = #1.33
>>> \override Staff.MultiMeasureRest.zigzag-width = #1.33
>>>
>>> and playing around with these values.
>>
>> Aha!
>>
>> Well, I found time to finish what I started.  See attached. I added a
>> possibility of a wavy line.
>>
>> David
>
>
> Hi David,
>
> last time I tried to override MMR's stencil was back in 2.16.0.
> I never got it to work properly: always misalignings between default
> and tweaked stencils and/or MMR-Number. This happened differently
> depending whether the MMR occured in the first line or in next lines.
> Sometimes it made a difference, if I omitted Score.BarNumber or not
> (never found out why) and some other jokes of this kind..,
> In the end I gave up.
> Though, that was 2.16.0
>
> I didn't dive into your code, but did a test.
>
> mmrDefault = {
>   \compressFullBarRests
>   R1*24
>   R1*4
>   R1*72
> }
>
> mmrZigZag = {
>   \temporary \override Staff.MultiMeasureRest #'stencil =
>     #(my-stencil make-zigzag-squiggle 2 1) % squiggle length, height
>   \compressFullBarRests
>   R1*24
>   % ignored
>   R1*4
>   \once \override Staff.MultiMeasureRest #'stencil =
>     #(my-stencil make-zigzag-squiggle 3 1)
>   R1*72
>   \revert Staff.MultiMeasureRest #'stencil
> }
>
> mmrWavy = {
>   \temporary \override Staff.MultiMeasureRest #'stencil =
>     #(my-stencil make-wavy-squiggle 2 1)
>   \compressFullBarRests
>   R1*24
>   R1*4
>   \once \override Staff.MultiMeasureRest #'stencil =
>     #(my-stencil make-wavy-squiggle 3 2)
>   R1*72
>   \revert Staff.MultiMeasureRest #'stencil
> }
>
> \new StaffGroup
> <<
>   \new Staff { \key cis \major \mmrDefault \break \mmrDefault }
>   \new Staff { \mmrZigZag \mmrZigZag }
>   \new Staff { \mmrWavy \mmrWavy }
>>>
>
> \layout {
>   indent = 0
>   ragged-right = ##f
> }
>
> The result reminds me strongly at my previous experiences.

I was hoping no one would see that the redrawn stencils were slightly longer :)

This came from drawing the line to its full extent and adding the
vertical lines to the edges, further increasing the extent of the
redrawn stencil.

Here, I shorten the "horizontal" part by the thickness of the line and
superimpose the vertical lines.

The numbers turn out (see log) -- the stencil extents of the redrawn
stencils are the same as the default values.

I have to confess that working out problems of this sort -- accounting
for line-thickness, staff-line thickness, blot diameter, the fact that
make-combined-stencil starts at (0 0), and all the rest -- drives me
absolutely out of my mind.  I really hope that I've got it right,
though I suspect that you will be able to break it in a heartbeat :(

> I'm stil not motivated to catch this ball again,

Why ever not? :)

David

P. S.  This all might be easier if the C++ were translated to Scheme.
Then there would be no need to try to match the old stencil's
dimensions, and no redundant calculations.  Looks like it wouldn't be
to hard to do, though I'm not up to it at the moment.

Attachment: multi-measure-rest-squiggle.ly
Description: Text Data


reply via email to

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