Hello Simon,

looking at the definition of `\time` it seems like the interface changed with 
commit 13de0b3cd2d7d9f2f79c4a8c27549a4556498095 (Support complex signatures in 
TimeSignatureMusic).

Here the interface of denominator and numerator is changed to a single `time-
signature` property, which I think can be a bit more complex than just a 
single fraction.

Cheers,
Tina

Am Sonntag, 19. Oktober 2025, 15:26:17 Mitteleuropäische Sommerzeit schrieb 
Simon Albrecht:
> Hi everyone,
> 
> I’m trying to update a library function of mine that automatically adds
> \newSpacingSection and overrides SpacingSpanner for every new time
> signature in its music argument.
> 
> Why is it throwing an error now when it didn’t before? I tried calling
> ly:music-property on a \time command in the scheme-sandbox and it worked
> fine.
> 
> (General recommendations on coding welcome)
> 
> Best, Simon
> 
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> \version "2.25.28"
> 
> #(define (convrter m)
>     (cond ((eq? (ly:music-property m 'name) 'TimeSignatureMusic)
>            (let ((denom (ly:music-property m 'denominator)))
>              #{
>                $m
>                \newSpacingSection
>                \override Score.SpacingSpanner.common-shortest-duration =
> #(ly:make-moment (/ denom 2))
>              #}))
>           (else m)))
> 
> 
> convrt =
> #(define-music-function (mus) (ly:music?)
>     (music-map convrter mus))
> 
> \context Bottom <<
>    \convrt {
>      \time 3/1
>    }
>    { 1 1 1 }
> 
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> Starting lilypond 2.25.28 [mensural-timing-converter-debug.ly]...
> Processing
> `/home/simon/typesetting/library/mensural-timing-converter-debug.ly'
> Parsing...
> /home/simon/typesetting/library/mensural-timing-converter-debug.ly:10:74:
> error: Guile signaled an error for the expression beginning here
>                \override Score.SpacingSpanner.common-shortest-duration = #
> (ly:make-moment (/ denom 2))
> No applicable method for #<<generic> / (3)> in call (/ () 2)
> /home/simon/typesetting/library/mensural-timing-converter-debug.ly:20:3:
> error: error in #{ ... #}
> 
>    \convrt {
> Interpreting music...
> Preprocessing graphical objects...
> Finding the ideal number of pages...
> Fitting music on 1 page...
> Drawing systems...
> Converting to `mensural-timing-converter-debug.pdf'...
> fatal error: failed files:
> "/home/simon/typesetting/library/mensural-timing-converter-debug.ly"
> Exited with return code 1.

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to