Thanks again. One final (I hope) question. When the duration of the barre 
causes it to start on one stave and finish on another, that presents two 
problems in the output:

1. On the stave where the barre continues, it starts slightly to the left of 
the very beginning of the stave rather than above the first note on the stave.

2. The bar number at the start of the stave gets moved from its normal position 
to above the line for the barre.

Is there any way around this short of generating the output, seeing whether any 
barres are split across staves, and then manually stopping and starting them to 
avoid this behaviour.

Nick

-----Original Message-----
From: Neil Puttock [mailto:[EMAIL PROTECTED] 
Hi Nick,

2008/9/19 Nick Payne <[EMAIL PROTECTED]>:
> Neil
>
> Thanks. I used your function definition in a short test and it worked just as 
> I wanted. Strangely, however, when I used the function identically in the 
> piece I'm engraving, I just get a dashed line where I should see the barring 
> indication, and I can't see why it works with one and not the other.
>
> Foo.ly and foo.png - test and output as expected.
> Barrios.ly and barrios.png - shows only a dashed line over bar 7 where the 
> barre indication should be.

Since the overrides in \barre use \once, it must be placed directly
before the note where the text span starts, otherwise all the settings
are forgotten:

\barre #0.0 "CIV" #'(0 . 0) <d-4>->\startTextSpan
#(set-default-paper-size "a4")

\version "2.11.58"

barre = #(define-music-function (parser location padding text shorten) (number? string? pair?) #{
  \once \override TextSpanner #'style = #'line
  \once \override TextSpanner #'font-shape = #'upright
  %draw a bracket edge on RHS
  \once \override TextSpanner #'bound-details #'right #'text = \markup { \draw-line #'(0 . -1) }
  \once \override TextSpanner #'padding = $padding
  \once \override TextSpanner #'bound-details #'left #'text = $text
  % set alignment of line with reference to left text
  \once \override TextSpanner #'bound-details #'left #'stencil-align-dir-y = #CENTER
  \once \override TextSpanner #'bound-details #'left #'padding = #(car $shorten)
  \once \override TextSpanner #'bound-details #'right #'padding = #(cdr $shorten)
  % optional overrides to remove text and bracket edge at line breaks
  \once \override TextSpanner #'bound-details #'left-broken #'text = ##f
  \once \override TextSpanner #'bound-details #'right-broken #'text = ##f
#})

\score {
	\relative c'' {
		\textSpannerUp
		c,8 d e f g a b c
		c, d e f g a b c
		\barre #0 "CIV" #'(0 . 0)
		c,\startTextSpan d e f g a b c
		c, d e f g a b c
		c, d e f g a b c\stopTextSpan
		c, d e f g a b c
	}
}

<<attachment: foo.png>>

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to