--- /dev/null
+\header {
+ texidoc = "When broken, glissandi can span multiple lines."
+
+}
+\version "2.15.0"
+\paper {
+ ragged-right = ##t
+}
+
+\relative c'' {
+ \override Glissando #'breakable = ##t
+ \override Glissando #'after-line-breaking = ##t
+ d1\glissando
+ \break s1
+ \break s1
+ \break s1
+ c,1^\ff\trill
+}
while (flip (&d) != LEFT);
Grob *my_common_y = common_y[LEFT]->common_refpoint (common_y[RIGHT], Y_AXIS);
- do
- span_points[d][Y_AXIS] += common_y[d]->relative_coordinate (my_common_y, Y_AXIS);
- while (flip (&d) != LEFT);
+ bool simple_y = to_boolean (me->get_property ("simple-Y")) && !to_boolean (me->get_property ("cross-staff"));
+
+ if (!simple_y)
+ {
+ do
+ span_points[d][Y_AXIS] += common_y[d]->relative_coordinate (my_common_y, Y_AXIS);
+ while (flip (&d) != LEFT);
+ }
Interval normalized_endpoints = robust_scm2interval (me->get_property ("normalized-endpoints"), Interval (0, 1));
Real y_length = span_points[RIGHT][Y_AXIS] - span_points[LEFT][Y_AXIS];
}
line.translate (Offset (-me->relative_coordinate (commonx, X_AXIS),
- -me->relative_coordinate (my_common_y, Y_AXIS)));
+ simple_y ? 0.0 : -me->relative_coordinate (my_common_y, Y_AXIS)));
return line.smobbed_copy ();
"left-bound-info "
"note-columns "
"right-bound-info "
+ "simple-Y "
"thickness "
"to-barline "
);
(side-relative-direction ,ly:dir? "Multiply direction of
@code{direction-source} with this to get the direction of this
object.")
+ (simple-Y ,boolean? "Should the Y placement of a spanner
+disregard changes in system heights?")
(size ,number? "Size of object, relative to standard size.")
(skyline-horizontal-padding ,number? "For determining the
vertical distance between two staves, it is possible to have a
(Glissando
. (
(after-line-breaking . ,ly:spanner::kill-zero-spanned-time)
+ (before-line-breaking . ,glissando::before-line-breaking)
(bound-details . ((right . ((attach-dir . ,CENTER)
(padding . 1.5)
))
(left-bound-info . ,ly:line-spanner::calc-left-bound-info)
(normalized-endpoints . ,ly:spanner::calc-normalized-endpoints)
(right-bound-info . ,ly:line-spanner::calc-right-bound-info)
+ (simple-Y . #t)
(stencil . ,ly:line-spanner::print)
(style . line)
(X-extent . #f)
(ly:grob-property grob 'dot-placement-list))))
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; glissando
+
+(define-public (glissando::before-line-breaking grob)
+ "Establishes the Y terminus points of the glissando based on the pre-broken
+positions of its left and right bounds."
+ (let ((bound-details (ly:grob-property grob 'bound-details))
+ (extra-dy (ly:grob-property grob 'extra-dy 0.0)))
+
+ (for-each (lambda (dir-sym)
+ (let* ((details (assoc-get dir-sym bound-details))
+ (dir (if (eq? dir-sym 'left) LEFT RIGHT))
+ (bound (ly:spanner-bound grob dir))
+ (common-y (ly:grob-common-refpoint grob bound Y))
+ (y (+ (interval-center (ly:grob-extent bound common-y Y))
+ (/ (* dir extra-dy)
+ 2))))
+ (if (not (assoc-get 'Y details))
+ (set! bound-details (assoc-set! bound-details dir-sym
+ (acons 'Y y details))))))
+ '(left right))
+
+ (set! (ly:grob-property grob 'bound-details) bound-details)))
+
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; scripts