Dear all,

I am pleased to re-announce that I am an idiot.  Please ignore the
previous message about "elegant" compound time signatures; the
attached file is *much* better.

- arbitrary time signatures, with arbitrary compound-ness.
- more aesthetically pleasing graphical display, including less
  wasted score-space
- nicer .ly files (although still not ideal, this is as good as it
  can get without messing with the parser)

Cheers,
- Graham

\version "2.11.62"
compoundTimeSignature = #(define-music-function
  (parser layout timesig compound) (list? list?)
  #{
    % graphical display
    \once \override Staff.TimeSignature #'Y-offset = #3
    \once \override Staff.TimeSignature #'stencil = #ly:text-interface::print
    \once \override Staff.TimeSignature #'text = #(markup
       %% parenthetical display of compound-ness
       #:column(
        #:small #:line(
          #: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 "+")))
          ")"
         ))
       #:override '(baseline-skip . 0)
      %% main time signature display
      (#:number #:line(
         #:column(
           (number->string (car $timesig))
           (number->string (cadr $timesig)))
         ))))

    % 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"
\include "compound.ly"

\relative c' {
  \compoundTimeSignature #'(5 8) #'(3 2)
  c8 d16 d e e fis fis gis gis
  \compoundTimeSignature #'(5 8) #'(2 3)
  c,8 d16 d e e fis fis gis gis
  \compoundTimeSignature #'(5 4) #'(2 3)
  c,8 c d d e e f f g g
  \compoundTimeSignature #'(5 4) #'(3 2)
  c,8 c d d e e f f g g

  \compoundTimeSignature #'(8 8) #'(3 3 2)
  a8 a a e' e e c c
  \compoundTimeSignature #'(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
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to