[Top][All Lists]

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

Re: TimeSignature with note in denominator

From: Lukas-Fabian Moser
Subject: Re: TimeSignature with note in denominator
Date: Sat, 13 Nov 2021 16:09:45 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

Wouldn't it be easier to define an independent \kierenTime function that expects an integer (index?) numerator and a music (ly:music?) denominator? Then we could just write

\version "2.22"

kierenTime =
#(define-void-function (num den) (index? ly:music?)
   (format #t "~a\n" num)
   (display-lily-music den))

\kierenTime 3 { 8~8. }
\kierenTime 3 4.  % the dot is important :-)

... or, of course, a helper function that can be used after \time, like Aaron proposed.

\version "2.22"

time =
#(define-music-function (beat-structure fraction)
   ((number-list? '()) pair?)  ; note that pair? is way too general.
   (_i "Set @var{fraction} as time signature, with optional
number list @var{beat-structure} before it.")
   (if (fraction? fraction)
     (make-music 'TimeSignatureMusic
              'numerator (car fraction)
              'denominator (cdr fraction)
              'beat-structure beat-structure)
       (ly:warning "Non-fraction time signature not yet implemented.")
       (format #t "Given denominator:\n")
       (display-lily-music (cdr fraction))

kieren =
#(define-scheme-function (num den) (exact? ly:music?)
   (cons num den))

  \time 4/4
  \time \kieren 5 { 8~8.} c'4


reply via email to

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