Hi, On Jan 17, 2008 3:30 PM, Mats Bengtsson wrote: > Below, you can find a complicated alternative solution that adds a new > bar type with this behaviour, so you could say \bar "e|:".
Thanks for the tip, Mats. I was experimenting with custom bar lines based on Mats' example. The piece I'm working on has two alternate endings, one for a cappella performance and the other when there's an orchestra. The a cappella ending is presented first and it ends with an \bar "|.". The orchestra ending starts on the next line / system and it begins with a \bar "||". Therefore I created a special bar line: \bar "|.||" with #(define my-bar-glyph-alist'( stuff removed ("|.||" . ("|." . "||")) stuff removed )). So far so good. The problem arises with the volta bracket I'm using for marking the endings. If I use the special bar line the first volta bracket doesn't have the vertical end line. With a standard \bar "|." I get it. I guess there's no way to get it without digging deep into LP's source code. Is there? Possible feature request: If a volta bracket ends at a custom bar line, which has either "|." or ":|" as the first symbol the ending vertical line should be printed. One more thing... If I use my custom bar line and don't enter a line / system break the bar line disappears completely. -Risto %%%%%%% Start code %%%%%%%% \version "2.11.37" #(define my-bar-glyph-alist '((":|:" . (":|" . "|:")) ("||:" . ("||" . "|:")) ("dashed" . ("dashed" . '())) ("|" . ("|" . ())) ("||:" . ("||" . "|:")) ("|s" . (() . "|")) ("|:" . ("|" . "|:")) ("|.||" . ("|." . "||")) ;; my bar line ("|." . ("|." . ())) ;; hmm... should we end with a bar line here? (".|" . ("|" . ".|")) (":|" . (":|" . ())) ("||" . ("||" . ())) (".|." . (".|." . ())) ("" . ("" . "")) (":" . (":" . "")) ("." . ("." . ())) ("empty" . (() . ())) ("brace" . (() . "brace")) ("bracket" . (() . "bracket")) )) #(define (index-cell cell dir) (if (equal? dir 1) (cdr cell) (car cell))) #(define (bar-line::my-calc-glyph-name grob) (let* ( (glyph (ly:grob-property grob 'glyph)) (dir (ly:item-break-dir grob)) (result (assoc glyph my-bar-glyph-alist)) (glyph-name (if (= dir CENTER) glyph (if (and result (string? (index-cell (cdr result) dir))) (index-cell (cdr result) dir) #f))) ) glyph-name)) #(define-public (bar-line::my-calc-break-visibility grob) (let* ((glyph (ly:grob-property grob 'glyph)) (result (assoc glyph my-bar-glyph-alist))) (if result (vector (string? (cadr result)) #t (string? (cddr result))) #(#f #f #f)))) \paper { ragged-right = ##t indent = #(* mm 0) } { \override Score.VoltaBracket #'font-encoding = #'latin1 \override Score.VoltaBracket #'font-family = #'roman \override Score.VoltaBracket #'font-series = #'bold c'1 \set Score.repeatCommands = #'((volta "a capp." )) c' \bar "|.||" \break \set Score.repeatCommands = #'((volta #f)) \set Score.repeatCommands = #'((volta "with orchestra" )) c' c' \set Score.repeatCommands = #'((volta #f)) \bar "|." } \layout { \context { \Score \override BarLine #'glyph-name = #bar-line::my-calc-glyph-name \override BarLine #'break-visibility = #bar-line::my-calc-break-visibility } } %%%%%%%%%% END %%%%%%%%%%
<<attachment: custom_barline.png>>
_______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user