lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Begin with a staff bar at left edge


From: Thomas Morley
Subject: Re: Begin with a staff bar at left edge
Date: Wed, 21 Sep 2011 14:23:30 +0200



2011/9/21 Janek Warchoł <address@hidden>
2011/9/14 Neil Puttock <address@hidden>:
> 2011/9/14 Janek Warchoł <address@hidden>:
>
>> Why shouldn't it be controlled by break-visibility?
>
> See output-lib.scm, bar-glyph-alist and bar-line::calc-glyph-name.

Ah, i see!  So the barline is affected by break-visibility, but the
stencil is empty in case of using \bar "|" at the beginning of the
line, isn't it?
So, \bar "|s" should do the trick?
...hmm, it doesn't work in the first measure, see:

{
 \bar "|s" s1 \break
 \bar "|s" s1 \break
 \bar "|s" s1 \break
}

i think it's a bug?

Also, should we add something like
("|hard" . ("|" . "|"))
to output-lib.scm?

cheers,
Janek

Hi Janek,

I don't think it's a bug, but the default behaviour.
It's possible to change with:

\version "2.14.2"

#(define my-bar-glyph-alist
  '(("|s" . ("|" . "|"))))
 
#(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))
    
bars = {    
        \once \override Staff.BarLine #'glyph-name = #my-bar-line::calc-glyph-name
        \bar "|s"
}

{
        \override Staff.Clef #'stencil = ##f
        \override Staff.TimeSignature #'stencil = ##f

 \bars a1 \break
 \bars a1 \break
 \bars a1
}
 
%{
 {
  \bar "|s" a1 \break
  \bar "|s" a1 \break
  \bar "|s" a1
 }
%}

Cheers,
  Harm


reply via email to

[Prev in Thread] Current Thread [Next in Thread]