Hallo,
die bislang vorgestellten Lösungen haben alle den Nachteil, daß sie zwar den LaisserVibrerTie verlängern, es mit ihnen aber nicht möglich ist einen einzelnen LaisserVibrerTie zusätzlich anzusprechen, falls man dort den Anfangspunkt tweaken möchte.
Außerdem wird meistens 'extra-offset benutzt, was man tunlichst vermeiden sollte.
'extra-offset sollte als last resort betrachtet werden. zu benutzen, falls wirklich alles andere versagt hat.
Ich habe mal eine Funktion geschrieben, die das (hoffentlich) ermöglicht. Sie ist allerdings noch nicht sehr breit getestet!
Um das was man tut besser beobachten zu können habe ich noch eine weitere Funktion benutzt, die die 'control-points von Bögen aller Art visualisiert.
Es gibt sicherlich noch viel Raum für Verbesserungen, aber hier ist erst mal das Ergebnis so weit.
Einige Kommentare sind im Code.
Es ist allerdings eine neuere devel-version erforderlich.
display-control-points:
\version "2.17.24"
#(define (make-cross-stencil coords)
(let* ((line-thickness 0.1)
(double-thick (* 2 line-thickness)))
(ly:stencil-add
(make-line-stencil
line-thickness
(- (car coords) double-thick)
(- (cdr coords) double-thick)
(+ (car coords) double-thick)
(+ (cdr coords) double-thick))
(make-line-stencil
line-thickness
(- (car coords) double-thick)
(+ (cdr coords) double-thick)
(+ (car coords) double-thick)
(- (cdr coords) double-thick)))))
#(define (display-control-points line)
(lambda (grob)
(let* ((grob-name (lambda (x) (assq-ref (ly:grob-property x 'meta) 'name)))
(name (grob-name grob))
(stil (cond ((or (eq? name 'Slur)
(eq? name 'PhrasingSlur))
(ly:slur::print grob))
((eq? name 'LaissezVibrerTie)
(laissez-vibrer::print grob))
((or (eq? name 'Tie)
(eq? name 'RepeatTie))
(ly:tie::print grob))))
(cps (ly:grob-property grob 'control-points))
(cross-stencils
(ly:stencil-in-color
(ly:stencil-add
;; If you want to see the first and the last control-point
;; uncomment the relevant following lines
;(make-cross-stencil (first cps))
(make-cross-stencil (second cps))
(make-cross-stencil (third cps))
;(make-cross-stencil (fourth cps))
)
1 0 0))
(line-thickness 0.1)
(half-thick (/ line-thickness 2))
(line-stencils
(if (eq? line #t)
(ly:stencil-in-color
(ly:stencil-add
(make-line-stencil
half-thick
(car (first cps))
(cdr (first cps))
(car (second cps))
(cdr (second cps)))
(make-line-stencil
half-thick
(car (second cps))
(cdr (second cps))
(car (third cps))
(cdr (third cps)))
(make-line-stencil
half-thick
(car (third cps))
(cdr (third cps))
(car (fourth cps))
(cdr (fourth cps))))
0 0.7 0.7)
empty-stencil)))
(ly:stencil-add
stil
line-stencils
cross-stencils))))
show-control-points =
#(define-music-function (parser location lines grob)
((boolean? #t) symbol?)
"
Prints the control-points of @code{Tie}, @code{Slur}, @code{PhrasingSlur},
@code{RepeatTie} or @code{LaissezVibrerTie}, if specified by @var{grob}.
Lines connecting the control-points are printed per default.
Example:
@verbatim
{
\\show-control-points Tie
c''1~ c''
}
@end verbatim
If @var{lines} is set @code{#f} the lines are omitted.
Example:
@verbatim
{
\\show-control-points ##f Tie
c''1~ c''
}
@end verbatim
"
#{
\override #grob #'stencil = #(display-control-points lines)
#})
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% EXAMPLE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%{
\relative c'' {
\show-control-points Slur
c2( d e f)
\show-control-points PhrasingSlur
c2\( d e f\)
\show-control-points Tie
e2~ e
}
%}
affect-laissez-vibrer:
\version "2.17.24"
\include "display-control-points-02.ly"
affect-LaissezVibrerTies =
#(define-music-function (parser location x-start amount)
((list? (circular-list #f)) number?)
"
Extends @code{LaissezVibrerTie}s by @var{amount}.
Example:
@verbatim
{
\\affect-LaissezVibrerTies #2
<fis' cis'' a''>2\\laissezVibrer
}
@end verbatim
If @var{x-start} is specified, the start of a single @code{LaissezVibrerTie}
may be tweaked. The numeric value of this element of @var{x-start} determines
the amount of the offset.
@code{LaissezVibrerTie}s which should not be tweaked are to be specified with
@code{#f}
Example:
@verbatim
{
\\affect-LaissezVibrerTies #'(#f 1 #f) #2
<fis' cis'' a''>2\\laissezVibrer
}
@end verbatim
"
#{
\once
\override LaissezVibrerTieColumn #'before-line-breaking =
#(lambda (grob)
(let* ((ties (ly:grob-array->list (ly:grob-object grob 'ties)))
(c-ps
(map
(lambda (tie) (ly:grob-property tie 'control-points))
ties))
(directions
(map
(lambda (tie) (ly:grob-property tie 'direction))
ties))
(first-cps
(map
(lambda (c-p) (first c-p))
c-ps))
(second-cps
(map
(lambda (c-p) (second c-p))
c-ps))
(third-cps
(map
(lambda (c-p) (third c-p))
c-ps))
(fourth-cps
(map
(lambda (c-p) (fourth c-p))
c-ps))
(new-first-cps
(for-each
(lambda (first-cp x)
(if (number? x)
(set-car! first-cp (+ (car first-cp) x))))
first-cps x-start))
;; TODO:
;; Several hardcoded values following here.
;; Find better dependencies!!
(new-second-cps
(for-each
(lambda (second-cp x dir)
(let ((val (if (number? x) x 0.4)))
(set-car!
second-cp
(+ (car second-cp) (* val 1.2)))
(set-cdr!
second-cp
(+ (cdr second-cp) (min (* dir (/ amount 10)) 0.3)))))
second-cps x-start directions))
(new-third-cps
(for-each
(lambda (third-cp x dir)
(let ((val (if (number? x) 0.2 0.4)))
(set-car!
third-cp
(+ (car third-cp) (- amount val)))
(set-cdr!
third-cp
(+ (cdr third-cp) (min (* dir (/ amount 10)) 0.3)))))
third-cps x-start directions))
(new-fourth-cps
(for-each
(lambda (fourth-cp)
(set-car! fourth-cp (+ (car fourth-cp) amount)))
fourth-cps)))
(for-each
(lambda (tie first-cp second-cp third-cp fourth-cp)
(ly:grob-set-property! tie 'control-points
(list first-cp second-cp third-cp fourth-cp)))
ties first-cps second-cps third-cps fourth-cps)))
#})
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% EXAMPLE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paper {
ragged-right = ##f
line-width = 140
}
annotations = {
\override TextScript #'font-size = #-3
s2_Original
s^\markup \override #'(baseline-skip . 1.5)
\column {
"extend all" "LaissezVibrerTies"
}
s1
s_\markup \override #'(baseline-skip . 1.5)
\column {
"extend all" "LaissezVibrerTies," "tweak the middle LVT"
}
s^"with a single note"
s^"normal Ties"
}
mus = {
<fis' cis'' a''>2\laissezVibrer
\affect-LaissezVibrerTies #2
<fis' cis'' a''>2\laissezVibrer
r1
\affect-LaissezVibrerTies #'(#f 1 #f) #2
<fis' cis'' a''>2\laissezVibrer
r2
\affect-LaissezVibrerTies #10
c''1\laissezVibrer
<fis' cis'' a''>2~
<fis' cis'' a''>2
}
<<
\new Staff <<
\mus
\annotations
>>
\new Staff
\with {
\show-control-points LaissezVibrerTie
\show-control-points Tie
instrumentName =
\markup \fontsize #-2
\center-column {
"The same," "displaying" "'control-points "
}
}
\mus
>>
Dasselbe mit Bild auch im Anhang.
Wenn Fragen auftauchen, bitte melden.
HTH,
Harm