2008/11/10 Graham Percival <[EMAIL PROTECTED]>:
> I forgot about that.  Look at my second email in that thread.
> http://lists.gnu.org/archive/html/lilypond-user/2008-10/msg00681.html

Thanks for the pointer. After a couple hours' tweaking I came up with
these. I ruthlessly exploited your implementation as a template. :-) I
hope you don't mind.

Most of the time it seems to work nicely. The 12/8 time grouping seems
to be messed up, although, I'm not sure if these kinds of groupings
exist in a real world.

-Risto
\version "2.11.62"

parenthps = #"
0 0 translate
45 45 scale
0 0 0 setrgbcolor
[] 0 setdash
1 setlinewidth
0 setlinejoin
0 setlinecap
newpath
0.0147465 0 moveto
0.011106 0.00351338 0.00916298 0.00598483 0.00710032 0.00978362 curveto
0.00248893 0.01832964 3e-008 0.02925362 3e-008 0.04074722 curveto
3e-008 0.05157272 0.00218483 0.06173772 0.00625033 0.07019282 curveto
0.00855727 0.07474937 0.01061993 0.07759971 0.0147465 0.08158922 curveto
0.0147465 0.07807584 lineto
0.00867816 0.06971302 0.00625033 0.05898344 0.00625033 0.04074724 curveto
0.00625033 0.02250984 0.00867816 0.01187244 0.0147465 0.00351344 curveto
0.0147465 6e-008 lineto
0.0147465 0 lineto
closepath
fill"

parenthL = \markup
{
   \with-dimensions #'(0 . 0.68) #'(0 . 3.67)
   \postscript #parenthps
}

parenthR = \markup { \rotate #180 \parenthL }

  
compoundTimeSigParenth = #(define-music-function
  (parser layout timesig compound) (list? list?)
  #{
    % graphical display
    \once \override Staff.TimeSignature #'stencil = #ly:text-interface::print
    \once \override Staff.TimeSignature #'text = #(markup
       #:override '(baseline-skip . 0) #:number 
            ;; First create the main time signature
           (#:line (#:left-align (#:center-column (
           (number->string (car $timesig))
           (number->string (cadr $timesig)))) 
           #:concat(#:vcenter parenthL #:hspace 0.2 
           ;; then the compound "numerator" part
           #:left-align (#:center-column ((#:concat (
           ;; list the additive portions of the time signature,
           ;; adding "+" between items.
           (make-line-markup (list-insert-separator
             (map (lambda (n)
                 (markup (number->string n)))
              $compound)
             (markup "+"))))) 
          ;; and lastly the "denominator" part
         (number->string (cadr $timesig)))) 
         #:hspace 0.2 #:vcenter parenthR))))

    % measure length + beaming
    \set Timing.timeSignatureFraction = #(cons (car $timesig) (cadr $timesig))
    \set Timing.beatLength = #(ly:make-moment 1 (cadr $timesig) 0 1)
    \set Timing.beatGrouping = $compound
    \set Timing.measureLength = #(ly:make-moment (car $timesig) (cadr $timesig) 0 1)
  #})
  
  
\version "2.11.62"

% Created by gpermus
% Hi-jacked by risvaara

\include "compound_parentheses.ly"

\relative c' {
  \compoundTimeSigParenth #'(5 8) #'(3 2)
  c8 d16 d e e fis fis gis gis
  \compoundTimeSigParenth #'(5 8) #'(2 3)
  c,8 d16 d e e fis fis gis gis
  \compoundTimeSigParenth #'(5 4) #'(2 3)
  c,8 c d d e e f f g g
  \compoundTimeSigParenth #'(5 4) #'(3 2)
  c,8 c d d e e f f g g
  \compoundTimeSigParenth #'(8 8) #'(3 3 2)
  a8 a a e' e e c c
  \compoundTimeSigParenth #'(12 8) #'(3 3 2 4)
  a8 a a e' e e c c e e c c
  \compoundTimeSigParenth #'(7 8) #'(2 2 3)
  a a b b cis cis cis

  \time 4/4
  a a b b cis cis d d
}

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

Reply via email to