Re: Access "current duration" from music functions

2020-06-26 Thread Lukas-Fabian Moser
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 4 does.) So let it expect a music expression only. 4 is a pitchless note event. Thanks for

Re: Access "current duration" from music functions

2020-06-26 Thread David Kastrup
Lukas-Fabian Moser 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 t

Re: Access "current duration" from music functions

2020-06-26 Thread Lukas-Fabian Moser
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

Re: Access "current duration" from music functions

2020-06-26 Thread David Kastrup
Lukas-Fabian Moser writes: > Hi Aaron & David, >> Well, it's more a bug like anything else I guess, but >> >> (ly:music-property #{ q #} 'duration) >> >> at the current point of time would appear to do the trick. >> > Which seems solve the "reading" part of the problem, yes. Thanks much > (and al

Re: Access "current duration" from music functions

2020-06-26 Thread Lukas-Fabian Moser
Hi Aaron & David, Well, it's more a bug like anything else I guess, but (ly:music-property #{ q #} 'duration) at the current point of time would appear to do the trick. Which seems solve the "reading" part of the problem, yes. Thanks much (and also to Aaron for pointing out the corresponding

Re: Access "current duration" from music functions

2020-06-26 Thread David Kastrup
Aaron Hill writes: > On 2020-06-26 6:13 am, Lukas-Fabian Moser wrote: >> Is it possible to access this "current duration" from a music or >> scheme function? > > Looks to be stored in Lily_parser::default_duration_ which, while > public in the C++ interface, does not appear to be exposed to Schem

Re: Access "current duration" from music functions

2020-06-26 Thread Aaron Hill
On 2020-06-26 6:13 am, Lukas-Fabian Moser wrote: Is it possible to access this "current duration" from a music or scheme function? Looks to be stored in Lily_parser::default_duration_ which, while public in the C++ interface, does not appear to be exposed to Scheme as far as I can tell. --

Access "current duration" from music functions

2020-06-26 Thread Lukas-Fabian Moser
Folks, the following question came up (well, by me) in the recent thread start by Urs Liska "Combine Text/Lyrics with bass figures": The LilyPond parser (?) has some notion of "current duration": A note with explicit duration sets the next duration that is assumed if none is given. Hence { a