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: David Kastrup
Subject: Re: TimeSignature with note in denominator
Date: Sat, 13 Nov 2021 02:03:14 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Kieren MacMillan <kieren_macmillan@sympatico.ca> writes:

> Hi Jean,
>
>> A unified \time command is
>> not trivial to achieve from a parsing perspective. If the
>> syntax of the argument is "4/4.", there is work to be done
>> in the parser to let it accept it. "4 4." is feasible with
>> a separate function, but I am pretty sure it isn't with
>> a unified music function. Again, fiddling with the parser
>> would be required.
>
> Currently, both
>
>     \time 4/4
>
> and
>
>     \time #'(4 . 4)
>
> are accepted, and return the same thing.

They don't "return" the same thing, they _are_ the same thing.  4/4 _is_
#'(4 . 4).  Neither are the same as #4/4 (a Scheme rational number)
which is indistinguishable from #1 .  Because musical fractions 4/4 and
2/2 are completely different things, the Scheme representation cannot be
a rational number but has to be a number pair.

> So no parser-fiddling is required (I believe?),

The equivalence is established in the lexer in this case.

> as long as you change \time so that it accepts a pair:
>
> time =
> #(define-music-function (beat-structure fraction)
>   ((number-list? '()) pair?)
>
> At that point, the only issue is to turn
>
>     \time #'(4 . "4.")
>
> into an number num and a *duration* (not number) denom… which again
> doesn’t required parser-fiddling, correct?

Utterly incorrect.  #'(4 . "4.") does not consult the LilyPond parser
beyond the # and there is absolutely nothing that would magically turn
"4." into a duration.  Nor should there be in my book.

-- 
David Kastrup



reply via email to

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