lilypond-user
[Top][All Lists]
Advanced

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

Re: No clef and key each line


From: Mats Bengtsson
Subject: Re: No clef and key each line
Date: Thu, 20 Apr 2006 21:36:22 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050927 Debian/1.7.8-1sarge3

One ugly solution is to add the following at the top of your
file:

#(define-public (index-cell cell dir)
 (if (equal? dir 1)
     (cdr cell)
     (car cell)))


#(define-public (bar-line::my-calc-glyph-name grob)
 (let* (
        (glyph (ly:grob-property grob 'glyph))
        (dir (ly:item-break-dir grob))
        (result (assoc glyph
                      '((":|:" . (":|" . "|:"))
                        ("||:" . ("||" . "|:"))
                        ("|" . ("|" . "|"))
                        ("||:" . ("||" . "|:"))
                        ("|s" . (() . "|"))
                        ("|:" . ("|" . "|:"))
                        ("|." . ("|." . ()))

                        ;; hmm... should we end with a bar line here?
                        (".|" . ("|" . ".|"))
                        (":|" . (":|" . ()))
                        ("||" . ("||" . ()))
                        (".|." . (".|." . ()))
                        ("" . ("" . ""))
                        (":" . (":" . ""))
                        ("." . ("." . ()))
                        ("empty" . (() . ()))
                        ("brace" . (() . "brace"))
                        ("bracket" . (() . "bracket"))  )))
        (glyph-name (if (= dir CENTER)
                        glyph
(if (and result (string? (index-cell (cdr result) dir)))
                            (index-cell (cdr result) dir)
                            #f)))
        )

   (if (not glyph-name)
       (ly:grob-suicide! grob))

   glyph-name))

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


I don't know if there's any simpler method.

  /Mats

Jennifer Clark wrote:

Mats Bengtsson wrote:

If you read in "Common Tweaks" in the manual, you can
learn about the property called transparent. However, in
this case, I don't think you want the removed clefs and
key signatures to occupy any space. Then, you can instead
add
 \override Score.KeySignature #'stencil = ##f
 \override Score.Clef #'stencil = ##f
somewhere after the first note (since you don't want it
to apply to the first line) in one of the voices.

That's really cool Mats, I just tried it and it is ideal for jazz leadsheets. Is there a way of doing it that would add a vertical bar line at the start of each line though, rather than leaving it "blank" as it is at the moment?

Cheers!

Jennifer


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



--
=============================================
        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]