lilypond-user
[Top][All Lists]
Advanced

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

Re: Flat slurs


From: Urs Liska
Subject: Re: Flat slurs
Date: Tue, 14 Feb 2017 10:09:39 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0

Hi Abraham,


Am 13.02.2017 um 23:49 schrieb Abraham Lee:
On Mon, Feb 13, 2017 at 1:16 PM, Urs Liska <address@hidden> wrote:
Yes, I'd definitely like to see that. How did you manage to get the seamless "thick" line?

Ok. You asked for it... ;-)

I did it by completely redefining the stencil completely using a markup path. The path has a line thickness and a shape thickness, similar to how slurs are created. See below for full code and examples (works with 2.18.2 and newer, from my tests).

Thanks for this. I hope to find the time to inspect it more closely. Interestingly (and unfortunately) there seems to be more or less nothing in it that I could simply take over since you followed a completely different approach. But there are interesting ways to interact with the internals that I will want to study to enhance my repertoire.

As said, "my" version is a special case for multi-segment slurs, and the approach to get robust flat slurs/ties would rather be writing wrapper functions for these.

As a suggestion I wrote an alternative wrapper function (very basic initial version) that you may or may not find interesting:

%%%%%%%%%

flattenedSlur =
#(define-music-function (mod)(ly:context-mod?)
   (let*
    ((props (map (lambda (m)
                   (cons (second m) (third m)))
              (ly:get-context-mods mod)))
     (start-y (assq-ref props 'start-y))
     (left-height (assq-ref props 'left-height))
     (left-width (assq-ref props 'left-height))
     (right-width (assq-ref props 'right-width))
     (right-height (assq-ref props 'right-height))
     )
    #{
      \once \override Slur.stencil =
      #(flattened-slur
        start-y left-height left-width right-width right-height)
    #}
    ))

%%%%%%%%%%

which can be used as

%%%%
\flattenedSlur \with {
  start-y = 0
  left-height = 2
  left-width = 4
  right-width = 6
  right-height = 3.5
}
%%%%

Initially this seems much more to type, but on the other hand it's much easier to read. And most importantly you can incorporate defaults (e.g. mirroring the height and width arguments if only one is given, or you could add the 'ratio to optionally override its value).

reply via email to

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