Lukas-Fabian Moser <l...@gmx.de> writes: > Hi David, >>> But it does not seem to be possible to _set_ this "current duration" >>> from scheme, does it? >> Why would that be a good idea? > > Consider a situation where \myFunction with signature (ly:duration?) > generates some complex music expression in which the given duration is > used. > > Currently, in > > (*) { a2 \myFunction 4 c } > > is equivalent to > > { a2 \myFunction 4 c2 } > > but in some situations it might be more natural for the user to expect > (*) to yield > > { a2 \myFunction 4 c4 }. > > > (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. 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. -- David Kastrup