lilypond-user
[Top][All Lists]
Advanced

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

Re: Adding durations (for \after)


From: David Kastrup
Subject: Re: Adding durations (for \after)
Date: Fri, 11 Nov 2022 01:39:52 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Lukas-Fabian Moser <lfm@gmx.de> writes:

>  Well, duration-or-music? already exists and it's used by \skip.
>
> Ah, my bad, I didn't think of looking whether it might already
> exist. I'm surprised that such an either-/or type predicate doesn't
> wreak havoc with the parser.

The parser doesn't have a hardwired notion of predicates for
music/scheme/void functions.  It throws various interpretations at the
predicate and then decides which syntax to pursue.

That makes the syntax tree/table Bison can produce comparatively
pointless for figuring out how things are going to get interpreted.

Partly because many syntactic decisions in the context of music
functions are not actually determined by the grammar but by code poking
at predicate functions and directing the parser by using synthetic
tokens.  And partly because a lot of stuff that was previously visible
in the syntax has been moved into music functions.

>  However, this makes for the slight oddity that \skip 4 ... does not set the 
>  default duration for the following music, whereas \skip {4} does. 
>
> Which reminds me: Making the current parser default duration
> scheme-accessible is a long-standing project of mine. This might
> creating well-behaved music functions a little easier.

(ly:music-property #{ q #} 'duration)

-- 
David Kastrup



reply via email to

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