lilypond-user
[Top][All Lists]
Advanced

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

Re: invisible barlines at breaks


From: Mats Bengtsson
Subject: Re: invisible barlines at breaks
Date: Thu, 17 Jan 2008 14:30:20 +0100
User-agent: Thunderbird 2.0.0.5 (X11/20070716)

You can add the following just before your \bar "|:" (I would rather recommend you to use the \repeat command to typeset the |: and :|, though and in that case, the
following command should be just before the \repeat.)
\once \override  Score.BarLine #'break-visibility = #end-of-line-invisible

Below, you can find a complicated alternative solution that adds a new bar type
with this behaviour, so you could say \bar "e|:".


\version "2.10.33"

#(define my-bar-glyph-alist
 '((":|:" . (":|" . "|:"))
   ("||:" . ("||" . "|:"))
   ("dashed" . ("dashed" . '()))
   ("|" . ("|" . ()))
   ("||:" . ("||" . "|:"))
   ("|s" . (() . "|"))
   ("|:" . ("|" . "|:"))
   ("e|:" . (() . "|:"))
   ("|." . ("|." . ()))

   ;; 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))))


\layout{
 \context{
   \Score
   \override BarLine #'glyph-name = #bar-line::my-calc-glyph-name
\override BarLine #'break-visibility = #bar-line::my-calc-break-visibility
 }
}

\relative c'{
e4 e e e | e e e \bar "e|:" \break e | e e e e |
}




  /Mats

Dominic Neumann wrote:
Hi,

I´ve got a little problem. When I write music, sometimes it is necessary to
insert a break where there´s a special barline, e.g. if you have
something like that:

e4 e e e | e e e \bar "|:" e | e e e e | ...

it would be nicer to insert a break at the "|:" barline. This works
great by writing

e4 e e e | e e e \bar "|:" \break e | e e e e | ...

but the problem is that I need an invisible barline before the break. Lilypond
prints a normal barline there and that´s not what I want.

I also tried

e4 e e e | e e e \bar "" \break \bar "|:" e | e e e e | ...

but this didn´t work.

Could you please give me a hint?

Thanks, Dominic


--
=============================================
        Mats Bengtsson
        Signal Processing
        Signals, Sensors and Systems
        Royal Institute of Technology
        SE-100 44  STOCKHOLM
        Sweden
        Phone: (+46) 8 790 8463                         
       Fax:   (+46) 8 790 7260
        Email: address@hidden
        WWW: http://www.s3.kth.se/~mabe
=============================================





reply via email to

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