lilypond-user
[Top][All Lists]
Advanced

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

Re: Default length of laissezvibrer ties


From: Thomas Morley
Subject: Re: Default length of laissezvibrer ties
Date: Sun, 11 Mar 2012 19:35:20 +0100

Hi Nick,

2012/3/9 Nick Payne <address@hidden>:

> Thanks. I gave it a try. The one shortcoming I've found is that the ends of
> LV ties on a chord containing a second no longer align.

That's because "factor" is used in a multiplication. An easy fix would
be to change that to an addition. But now a new problem arises: If you
use customised staff-sizes the length isn't scaled accurate. For
smaller staffs the LaissezVibrerTie should be still smaller and for
greater staffs still greater.
Currently I don't know how to make it better.

\version "2.14.2"

#(define adding 1.5)

#(define (enlarged-extent-laissez-vibrer::print grob)
  (let* ((stil (laissez-vibrer::print grob))
         (stil-ext (ly:stencil-extent stil X))
         (stil-length (interval-length stil-ext))
         (new-stil-length (+ stil-length adding))
         (scale-factor (/ new-stil-length stil-length))
         (new-stil (ly:stencil-scale stil scale-factor 1))
         (new-stil-ext (ly:stencil-extent new-stil X))
         (x-corr (- (car stil-ext) (car new-stil-ext))))
  (ly:stencil-translate-axis
     new-stil
     x-corr
     X)))

#(assoc-set! (assoc-ref all-grob-descriptions 'LaissezVibrerTie)
'stencil enlarged-extent-laissez-vibrer::print)

music = \relative c' {
        <c e g c>\laissezVibrer s s s
        <d c f,>\laissezVibrer s s s
}
\new StaffGroup
<<
\new Staff \with { fontSize = #-3
                  \override StaffSymbol #'staff-space = #(magstep -3)
                  \override StaffSymbol #'thickness = #(magstep -3) }
    \music
\new Staff
    \music
  \new Staff \with { fontSize = #3
                  \override StaffSymbol #'staff-space = #(magstep 3)
                  \override StaffSymbol #'thickness = #(magstep 3) }
    \music
>>


Cheers,
  Harm



reply via email to

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