Sorry for the noise on the mailing list - I knew it was some stupid mistake... 
I tried to override the wrong value, it should have been

\override Score.BarLine #'break-glyph-function = #my-bar-line::calc-glyph-name

instead of

\override Staff.BarLine #'glyph-name = #my-bar-line::calc-glyph-name

Corrected file attached. Cheers,

Matthias



Am Mittwoch, 16. Februar 2011 schrieb Matthias Hüsken:
> Hi again,
>
> while trying to change LilyPond's behaviour concerning bar lines, I
> stumbled upon some strange behaviour. What I'd like to achieve: When ending
> a bar with e repetition sign ":|", I need double lines ("||") at the
> beginning of the next bar.
>
> I found bar-glyph-alist in scm/output-lib.scm and decided to change it to
> the following lines (shortened for this example):
>
> #(define bar-glyph-alist
>   '(
>     ;; regular bar
>     ("|" . ("|" . ()))
>     ;; repetitions
>     ("|:" . ("|" . "|:"))
>     (":|" . (":|" . ()))
>     (":|:" . (":|" . "|:"))
>     ;; double lines
>     ("||" . ("||" . ()))
>     ;; double lines combined with repetitions
>     ("||:" . ("||" . "|:"))
>     (":||" . (":|" . "||"))
>     ))
>
> When setting music now, everything works as expected.
>
> As I consider changing LilyPond's default files as hacking, I decided to
> move the list into my .ly file (see attached file) and revert
> scm/output-lib.scm to its original state. Unfortunately, this does not
> work: LilyPond leaves the end of the line (where a repetition sign ":|"
> should be found) empty, as well as the beginning of the next line.
>
> Does anyone have any clues what's going wrong?
>
> Thanks,
>
> Matthias



-- 
------------------------------------------------
Matthias Hüsken          Phone: +49 202 439-3362
Fachbereich Mathematik   Fax:   +49 202 439-2912
Bergische Universität
Gaußstraße 20
D - 42097 Wuppertal
------------------------------------------------
e-mail: matthias.hues...@math.uni-wuppertal.de
------------------------------------------------
\version "2.12.2"

% override default bar types to allow arbitrarily placed bar lines
#(define my-bar-glyph-alist
  '(
    ;; regular bar
    ("|" . ("|" . ()))
    ;; repetitions
    ("|:" . ("|" . "|:"))
    (":|" . (":|" . ()))
    (":|:" . (":|" . "|:"))
    ;; double lines
    ("||" . ("||" . ()))
    ;; double lines combined with repetitions
    ("||:" . ("||" . "|:"))
    (":||" . (":|" . "||"))
    ))

#(define (my-bar-line::calc-glyph-name grob)
  (let* (
          (index-cell (lambda (cell dir)
                        (if (equal? dir 1)
                            (cdr cell)
                            (car cell))))
          (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
  ))


\new Score
{
        \new Staff
        {
            \override Score.BarLine #'break-glyph-function = 
#my-bar-line::calc-glyph-name
            \bar "|:" g'1 \bar ":||" \break
            g'1 \bar "||" \break
        }
}
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to