2018-04-22 5:24 GMT+02:00 Andrew Bernard <andrew.bern...@gmail.com>:
> How can you make a repeatTie longer? The default is a little too crimped for
> my style.
>
> Andrew



Hi Andrew,

Malte already pointed to the LSR-snippet and Auke posted some
functions which adapted the LSR-snippet.
Though, for me this snippet always had some disadvantages. Using
X-extent '(0 . 0) and applying some extra-offset results in
Repeat/LaissezVibrerTies which may collide/overlap other things. Ok,
this is mostly on pupose, but there's no method to get reasonable
results, if overlapping is undesired.

So I tried to do it different, using make-tie-stencil and create a new stencil.
This stencil will not overlap other stuff. Though, it could be reached
by applying an appropriate X-extent-override.

Advantages:
- only one definition for LaissezVibrerTie and RepeatTie
- reacts on minimum-length

Disadvantages:
- height-limit, ratio and angularity are hard-coded in
make-tie-stencil, so it behaves a little different than the default.
- there's is a flaw in make-tie-stencil: even if I made height-limit
settable it had no impact. I think there's a bug in it (will report
soon).
- even correcting the bug will not make the behaviour of those ties
equal to there defaults. I'm currently not able to find the reason.
I'll continue research later.


Anyway here the code so far:

\version "2.19.81"

#(define semi-tie-stencil
  (lambda (grob)
    (let* ((cps (ly:grob-property grob 'control-points))
           (first-cp (car cps))
           (last-cp (last cps))
           (actual-length
             (- (car last-cp) (car first-cp)))
           (thickness (ly:grob-property grob 'thickness 1))
           (orientation (ly:grob-property grob 'direction -1))
           (minimum-length
             (ly:grob-property grob 'minimum-length
               (+ (car first-cp) actual-length)))
           (head-dir (ly:grob-property grob 'head-direction))
           (used-length (max actual-length minimum-length))
           (line-thick (ly:staff-symbol-line-thickness grob)))
      (make-tie-stencil
        (if (positive? head-dir)
            (cons (- used-length) (cdr first-cp))
            first-cp)
        (if (positive? head-dir)
            last-cp
            (cons used-length (cdr first-cp)))
        (* thickness line-thick)
        orientation))))

\layout {
  \override LaissezVibrerTie.stencil = #semi-tie-stencil
  \override RepeatTie.stencil = #semi-tie-stencil

  %\override LaissezVibrerTie.X-extent = #'(0 . 0)
  %\override RepeatTie.X-extent = #'(0 . 0)
}

{
  %% default
  <c' e' >1\laissezVibrer

  \once \override LaissezVibrerTie.minimum-length = 10
  <c' e' >1\laissezVibrer
  <c'-\tweak minimum-length 10\laissezVibrer e'\laissezVibrer >1
  <c'\laissezVibrer e'-\tweak minimum-length 10\laissezVibrer >1
  <c'-\tweak minimum-length 10\laissezVibrer e' >1
  <c' e'-\tweak minimum-length 10 ^\laissezVibrer >1
}

{
  %% default
  <c' e' >1\repeatTie

  \once \override RepeatTie.minimum-length = 10
  <c' e' >1\repeatTie
%% the following works only for 2.21.0
%% 2.19.81 will not print any RepeatTie
  <c'-\tweak minimum-length 10\repeatTie e'^\repeatTie >1
  <c'\repeatTie e'-\tweak minimum-length 10^\repeatTie >1
  <c'-\tweak minimum-length 10\repeatTie e' >1
  <c' e'-\tweak minimum-length 10 ^\repeatTie >1
}

Cheers,
  Harm

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to