\version "2.19.30" #(define-event-class 'accordion-push-span-event 'span-event) #(define ly:accordion-push-spanner::print (lambda (grob) (let* ((bound-L (ly:spanner-bound grob LEFT)) (bound-R (ly:spanner-bound grob RIGHT)) ;; (common-X (ly:grob-system grob)) probably does the same ;; as the next three lines... (common-X (ly:grob-common-refpoint grob bound-L X)) (common-X (ly:grob-common-refpoint bound-L bound-R X)) (common-X (ly:grob-common-refpoint grob common-X X)) (extent-L (ly:grob-robust-relative-extent bound-L common-X X)) (left-X (if (= 1 (ly:item-break-dir bound-L)) (cdr extent-L) (car extent-L))) (right-X (cdr (ly:grob-robust-relative-extent bound-R common-X X))) (off (ly:grob-relative-coordinate grob common-X X)) (th (ly:grob-property grob 'thickness 1)) (stil (ly:round-filled-box (cons left-X right-X) (cons 0 th) 0.0))) (ly:stencil-translate-axis stil (- off) X)))) #(define (add-grob-definition grob-name grob-entry) (let* ((meta-entry (assoc-get 'meta grob-entry)) (class (assoc-get 'class meta-entry)) (ifaces-entry (assoc-get 'interfaces meta-entry))) (set-object-property! grob-name 'translation-type? ly:grob-properties?) (set-object-property! grob-name 'is-grob? #t) (set! ifaces-entry (append (case class ((Item) '(item-interface)) ((Spanner) '(spanner-interface)) ((Paper_column) '((item-interface paper-column-interface))) ((System) '((system-interface spanner-interface))) (else '(unknown-interface))) ifaces-entry)) (set! ifaces-entry (uniq-list (sort ifaces-entry symbol> \new PianoStaff << \new Staff { \override Staff.AccordionPushSpanner.direction = #DOWN f'1 f'1 \redPush { f'1 f'1 f'1_4_\markup {"f"} } f'1 f'1 \repeat volta 2 { \startPush f'1\f f'1 f'4 \startPull f'2. f'4 \startPush f'2. f'1 \break f'1 f'1 \startPull } } \new Lyrics \lyricmode { foo1 foo foo foo } \new Staff { \clef bass f1 f1 f1 f1 f1 f1 f1 f1 f1 f4 f2. f4 f2. f1 f1 f4 f2. } >> \layout { ragged-last = ##t \context { \Global \grobdescriptions #all-grob-descriptions } \context { \Staff \consists \accordionPushSpannerEngraver } }