lilypond-user
[Top][All Lists]
Advanced

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

Re: initial repeats with alternate bar style


From: Tim Slattery
Subject: Re: initial repeats with alternate bar style
Date: Wed, 01 Sep 2010 09:23:00 -0400

Steve Tarr <address@hidden> wrote:

>I'm trying to reproduce some Sacred Harp music.  The piece starts with a 
>repeated section which starts with a partial measure.  It's marked with 
>a column of dots at the beginning of the piece.  The snippet shown in 
>"Printing a repeat sign at the beginning of a piece" doesn't have the 
>desired effect in this case.

I don't know whether this will help your case, but the following *.ly
file written by Leland Kusmer will redefine Lilypond's standard repeat
markings to sacred harp style (column of four square dots).

There is also a FaSoLi email group at googlegroups
(address@hidden). It's been inactive for a while, since
Leland posted his file and a Lilypond version (still recommended
developers-only) came out with better SH support, but it should still
be there, and there are folks on it who set SH-style music in
Lilypond.

% Implements SH-style Repeats
% Add 
%       \override Staff.BarLine #'stencil = #with-shapenote-repeats
% in \global to activate.

% Tune-final barlines must be specified. Use
%       \bar ":||" 
% for a final repeat and 
%       \bar "|."
% otherwise.

% Use 
%       \bar "||"
% to get a thick barline (i.e. optional repeat).

\version "2.12.1"

#(define (with-shapenote-repeats grob)  (let ((g-n (ly:grob-property
grob 'glyph-name)))
  (cond      
    ((string=? g-n "|:") (dotFn grob))  
    ((string=? g-n ":") (dotFn grob))
    ((string=? g-n ":|") (barDotFn grob))
    ((string=? g-n ":||") (barDotFnD grob))
    ((string=? g-n "||") (thickBar grob))
    ((string=? g-n "|.") (doubleBar grob))
    (else (ly:bar-line::print grob))))) 

# (define (doubleBar grob)
    (interpret-markup
       (ly:grob-layout grob)
       '(((baseline-skip . 1) (word-space . 0.4) (thickness . 1.9)))
       (markup
         #:right-align
         #:vcenter
         #:line (
           #:raise 2 
           #:override '(thickness . 5) 
           #:draw-line '(0 . -3.7)
           #:hspace 0.1
           #:raise 2 
           #:override '(thickness . 5) 
           #:draw-line '(0 . -3.7)
         )
       )
    )
  )

# (define (barDotFn grob)
    (interpret-markup
    (ly:grob-layout grob)
    '(((baseline-skip . 1) (word-space . 0.4) (thickness . 1.9)))
    (markup
       #:right-align
       #:vcenter
       #:line (
         #:raise 1.5
         #:column (#:filled-box '(0 . 0.35) '(0 . 0.35) 0 
                   #:filled-box '(0 . 0.35) '(0 . 0.35) 0  
                   #:filled-box '(0 . 0.35) '(0 . 0.35) 0  
                   #:filled-box '(0 . 0.35) '(0 . 0.35) 0  
         )
         #:hspace 0.1
         #:raise 2 
         #:override '(thickness . 5) 
         #:draw-line '(0 . -3.7) 
       ) 
     ) 
   )
 )
     
# (define (barDotSt grob)
    (interpret-markup
      (ly:grob-layout grob)
      '(((baseline-skip . 1) (word-space . 0.4) (thickness . 1.9)))
      (markup
        #:right-align
        #:vcenter
        #:line (
          #:raise 1.5
          #:override '(thickness . 5) #:draw-line '(0 . -3.7) )
          #:hspace 0.1
          #:raise 1.25
          #:column (
            #:filled-box '(0 . 0.35) '(0 . 0.35) 0 
            #:filled-box '(0 . 0.35) '(0 . 0.35) 0  
            #:filled-box '(0 . 0.35) '(0 . 0.35) 0  
            #:filled-box '(0 . 0.35) '(0 . 0.35) 0  
          )
      ) 
    )
  )
     
# (define (barDotFnD grob)
  (interpret-markup
    (ly:grob-layout grob)
    '(((baseline-skip . 1) (word-space . 0.4) (thickness . 1.9)))
    (markup
      #:right-align
      #:vcenter
      #:line 
      (
        #:raise 1.5
        #:column (
          #:filled-box '(0 . 0.35) '(0 . 0.35) 0 
          #:filled-box '(0 . 0.35) '(0 . 0.35) 0  
          #:filled-box '(0 . 0.35) '(0 . 0.35) 0  
          #:filled-box '(0 . 0.35) '(0 . 0.35) 0  
        )
        #:vcenter
        #:hspace 0.1
        #:raise 2 
        #:override '(thickness . 5) 
        #:draw-line '(0 . -3.7)
        #:hspace 0.1
        #:raise 2 
        #:override '(thickness . 5) #:draw-line '(0 . -3.7) 
      ) 
    ) 
  ) 
)


# (define (dotFn grob)
    (interpret-markup
      (ly:grob-layout grob)
      '(((baseline-skip . 1) (word-space . 0.8) (thickness . 3)))
      (markup
        #:right-align
        #:vcenter
        #:line (
          #:raise 1.5
          #:column (#:filled-box '(0 . 0.35) '(0 . 0.35) 0 
                    #:filled-box '(0 . 0.35) '(0 . 0.35) 0  
                    #:filled-box '(0 . 0.35) '(0 . 0.35) 0  
                    #:filled-box '(0 . 0.35) '(0 . 0.35) 0  
          )
        ) 
      )
    )
  )
     
     
# (define (thickBar grob)
    (interpret-markup
      (ly:grob-layout grob)
      '(((baseline-skip . 1) (word-space . 0.8) (thickness . 3)))
      (markup
        #:right-align
        #:vcenter
        #:override '(thickness . 5) #:draw-line '(0 . -3.7)
      )
    )
  )
  

-- 
Tim Slattery
address@hidden
http://members.cox.net/slatteryt




reply via email to

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