lilypond-user
[Top][All Lists]
Advanced

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

Question to Mats (was: Re: a few lead sheet questions)


From: Daniel Leidisch
Subject: Question to Mats (was: Re: a few lead sheet questions)
Date: Sat, 11 Aug 2007 18:51:57 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

I searched the archives in order to find a way to insert bar lines at
the left side of staves and found two interesting threads. In the
newer thread you mentioned that it was not possible (because of
something hardcoded) and there was no reply to your article at the
lilypond-devel archive.

However, I found a thread from last year in which you posted an “ugly
solution” which I tried (2.10.25).

The code works, but unfortunately I can neither use my sectionLetter
nor “\bar "||"” insertions.

Is there now a way to have those bar lines in a “non ugly” way, or to
make your code work with my sectionLetter and “\bar "||"”?

TIA

dhl


,----[ sectionLetter ]
| sectionLetter =
| #(define-music-function (parser location letter) (string?)
|       #{
|         \once \override Score.RehearsalMark #'extra-offset = #'(-9 . 1)
|         \mark \markup{\box{\bold{ $letter }}}
|       #})
`----

,----[ your code ]
| #(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
|   }
| } 
`----




reply via email to

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