bug-lilypond
[Top][All Lists]
Advanced

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

Re: Typo in Snippets 2.11.39: compound-time example


From: Rune Zedeler
Subject: Re: Typo in Snippets 2.11.39: compound-time example
Date: Thu, 28 Feb 2008 17:30:31 +0100
User-agent: Thunderbird 2.0.0.6 (X11/20071022)

Valentin Villenave skrev:
It's a pity, however, that the number of args has to be hardcoded.
Would it be possible to write some "universal" compound-meter
function, where the numbers would be automatically taken into account
except the last number, which would be taken as denominator?

Sure.
I could not figure it out without doing a ly:load.
If somebody can fix this, then please! :-)


#(ly:load "markup.scm")
#(define (compound-time . args)
  (let* ((revargs (reverse args))
         (num (car revargs))
         (dens (reverse (cdr revargs))))
   (make-override-markup
    '(baseline-skip . 0)
    (make-number-markup
     (make-line-markup
      (cons
       (make-column-markup (list (car dens) num))
       (map (lambda (den)
             (make-line-markup (list
                                (make-vcenter-markup "+")
                                (make-column-markup (list den num)))))
        (cdr dens))))))))


-Rune




reply via email to

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