lilypond-user
[Top][All Lists]
Advanced

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

Re: Direction of tie from Completion_heads_engraver


From: Simon Albrecht
Subject: Re: Direction of tie from Completion_heads_engraver
Date: Fri, 5 Feb 2016 23:37:16 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1

On 05.02.2016 22:44, Thomas Morley wrote:
2016-02-04 23:57 GMT+01:00 Simon Albrecht <address@hidden>:
Hello,

is there any possibility to tweak direction of a tie generated via the
Completion_heads_engraver? The following tweaks both don’t work:

%%%%%%%%%%%
\version "2.19.36"
\layout {
   \context {
     \Voice
     \remove "Note_heads_engraver"
     \consists "Completion_heads_engraver"
   }
}
{
   \once\override NoteHead.direction = 1
   \once\override Tie.direction = 1
   a'\breve
}
%%%%%%%%%%

Best, Simon

Hi Simon,

see below, comment inline.

\version "2.19.36"

%% Set TieUp for certain condition(s) in layout.
%% Written as a wrapper for default-direction, i.e `ly:tie::calc-direction'
%% This is only an example, demonstrating the method.
%% Find your own set of conditions.
%% Directly setting Tie.direction in { a'\breve } while using
%% "Completion_heads_engraver" does not work, because there is no Tie to
%% tweak, before the engraver did his work
#(define (my-tie-up grob)
   (let* ((parent (ly:grob-parent grob X))
          (staff-pos (ly:grob-property parent 'staff-position))
          (dur-log (ly:grob-property parent 'duration-log))
          (stem (ly:grob-object parent 'stem))
          (stem-dir (ly:grob-property stem 'direction)))
     (ly:grob-set-property! grob 'direction
       (if (and (= staff-pos -1)
                (= dur-log 0)
                (= stem-dir 1))
                UP
                (ly:tie::calc-direction grob)))))

\layout {
   \context {
     \Voice
     \remove "Note_heads_engraver"
     \consists "Completion_heads_engraver"
     \override Tie.after-line-breaking = #my-tie-up
   }
}

{
   a'\breve
}

Thanks Harm, that’s an intelligent solution for a global setting. Indeed, I only wanted to change it for some particular instances, where tie and slur go in opposite directions (see my other post of yesterday), so an \override actually suffices, or a \once\override at the right ‘moment’…

Yours, Simon



reply via email to

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