lilypond-user
[Top][All Lists]
Advanced

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

Customizing the position of the dots in repeat bar lines


From: Paul Morris
Subject: Customizing the position of the dots in repeat bar lines
Date: Sun, 20 Apr 2014 10:43:54 -0700 (PDT)

Hello everyone,

Here's an obscure one.  I have worked out a way to customize the vertical
position of the repeat dots in repeat bar lines.  This would be for use with
staves with custom line-positions, when you want something different from
LilyPond's default positioning.  As a side benefit it allows for an
arbitrary number of dots should that ever be needed.  I thought I would run
it by the list before submitting it to the LSR.  Any feedback would be
appreciated. 

Cheers,
-Paul


\version "2.18.2"

#(define (make-custom-colon-bar-line grob extent)
   "Draw repeat dots, placed at @var{dot-positions}.
The coordinates of @var{dot-positions} are equivalent to 
those of StaffSymbol.line-positions, a dot-position of X 
and a line-position of X will appear at the same vertical position."

   (let* ((staff-space (ly:staff-symbol-staff-space grob))
          (dot (ly:font-get-glyph (ly:grob-default-font grob) "dots.dot"))
          (dot-positions '(-1 1))
          (stencil empty-stencil))
     (for-each
      (lambda (dp)
        (let* ((stil dot)
               (stil (ly:stencil-translate-axis stil (* dp (/ staff-space
2)) Y)))
          (set! stencil (ly:stencil-add stencil stil))))
      dot-positions)
     stencil))

% comment out this line to see the difference:
#(add-bar-glyph-print-procedure ":" make-custom-colon-bar-line)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\new Staff \with {
  \override StaffSymbol.line-positions = #'(-4 -2 2 4)
} {
  \relative f' {
    c1
    \repeat volta 2 {
      d4 e f g
    }
  }
}




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Customizing-the-position-of-the-dots-in-repeat-bar-lines-tp161666.html
Sent from the User mailing list archive at Nabble.com.



reply via email to

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