Andrew Bernard
2018-11-19 10:01:08 UTC
Well I have worked out one way to do this. I use an event function, and
return \startTextSpan from the event function. Previously I mistakenly
thought you could jist have tweak commands in the event function.
While not the full workup with flat hairpins with left flared ends, right
flared ends, or both ends flared, this following MWE outlines my sketch of
a solution. The point being it solves my principal query which is how to
change the text spanner properties when one starts and stops on a single
note.
If those more learned than me would care to comment, that would be great.
%====
\version "2.19.82"
% flat hairpins with flared ends.
startHpin =
#(define-event-function (arg)
(symbol?)
#{
\tweak TextSpanner.staff-padding #3
\tweak TextSpanner.style #'line
\tweak TextSpanner.thickness #1.5
\tweak TextSpanner.bound-details.left.text
\markup {
\path #0.15 #'((moveto 0 0)
(lineto -1 1)
(moveto 0 0)
(lineto -1 -1)
(closepath))
}
\tweak TextSpanner.bound-details.left.padding #2
\tweak TextSpanner.bound-details.right.padding #2
\tweak TextSpanner.bound-details.right.text
\markup {
\path #0.15 #'((moveto 0 0)
(lineto 1 1)
(moveto 0 0)
(lineto 1 -1)
(closepath))
}
\startTextSpan
#}
)
stopHpin = \stopTextSpan
{
c''2^\startHpin #'left c''\stopHpin -\startHpin #'left
c''\stopHpin c'' c''
}
%====
Andrew
return \startTextSpan from the event function. Previously I mistakenly
thought you could jist have tweak commands in the event function.
While not the full workup with flat hairpins with left flared ends, right
flared ends, or both ends flared, this following MWE outlines my sketch of
a solution. The point being it solves my principal query which is how to
change the text spanner properties when one starts and stops on a single
note.
If those more learned than me would care to comment, that would be great.
%====
\version "2.19.82"
% flat hairpins with flared ends.
startHpin =
#(define-event-function (arg)
(symbol?)
#{
\tweak TextSpanner.staff-padding #3
\tweak TextSpanner.style #'line
\tweak TextSpanner.thickness #1.5
\tweak TextSpanner.bound-details.left.text
\markup {
\path #0.15 #'((moveto 0 0)
(lineto -1 1)
(moveto 0 0)
(lineto -1 -1)
(closepath))
}
\tweak TextSpanner.bound-details.left.padding #2
\tweak TextSpanner.bound-details.right.padding #2
\tweak TextSpanner.bound-details.right.text
\markup {
\path #0.15 #'((moveto 0 0)
(lineto 1 1)
(moveto 0 0)
(lineto 1 -1)
(closepath))
}
\startTextSpan
#}
)
stopHpin = \stopTextSpan
{
c''2^\startHpin #'left c''\stopHpin -\startHpin #'left
c''\stopHpin c'' c''
}
%====
Andrew