Hi David,
(More concretely, in our use case, \myFunction expected "a chord or a
duration". This leads to a behaviour where

a2 \myFunction 4

does not change the "current duration", but

a2 \myFunction <a c>4

does.)
So let it expect a music expression only.  4 is a pitchless note event.

Thanks for the tip! This actually works in "normal" note entry mode, but it doesn't in our case, since our function is (at the current point of time) to be used in \figuremode, and here, the parser seems not to be willing to interpret 4 as ly:music?.

The problem is that in reality (sorry that I didn't mention this) our function is supposed to be given

- either a bass figure (e.g. <6 4> or <6 5>8)
- or just a duration.

This works with a predicate of the form (or (ly:music? x) (ly:duration? x)), but then the duration is not taken as the next default_duration. I'm not aware of any way let a music function accept a bass figure without explicit \figuremode - and I'd very much prefer to write this _once_ (at the outside), and not in every function call (at the inside).

Interestingly,

zing =
#(define-void-function (x) (ly:music?)
   #f)

\fixed c' { c1 \zing c4 c \zing 2 c c }

does not actually work.  But that arguably is a bug that should get
fixed.  If a duration is accepted as a note, it should affect the
default note duration.

Yes, probably. If I'm informed correctly I should not try to open an issue myself, but send a mail the bug list?

Lukas


Reply via email to