\version "2.12.3" % { #(use-modules (ice-9 pretty-print)) %% 2.13.5 succeeds %% 2.13.10 fails %% 2.13.20 fails space = #(define-music-function (parser location width) (number?) "Adding a gap of width @var{width} into a StaffSymbol. Only works in the middle of a Staff. SpanBars are forced. Ofcourse this will only work, if the Span_bar_engraver is present." #{ \noBreak \cadenzaOn \stopStaff \once \override Score.BarNumber #'break-visibility = #'#(#f #f #f) \once \override Staff.BarLine #'allow-span-bar = ##t \once \override TextScript #'extra-spacing-width = #'(0 . 0) \once \override TextScript #'extra-spacing-height = #'(-inf.0 . +inf.0) %% for newer versions better use: %\pnce \textLengthOn s1*1/1000000-\markup \with-dimensions #(cons 0 (if (string-cilist grob-array) (map (lambda (i) (ly:grob-array-ref grob-array i)) (iota (ly:grob-array-length grob-array)))) #(define (move-system-start style) (lambda (grob) (let* ((orig (if (ly:spanner? grob) (ly:grob-original grob) #f)) (siblings (if (ly:grob? orig) (ly:spanner-broken-into orig) '())) (padding (ly:grob-property grob 'padding 0.3)) (indent (ly:output-def-lookup $defaultpaper 'indent)) (short-indent (ly:output-def-lookup $defaultpaper 'short-indent)) (output-scale (ly:output-def-lookup (ly:grob-layout grob) 'output-scale)) (siblings-offs (if (pair? siblings) (map (lambda (sibling) (cons sibling (let* ((sys (ly:grob-system sibling)) (all-elts-array (ly:grob-object sys 'all-elements)) (all-elts-list (ly:grob-array->list all-elts-array)) (bar-lines (filter (lambda (elt) (let* ((bar-line (grob::has-interface elt 'bar-line-interface)) (details (if bar-line (ly:grob-property elt 'details '()) #f)) (new-staff? (if details (assoc-get 'new-staff details #f) #f))) (and bar-line new-staff?))) all-elts-list)) (relevant-barline-x-coord (if (pair? bar-lines) (apply max 0 (map (lambda (x) (ly:grob-relative-coordinate x sys X)) bar-lines)) #f))) relevant-barline-x-coord))) siblings) '()))) (for-each (lambda (sibling-off) (if (not (cdr sibling-off)) (ly:grob-suicide! (car sibling-off)) (begin (ly:grob-set-property! (car sibling-off) 'style style) (ly:grob-set-property! (car sibling-off) 'X-offset (+ (cdr sibling-off) (if (equal? (car sibling-off) (car siblings)) (- (/ indent output-scale)) (- (/ short-indent output-scale))) (if (eq? style 'brace) padding (- padding))))))) siblings-offs) '() ))) #(define print-certain-span-bars (lambda (grob) "Always print SpanBar at line-end and line-start, print selected span-bars mid-line as well." (if (or (member (ly:grob-property grob 'glyph-name) '("|." ".|:" ":|.")) (not (zero? (ly:item-break-dir grob)))) #t #f))) %%%%%%%%%%%%%%%%%%%%%%%%%%%% % EXAMPLE %%%%%%%%%%%%%%%%%%%%%%%%%%%% global = { \key es \major \time 12/8 } testSpaceI = { R1*12/8 %\space #15 R1*12/8 } testSpaceII = { R1*12/8 \space #15 R1*12/8 %\break %R1*12/8 %\space #15 %R1*12/8 } tenorVoice = \relative c'' { \global \testSpaceI \break \repeat volta 2 { b8 a b c b c d4. r | \once \override Score.RehearsalMark #'X-offset = #(lambda (grob) (if (string-ci> \break \testSpaceII } verseBaritonVoice = \lyricmode { ha -- ben wir ei -- nes er -- kannt größ -- te Schatz den's gibt. } verseBaritonVoiceAlt = \lyricmode { wir a -- ber hal -- ten zu -- samm': } bassVoice = \relative c { \global \testSpaceI \break \repeat volta 2 { b'8 b b a8 a a b4. b, } \space #10 \key es \major b'4. g f b, es1. \break \testSpaceII \bar "|." } verseBassVoice = \lyricmode { \repeat unfold 7 \skip 1 Ein größ -- te Schatz den's gibt. } right = \relative c' { \global \testSpaceI \break 4. \space #10 \key es \major 4. 4. 1. \break \testSpaceII \bar "|." } left = \relative c { \global \testSpaceI \break b4. f b b \space #10 \key es \major b'4. g f b, | es1. \break \testSpaceII \bar "|." } tenorVoicePart = << \new Voice \tenorVoice \new Lyrics \lyricsto "" { \verseTenorVoice } \new Lyrics \lyricsto "" { \verseTenorVoiceAlt } >> baritonVoicePart = << \new Voice \baritonVoice \new Lyrics \lyricsto "" { \verseBaritonVoice } \new Lyrics \lyricsto "" { \verseBaritonVoiceAlt } >> bassVoicePart = << \new Staff \with { \override BarLine #'allow-span-bar = #print-certain-span-bars } \new Voice { \clef bass \bassVoice } \new Lyrics \lyricsto "" { \verseBassVoice } >> #(set-global-staff-size 19) \paper { indent = 0 short-indent = 4 page-count = 1 } \score { << \new ChoirStaff \with { \override SystemStartSquare #'after-line-breaking = #(move-system-start 'bracket) } << \tenorVoicePart \baritonVoicePart \bassVoicePart >> \new PianoStaff \with { \override SystemStartSquare #'after-line-breaking = %% works only up to early 2.13.x #(move-system-start (if (string-ci> >> \layout { \context { \ChoirStaff \override SystemStartSquare #'thickness = #0.45 systemStartDelimiterHierarchy = #`(SystemStartBracket (SystemStartSquare ,@(iota 100))) } \context { \PianoStaff \override SystemStartSquare #'thickness = #0.45 systemStartDelimiterHierarchy = #`(SystemStartBrace (SystemStartSquare ,@(iota 100))) } %% adding Span_bar_engraver \context { \Score \consists "Span_bar_engraver" } } }