lilypond-user
[Top][All Lists]
Advanced

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

Re: `\afterGrace` and clef problem


From: David Kastrup
Subject: Re: `\afterGrace` and clef problem
Date: Mon, 13 Feb 2023 18:08:49 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

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

> Hi Werner,
>
>>> Alternatively you may try to use \afterGrace to insert the \clef
>>> before the bar line, although this would probably require some
>>> manual spacing too.
>> This doesn't work at all: `\afterGrace` doesn't accept a clef, as the
>> image shows.
>
> afterGrace is defined as
>
> #(define-music-function (fraction main grace) ((scale?) ly:music?
>  ly:music?) ...)
>
> You write
>
> \afterGrace 1 { s8 \clef "bass" } | c,1
>
> but 1 is a valid scale? because of
>
> (define-public (scale? x)
>   (or (and (rational? x) (exact? x) (not (negative? x)))
>       (fraction? x)
>       (and (ly:moment? x) (scale? (ly:moment-main x)))))
>
> in scm/c++.scm.

That begs the question whether it would make sense to restrict
afterGrace scales to values below 1.  But I think that making syntactic
decisions based on values rather than types is really icky.  It is
probably a bad idea to make syntactic decisions that one would not
expect a syntax highlighter to be able to figure out.

-- 
David Kastrup



reply via email to

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