[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to override bar line?
From: |
Erik Sandberg |
Subject: |
Re: How to override bar line? |
Date: |
Sun, 2 Oct 2005 13:04:59 +0200 |
User-agent: |
KMail/1.8.1 |
On Sunday 02 October 2005 01.13, Han-Wen Nienhuys wrote:
> Erik Sandberg wrote:
> > On Wednesday 28 September 2005 15.38, Fairchild wrote:
> >>Erik -
> >>
> >>Is this documented somewhere?
> >>
> >>\once \override Score.BarLine #'break-glyph-function = #(lambda (glyph
> >> dir) (if (> 0 dir) "|." "|:"))
> >
> > Nope, it's something I created using my limited guru skills.
> >
> > I just looked quickly, and I think \leftBar and \rightBar would be pretty
> > clumsy to implement without changing the scheme code for \bar slightly.
>
> Please elaborate? It would be something like
>
>
> #{ \once \override BarLine #'break-glyph-function =
> #(lambda (gl dir)
> ..stuff.. )
> \bar ...
> #}
It's the ..stuff.. part that doesn't look that nice. The break-glyph-function
created by \leftBar needs to know how to respond to dir=RIGHT as well, so
I think it would require the break-glyph-function to call the previously
defined break-glyph-function:
The ..stuff.. should be something like
(if (= dir LEFT) $glyph (prev-function dir))
where prev-function is set to the break-glyph-function value we're overriding.
I think this is possible, but it involves some dirty trickery.
> > Han-Wen, would you accept well-written patches to introduce \leftBar and
> > \rightBar commands? Suggestion for semantics:
> > - \bar sets the barline style for barlines not at line breaks, plus
> > defaults for barlines at breaks
>
> No. \bar should only create the barline specified.
I think I didn't express myself clearly enough: What I propose, is that \bar
does exactly the same as now, if not \leftBar/\rightBar is used. When
\leftBar or \rightBar is used and the bar occurs at a barline, then the
left/right part will be overridden.
> If you want special
> layout, then you should use a layout instruction, possibly hidden by a
> clever music function.
\leftBar/\rightBar would be clever music functions, which would hide some
layout instructions, namely a \once\override of some kind. I think the nicest
solution would be to change the bar-engraver to look for a property
'[left,right]-break-glyph before calling break-glyph-function.
--
Erik