lilypond-devel
[Top][All Lists]
Advanced

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

Re: TimeSignature with note in denominator


From: Aaron Hill
Subject: Re: TimeSignature with note in denominator
Date: Mon, 08 Nov 2021 12:04:06 -0800
User-agent: Roundcube Webmail/1.4.9

On 2021-11-08 11:36 am, Kieren MacMillan wrote:
3. Is there an ly:string->duration [or similar] function, that will
take "4." and turn it into a duration that I can use to generate the
right glyph(s)?

Technically, you could create string->duration:

%%%%
#(define (string->duration str)
  (let* ((parser (ly:parser-clone '()))
         (music (ly:parse-string-expression parser str)))
   (if (ly:duration? music) music (ly:error "Expecting duration"))))

{ b' $(string->duration "4.") c'' $(string->duration "8") }
%%%%

But it would seem better to let the parser do the work by having the function accept a ly:duration? directly. Certainly, it would be easier to use:

%%%%
\timeII 3 4.  % logically \time 9/8
%%%%


-- Aaron Hill



reply via email to

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