lilypond-user
[Top][All Lists]
Advanced

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

Access "current duration" from music functions


From: Lukas-Fabian Moser
Subject: Access "current duration" from music functions
Date: Fri, 26 Jun 2020 15:13:29 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0

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 { a4 b a b8 a b } will create three crotchets followed by three quavers.

Is it possible to access this "current duration" from a music or scheme function?

a) for reading: in order to create events with the same duration that any note would get if directly entered? (This is possible by using #{ $pitch #} and the like, but that does not make the duration in itself scheme-readable.)

Something like { a8. \myFunction c16 } where \myFunction, for instance, displays "I would create a 8."

b) for writing: in order to tell the parser which duration to assume for the next explicitly entered note (if it does not have an explicit duration) ?

Something like { a4 \myGunction b a } where \myGunction performs some magic such that the following b a are interpreted as b8 a8?

Best
Lukas





reply via email to

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