\version "2.19.16" #(define adjust-for-note-head (lambda (grob) (let* ((refp (ly:grob-system grob)) (bar-coord (ly:grob-relative-coordinate grob refp X)) (all (ly:grob-array->list (ly:grob-object refp 'all-elements))) (note-heads (filter (lambda (n) (eq? (assq-ref (ly:grob-property n 'meta) 'name) 'NoteColumn)) all)) (note-head-coords (map (lambda (heads) (interval-center (ly:grob-extent heads refp X))) note-heads)) (coords-to-right (filter (lambda (coord) (< bar-coord coord)) note-head-coords)) (closest-coord (if (pair? coords-to-right) (apply min (map (lambda (coord) (- coord bar-coord)) coords-to-right)) 0))) (set! (ly:grob-property grob 'extra-offset) (cons closest-coord 0))))) centerBarToNote = \override Staff.BarLine.after-line-breaking = #adjust-for-note-head centerSpanBarToNote = \override StaffGroup.SpanBar.after-line-breaking = #adjust-for-note-head { \new StaffGroup << \centerSpanBarToNote \time 2/4 \new Staff { \centerBarToNote \override Stem.stencil = #point-stencil \repeat unfold 30 { d' d' } } \new Staff { \override Stem.stencil = #point-stencil \centerBarToNote \repeat unfold 30 { d' d' } } >> } \layout { \context { \Score \override SpacingSpanner.strict-note-spacing = ##t proportionalNotationDuration = #(ly:make-moment 1/8) } \context { \Staff \remove "Time_signature_engraver" %\override BarLine.transparent = ##t } }