lilypond-user
[Top][All Lists]
Advanced

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

Re: Access "current duration" from music functions


From: David Kastrup
Subject: Re: Access "current duration" from music functions
Date: Fri, 26 Jun 2020 18:10:12 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Lukas-Fabian Moser <lfm@gmx.de> 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 also to Aaron for pointing out the corresponding bit of C++).
>
> And basically, your solution seems to be a variant (of course much
> more elegant!) of my clumsy
>
> get-current-duration =
> #(define-scheme-function () ()
>    (let* ((tempmusic #{ {a} #})
>           (els (ly:music-property tempmusic 'elements)))
>      (ly:music-property (car els) 'duration)))
>
> But it does not seem to be possible to _set_ this "current duration"
> from scheme, does it?

Why would that be a good idea?

-- 
David Kastrup



reply via email to

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